/* H2APEX Projekte – Design-Tokens wie h2apex-events / h2apex-dam */
:root {
  --c-primary:   #14a0de;
  --c-primary-d: #1186ba;
  --c-dark:      #0b2530;
  --c-accent:    #ED1E24;
  --c-bg:        #f3f6f8;
  --c-surface:   #ffffff;
  --c-border:    #e4eaee;
  --c-text:      #1a2744;
  --c-muted:     #6f8089;
  --c-success:   #1a9e6b;
  --c-success-bg:#e7f7ef;
  --c-error:     #dc2626;
  --c-error-bg:  #fdebea;
  --c-warning:   #c26a04;
  --c-warning-bg:#fef3e2;
  --c-tint:      #eaf6fc;
  --c-violet:    #7c3aed;
  --c-violet-bg: #f1ebfe;
  --r-card:      16px;
  --r-sm:        9px;
  --nav-h:       60px;
  --bar-h:       48px;
  --shadow-sm:   0 1px 2px rgba(11,37,48,.04), 0 8px 24px rgba(11,37,48,.05);
  --shadow-md:   0 4px 14px rgba(11,37,48,.08);
  --shadow-lg:   0 16px 36px rgba(11,37,48,.16);
  --transition:  150ms ease;
  --font:         'IBM Plex Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--c-bg); color: var(--c-text); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--c-primary-d); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, .page-title, .panel-title, .brand-name { font-family: var(--font-display); color: var(--c-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* ── Navigation ─────────────────────────────────────────────── */
.top-nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: var(--c-dark); display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
}
.nav-brand { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; text-decoration: none !important; }
.nav-logo { height: 21px; width: auto; }
.brand-name { font-weight: 600; font-size: .95rem; letter-spacing: .06em; color: rgba(255,255,255,.85); padding-left: .7rem; border-left: 1px solid rgba(255,255,255,.25); }
.nav-collapse { display: flex; align-items: center; flex: 1; min-width: 0; gap: 1rem; }
.nav-main { display: flex; align-items: center; gap: .15rem; flex: 1; min-width: 0; }
.nav-link {
  padding: .45rem .7rem; border-radius: var(--r-sm); white-space: nowrap;
  color: rgba(255,255,255,.72); font-size: .86rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: .35rem; margin-left: auto; flex-shrink: 0; }
.nav-user-link { display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem; border-radius: var(--r-sm); color: #fff; text-decoration: none !important; }
.nav-user-link:hover, .nav-user-link.active { background: rgba(255,255,255,.1); }
.user-name { font-size: .85rem; font-weight: 500; }
.nav-logout { display: flex; }
.nav-logout-label { display: none; }
.nav-burger { display: none; margin-left: auto; background: none; border: 0; color: #fff; padding: .45rem; border-radius: var(--r-sm); }
.nav-burger svg { width: 22px; height: 22px; display: block; }

.btn-icon { background: none; border: none; color: var(--c-muted); padding: .4rem; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: .4rem; position: relative; }
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon:hover { color: var(--c-dark); background: var(--c-bg); }
.nav-icon { color: rgba(255,255,255,.65); }
.nav-icon:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Firmen-Leiste */
.co-bar {
  position: sticky; top: var(--nav-h); z-index: 90; min-height: var(--bar-h);
  background: #fff; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .4rem 1.25rem;
}
.co-switch { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.co-switch-label { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c-muted); margin-right: .35rem; }
.co-pill {
  --co: var(--c-primary);
  display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .75rem; border-radius: 20px;
  font-size: .8rem; font-weight: 500; color: var(--c-text); border: 1.5px solid var(--c-border); background: #fff;
}
.co-pill:hover { border-color: var(--co); text-decoration: none; }
.co-pill.active { background: var(--co); border-color: var(--co); color: #fff; font-weight: 600; }
.co-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--co); }
.co-pill.active .co-dot { background: #fff; }
.new-menu { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 120; min-width: 200px;
  background: #fff; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: .35rem; display: flex; flex-direction: column;
}
.dropdown a, .dropdown button { display: block; text-align: left; padding: .55rem .7rem; border-radius: 7px; color: var(--c-text); font-size: .86rem; background: none; border: 0; }
.dropdown a:hover, .dropdown button:hover { background: var(--c-bg); text-decoration: none; }

/* Benachrichtigungen */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: 1px; right: 1px; background: var(--c-accent); color: #fff; border-radius: 20px;
  font-size: .62rem; font-weight: 700; min-width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 200; width: 340px; max-width: 92vw; background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow-lg); overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--c-border); font-weight: 700; font-size: .85rem; color: var(--c-dark); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--c-muted); font-size: .82rem; }
.notif-item { display: block; padding: .65rem 1rem; border-bottom: 1px solid var(--c-bg); font-size: .8rem; color: var(--c-text); }
.notif-item:hover { background: var(--c-bg); text-decoration: none; }
.notif-item.unread { background: rgba(20,160,222,.07); }
.notif-item b { display: block; font-weight: 600; }
.notif-item small { color: var(--c-muted); }
.notif-foot { display: block; text-align: center; padding: .6rem; font-size: .8rem; border-top: 1px solid var(--c-border); }
.link-btn { background: none; border: 0; color: var(--c-primary-d); font-size: .8rem; font-weight: 500; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ── Seite ─────────────────────────────────────────────────── */
.page-body { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; }
body.wide .page-body { max-width: none; }
body.bare .page-body { max-width: none; padding: 0; }
.app-footer { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: 1.5rem 1.25rem 2rem; font-size: .78rem; color: var(--c-muted); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-title { font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.page-sub { color: var(--c-muted); font-size: .88rem; margin-top: .25rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumbs { font-size: .8rem; color: var(--c-muted); margin-bottom: .4rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-primary-d); }

.flash-stack { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.flash-stack:empty { display: none; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.1rem; font-size: .875rem; font-weight: 500; border-radius: var(--r-sm); }
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--c-success); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--c-error); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--c-warning); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--c-primary); }
.alert-close   { background: none; border: none; font-size: 1.2rem; line-height: 1; opacity: .6; color: inherit; }

/* ── Bausteine ─────────────────────────────────────────────── */
.panel { background: var(--c-surface); border-radius: var(--r-card); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-title { font-size: 1.02rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.panel-title .count { font-family: var(--font); font-size: .75rem; font-weight: 600; color: var(--c-muted); background: var(--c-bg); border-radius: 20px; padding: .05rem .55rem; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush > .panel-head { padding: 1.2rem 1.5rem 0; }
.eyebrow { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c-muted); margin-bottom: .6rem; }
.muted { color: var(--c-muted); }
.small { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-line; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--c-muted); font-size: .88rem; }
.empty-big { padding: 3.5rem 1rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.grid-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; align-items: start; }
.stack > * + * { margin-top: .75rem; }
.grid-2 > *, .dash-grid > *, .grid-cols > *, .panel-head > *, .admin-layout > * { min-width: 0; }
.quick-add .input, .quick-add .select { min-width: 0; }
.sticky-side { position: sticky; top: calc(var(--nav-h) + var(--bar-h) + 1rem); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--r-sm); font-size: .86rem; font-weight: 600;
  border: 1.5px solid transparent; transition: all var(--transition); white-space: nowrap; text-decoration: none !important; line-height: 1.3;
}
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-d); border-color: var(--c-primary-d); }
.btn-outline { background: #fff; color: var(--c-dark); border-color: var(--c-border); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary-d); }
.btn-ghost { background: transparent; color: var(--c-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-dark); }
.btn-danger { background: #fff; color: var(--c-error); border-color: #f5c2c2; }
.btn-danger:hover { background: var(--c-error); color: #fff; border-color: var(--c-error); }
.btn-success { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.btn-success:hover { background: #15805a; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-xs { padding: .15rem .5rem; font-size: .74rem; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1.5px; }
.btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.btn-group .btn.active { background: var(--c-dark); color: #fff; border-color: var(--c-dark); z-index: 1; }

/* Formulare */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.form-group label, .label { font-size: .78rem; font-weight: 600; color: var(--c-dark); }
.req { color: var(--c-accent); }
.input, .select, textarea.input {
  padding: .5rem .7rem; border-radius: var(--r-sm); border: 1.5px solid var(--c-border); background: #fff;
  font-size: .875rem; color: var(--c-text); width: 100%; transition: border-color var(--transition);
}
.input:focus, .select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(20,160,222,.15); }
textarea.input { resize: vertical; min-height: 80px; }
.input-sm, .select-sm { padding: .32rem .55rem; font-size: .8rem; }
.input[type=color] { padding: .15rem; height: 38px; }
.hint { font-size: .74rem; color: var(--c-muted); }
.form-actions { display: flex; gap: .6rem; margin-top: 1.25rem; flex-wrap: wrap; align-items: center; }
.form-section { border-top: 1px solid var(--c-border); margin-top: 1.25rem; padding-top: 1.1rem; }
.form-section-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin-bottom: .75rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .86rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--c-primary); }
.check-list { display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.check-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border: 1.5px solid var(--c-border); border-radius: 20px; font-size: .82rem; cursor: pointer; background: #fff; user-select: none; }
.check-chip input { accent-color: var(--c-primary); }
.check-chip:has(input:checked) { border-color: var(--c-primary); background: var(--c-tint); }

/* Personen-Auswahl (Mehrfach) */
.people-picker { border: 1.5px solid var(--c-border); border-radius: var(--r-sm); background: #fff; padding: .35rem; }
.people-picker .pp-selected { display: flex; flex-wrap: wrap; gap: .3rem; }
.pp-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--c-tint); color: var(--c-dark); border-radius: 20px; padding: .15rem .3rem .15rem .55rem; font-size: .8rem; font-weight: 500; }
.pp-chip button { background: none; border: 0; color: var(--c-muted); font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.pp-input { border: 0; outline: none; padding: .3rem .4rem; font-size: .85rem; min-width: 140px; flex: 1; }
.pp-results { border-top: 1px solid var(--c-border); margin-top: .35rem; max-height: 200px; overflow-y: auto; }
.pp-results button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .4rem .5rem; font-size: .84rem; border-radius: 6px; }
.pp-results button:hover, .pp-results button.hl { background: var(--c-bg); }

/* Filterleiste */
.filter-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-bar .select, .filter-bar .input { width: auto; min-width: 140px; }
.filter-bar .input { min-width: 180px; }
.filter-pill { padding: .3rem .8rem; border-radius: 20px; font-size: .8rem; font-weight: 500; border: 1.5px solid var(--c-border); color: var(--c-muted); background: #fff; }
.filter-pill:hover, .filter-pill.active { border-color: var(--c-primary); color: var(--c-primary-d); background: var(--c-tint); text-decoration: none; }

/* Badges */
.status-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; padding: .2rem .6rem; border-radius: 20px; white-space: nowrap; }
.status-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-offen     { background: var(--c-bg); color: #4b5d66; }
.st-in_arbeit { background: var(--c-tint); color: var(--c-primary-d); }
.st-wartet    { background: var(--c-warning-bg); color: var(--c-warning); }
.st-erledigt  { background: var(--c-success-bg); color: #128a5c; }
.st-verworfen { background: var(--c-bg); color: var(--c-muted); text-decoration: line-through; }
.ev-zu_pruefen { background: var(--c-warning-bg); color: var(--c-warning); }
.ev-geplant    { background: var(--c-tint); color: var(--c-primary-d); }
.ev-bestaetigt { background: var(--c-success-bg); color: #128a5c; }
.ev-abgesagt   { background: var(--c-bg); color: var(--c-muted); }
.inv-invited   { background: var(--c-warning-bg); color: var(--c-warning); }
.inv-accepted  { background: var(--c-success-bg); color: #128a5c; }
.inv-declined, .inv-cancelled { background: var(--c-bg); color: var(--c-muted); }
.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 20px; white-space: nowrap; }
.badge-blocked { background: var(--c-warning-bg); color: var(--c-warning); }
.badge-overdue { background: var(--c-error-bg); color: var(--c-error); }
.badge-result  { background: var(--c-dark); color: #fff; }
.badge-prio1   { background: var(--c-error-bg); color: var(--c-error); }
.badge-soft    { background: var(--c-bg); color: var(--c-muted); font-weight: 600; }
.co-chip { --co: var(--c-primary); display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .04em; padding: .08rem .38rem; border-radius: 5px; color: var(--co); background: color-mix(in srgb, var(--co) 13%, #fff); border: 1px solid color-mix(in srgb, var(--co) 35%, #fff); }
.co-chips { display: inline-flex; gap: .2rem; flex-wrap: wrap; }
.type-badge { --tc: #84949c; display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .15rem .55rem .15rem .4rem; border-radius: 20px; color: color-mix(in srgb, var(--tc) 80%, #000); background: color-mix(in srgb, var(--tc) 12%, #fff); white-space: nowrap; }
.type-icon { font-size: .82rem; line-height: 1; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c-primary); color: #fff; font-size: .66rem; font-weight: 700; flex-shrink: 0; border: 2px solid #fff; }
.avatar-nav { width: 30px; height: 30px; font-size: .74rem; border: 0; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -7px; }
.due { font-size: .78rem; color: var(--c-muted); white-space: nowrap; }
.due.overdue { color: var(--c-error); font-weight: 600; }
.due.soon { color: var(--c-warning); font-weight: 600; }
.progress { height: 6px; background: var(--c-bg); border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--c-success); border-radius: 6px; }
.color-bar { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }

/* ── Aufgabenzeilen ────────────────────────────────────────── */
.task-list { list-style: none; }
.task-row { display: flex; align-items: center; gap: .65rem; padding: .55rem .25rem; border-bottom: 1px solid var(--c-bg); min-width: 0; }
.task-list > li:last-child > .task-row { border-bottom: 0; }
.task-row:hover { background: #fafcfd; }
.task-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c5d1d7; background: #fff; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: transparent; font-size: .7rem; padding: 0; transition: all var(--transition); }
.task-check:hover { border-color: var(--c-success); color: var(--c-success); }
.task-check.done { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.task-check:disabled { cursor: default; opacity: .6; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 500; color: var(--c-text); display: inline; overflow-wrap: anywhere; }
.task-title:hover { color: var(--c-primary-d); }
.is-done .task-title { color: var(--c-muted); text-decoration: line-through; }
.task-meta { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .76rem; color: var(--c-muted); margin-top: .15rem; }
.task-side { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.task-tree ul { list-style: none; margin-left: 1.55rem; border-left: 2px solid var(--c-bg); padding-left: .4rem; }
.tree-toggle { width: 18px; height: 18px; border: 0; background: none; color: var(--c-muted); font-size: .7rem; flex-shrink: 0; transition: transform var(--transition); padding: 0; }
.tree-toggle.collapsed { transform: rotate(-90deg); }
.tree-spacer { width: 18px; flex-shrink: 0; }
.quick-add { display: flex; gap: .4rem; padding: .5rem .25rem; align-items: center; }
.quick-add .input { flex: 1; }
.quick-add .input[type=date] { flex: 0 0 150px; }
.sub-add { margin-left: 1.95rem; }
.row-actions { opacity: 0; transition: opacity var(--transition); }
.task-row:hover .row-actions, .task-row:focus-within .row-actions { opacity: 1; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th { background: var(--c-bg); padding: .6rem .9rem; text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); white-space: nowrap; }
.table td { padding: .65rem .9rem; border-top: 1px solid var(--c-border); vertical-align: middle; }
.table tr:hover td { background: rgba(20,160,222,.025); }
.table .row-muted td { opacity: .55; }

/* ── Übersicht ─────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.group-title { display: flex; align-items: center; gap: .5rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 1rem 0 .3rem; color: var(--c-muted); }
.group-title:first-child { margin-top: 0; }
.group-title.red { color: var(--c-error); }
.group-title.green { color: var(--c-success); }
.group-title.amber { color: var(--c-warning); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
.kpi { background: #fff; border-radius: 14px; padding: .9rem 1.1rem; box-shadow: var(--shadow-sm); border-left: 4px solid var(--c-border); }
.kpi b { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; color: var(--c-dark); }
.kpi span { font-size: .76rem; color: var(--c-muted); }
.kpi.red { border-left-color: var(--c-error); }
.kpi.green { border-left-color: var(--c-success); }
.kpi.amber { border-left-color: var(--c-warning); }
.kpi.blue { border-left-color: var(--c-primary); }

.proj-card { display: block; padding: .8rem 0; border-bottom: 1px solid var(--c-bg); color: inherit; }
.proj-card:last-child { border-bottom: 0; }
.proj-card:hover { text-decoration: none; }
.proj-card:hover .proj-name { color: var(--c-primary-d); }
.proj-name { font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.proj-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.proj-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .75rem; color: var(--c-muted); margin: .25rem 0 .35rem; flex-wrap: wrap; }

.event-mini { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--c-bg); color: inherit; align-items: center; }
.event-mini:last-child { border-bottom: 0; }
.event-mini:hover { text-decoration: none; }
.event-mini:hover .ev-title { color: var(--c-primary-d); }
.date-tile { width: 46px; flex-shrink: 0; text-align: center; border-radius: 10px; background: var(--c-tint); padding: .3rem 0; line-height: 1.1; }
.date-tile b { display: block; font-family: var(--font-display); font-size: 1.15rem; color: var(--c-dark); }
.date-tile span { font-size: .64rem; font-weight: 700; text-transform: uppercase; color: var(--c-primary-d); }
.ev-title { font-weight: 600; font-size: .88rem; }

/* Ergebnis-Karten */
.result-card { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--c-bg); align-items: flex-start; }
.result-card:last-child { border-bottom: 0; }
.result-diamond { width: 26px; height: 26px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--c-primary); font-size: 1.1rem; }

/* ── Projektliste ──────────────────────────────────────────── */
.project-tile { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; border-top: 4px solid var(--pc, var(--c-primary)); color: inherit; }
.project-tile:hover { text-decoration: none; box-shadow: var(--shadow-md); }
.project-tile h3 { font-size: 1.05rem; }
.project-tile .desc { font-size: .82rem; color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .76rem; color: var(--c-muted); flex-wrap: wrap; }

/* Projektkopf */
.project-head { border-left: 5px solid var(--pc, var(--c-primary)); padding-left: 1rem; }
.tabs { display: flex; gap: .2rem; margin-bottom: 1.1rem; overflow-x: auto; overflow-y: hidden; box-shadow: inset 0 -1px 0 var(--c-border); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: .3rem; padding: .6rem .9rem; font-size: .86rem; font-weight: 500; color: var(--c-muted); border-bottom: 2.5px solid transparent; white-space: nowrap; flex-shrink: 0; }
.tab:hover { color: var(--c-dark); text-decoration: none; }
.tab.active { color: var(--c-primary-d); border-bottom-color: var(--c-primary); font-weight: 600; }

.milestone { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--c-bg); }
.milestone:last-child { border-bottom: 0; }
.ms-icon { color: var(--c-primary); font-size: 1.35rem; width: 24px; text-align: center; line-height: 1; }
.milestone.done .ms-title { text-decoration: line-through; color: var(--c-muted); }
.milestone.late .ms-date { color: var(--c-error); font-weight: 600; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem .9rem; font-size: .85rem; }
.facts dt { color: var(--c-muted); font-size: .78rem; padding-top: .1rem; }
.facts dd { min-width: 0; overflow-wrap: anywhere; }

/* ── Aufgabendetail ────────────────────────────────────────── */
.task-head-title { font-size: 1.5rem; display: flex; align-items: flex-start; gap: .6rem; }
.status-switch { display: flex; gap: .3rem; flex-wrap: wrap; }
.status-switch button { border: 1.5px solid var(--c-border); background: #fff; border-radius: 20px; padding: .32rem .8rem; font-size: .8rem; font-weight: 600; color: var(--c-muted); }
.status-switch button:hover { border-color: var(--c-primary); color: var(--c-primary-d); }
.status-switch button.current.st-offen { border-color: #4b5d66; color: #4b5d66; background: var(--c-bg); }
.status-switch button.current.st-in_arbeit { border-color: var(--c-primary); color: var(--c-primary-d); background: var(--c-tint); }
.status-switch button.current.st-wartet { border-color: var(--c-warning); color: var(--c-warning); background: var(--c-warning-bg); }
.status-switch button.current.st-erledigt { border-color: var(--c-success); color: #fff; background: var(--c-success); }
.status-switch button.current.st-verworfen { border-color: var(--c-muted); color: var(--c-muted); }
.description { font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }
.blocker-box { background: var(--c-warning-bg); border-left: 4px solid var(--c-warning); border-radius: var(--r-sm); padding: .75rem 1rem; font-size: .86rem; margin-bottom: 1rem; }
.unblocked-box { background: var(--c-success-bg); border-left: 4px solid var(--c-success); border-radius: var(--r-sm); padding: .75rem 1rem; font-size: .86rem; margin-bottom: 1rem; }
.shift-box { background: var(--c-tint); border-left: 4px solid var(--c-primary); border-radius: var(--r-sm); padding: .85rem 1rem; font-size: .86rem; margin-bottom: 1rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Zusammenhang: Vorgänger → diese Aufgabe → Nachfolger */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: .6rem; align-items: start; }
.flow-col h4 { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin-bottom: .45rem; }
.flow-arrow { align-self: center; color: var(--c-border); font-size: 1.4rem; padding-top: 1rem; }
.flow-card { display: flex; gap: .45rem; align-items: flex-start; background: #fff; border: 1.5px solid var(--c-border); border-radius: 10px; padding: .45rem .6rem; margin-bottom: .4rem; font-size: .82rem; }
.flow-card.done { opacity: .6; }
.flow-card.done .fc-title { text-decoration: line-through; }
.flow-card.open-blocker { border-color: var(--c-warning); }
.flow-card.self { border-color: var(--c-primary); background: var(--c-tint); font-weight: 600; }
.fc-title { color: var(--c-text); font-weight: 500; overflow-wrap: anywhere; }
.fc-meta { font-size: .72rem; color: var(--c-muted); }
.fc-remove { margin-left: auto; }
.dep-add { display: flex; gap: .4rem; margin-top: .4rem; position: relative; }
.ac-wrap { position: relative; flex: 1; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); z-index: 50; max-height: 260px; overflow-y: auto; }
.ac-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .65rem; font-size: .82rem; }
.ac-list button:hover, .ac-list button.hl { background: var(--c-bg); }
.ac-list small { display: block; color: var(--c-muted); font-size: .72rem; }

.type-fields dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .86rem; }
.type-fields dt { color: var(--c-muted); font-size: .8rem; }

.comment { display: flex; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--c-bg); }
.comment:last-of-type { border-bottom: 0; }
.comment-body { flex: 1; min-width: 0; font-size: .87rem; white-space: pre-line; overflow-wrap: anywhere; }
.comment-meta { font-size: .74rem; color: var(--c-muted); margin-bottom: .15rem; display: flex; gap: .5rem; align-items: center; }

.history { list-style: none; font-size: .78rem; }
.history li { padding: .35rem 0; border-bottom: 1px dashed var(--c-border); color: var(--c-muted); }
.history li b { color: var(--c-text); font-weight: 500; }

.file-row { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--c-bg); font-size: .84rem; }
.file-row:last-child { border-bottom: 0; }
.file-ext { font-size: .62rem; font-weight: 700; text-transform: uppercase; background: var(--c-bg); color: var(--c-muted); border-radius: 5px; padding: .2rem .35rem; min-width: 36px; text-align: center; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-zone { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; flex-wrap: wrap; }

/* Folgemaßnahmen-Formular */
.fu-table td { vertical-align: top; }
.fu-table .input, .fu-table .select { min-width: 120px; }
.fu-row.off td { opacity: .45; }
.tpl-pick { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tpl-pick a { padding: .5rem .9rem; border-radius: 12px; border: 1.5px solid var(--c-border); background: #fff; font-size: .84rem; color: var(--c-text); }
.tpl-pick a small { display: block; color: var(--c-muted); font-size: .72rem; }
.tpl-pick a.active { border-color: var(--c-primary); background: var(--c-tint); }
.tpl-pick a:hover { text-decoration: none; border-color: var(--c-primary); }

/* ── Kanban ────────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 1rem; align-items: start; overflow-x: auto; padding-bottom: .5rem; }
.kb-col { background: #e9eef1; border-radius: var(--r-card); padding: .7rem; min-height: 200px; display: flex; flex-direction: column; }
.kb-col.drag-over { background: #dcebf3; outline: 2px dashed var(--c-primary); outline-offset: -2px; }
.kb-head { display: flex; align-items: center; justify-content: space-between; padding: .2rem .35rem .65rem; font-family: var(--font-display); font-weight: 600; font-size: .9rem; color: var(--c-dark); }
.kb-list { display: flex; flex-direction: column; gap: .55rem; flex: 1; min-height: 60px; }
.kb-card { background: #fff; border-radius: 12px; padding: .7rem .8rem; box-shadow: 0 1px 2px rgba(11,37,48,.08); border-left: 4px solid var(--tc, var(--c-border)); cursor: grab; display: block; color: inherit; }
.kb-card:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.kb-card.dragging { opacity: .45; }
.kb-card.readonly { cursor: pointer; }
.kb-card .kb-title { font-weight: 500; font-size: .87rem; line-height: 1.35; overflow-wrap: anywhere; }
.kb-card .kb-top { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin-bottom: .35rem; }
.kb-card .kb-bottom { display: flex; justify-content: space-between; align-items: center; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.kb-project { font-size: .72rem; color: var(--c-muted); margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Kalender ──────────────────────────────────────────────── */
.cal-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cal-month { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--c-dark); min-width: 190px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--c-border); gap: 1px; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-dow { background: var(--c-bg); padding: .45rem .6rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--c-muted); letter-spacing: .05em; }
.cal-day { background: #fff; min-height: 118px; padding: .35rem .35rem .5rem; min-width: 0; }
.cal-day.other { background: #fafbfc; }
.cal-day.other .cal-num { color: #b7c3c9; }
.cal-day.today { background: #f4fbff; }
.cal-day.today .cal-num { background: var(--c-primary); color: #fff; }
.cal-day.weekend { background: #fcfcfd; }
.cal-num { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 .3rem; border-radius: 12px; font-size: .78rem; font-weight: 600; color: var(--c-dark); margin-bottom: .2rem; }
.cal-add { float: right; opacity: 0; font-size: .9rem; color: var(--c-muted); padding: 0 .3rem; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-item { display: flex; align-items: center; gap: .25rem; font-size: .72rem; line-height: 1.25; padding: .14rem .35rem; border-radius: 5px; margin-bottom: 2px; color: var(--c-text); background: color-mix(in srgb, var(--ic) 11%, #fff); border-left: 3px solid var(--ic); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-item:hover { text-decoration: none; background: color-mix(in srgb, var(--ic) 22%, #fff); }
.cal-item span.t { overflow: hidden; text-overflow: ellipsis; }
.cal-item.k-event { background: var(--ic); color: #fff; font-weight: 600; border-left-color: var(--ic); }
.cal-item.k-event.cont { opacity: .75; }
.cal-item.k-milestone { font-weight: 700; background: var(--c-dark); color: #fff; border-left-color: var(--ic); }
.cal-item.done { opacity: .5; text-decoration: line-through; }
.cal-item.overdue { border-left-color: var(--c-error); }
.cal-more { font-size: .7rem; color: var(--c-muted); padding-left: .35rem; cursor: pointer; background: none; border: 0; }
.cal-legend { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Roadmap (Frappe Gantt) ────────────────────────────────── */
.gantt-wrap { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow-sm); overflow: hidden; }
.gantt-scroll { overflow: visible; }
.gantt-scroll .gantt-container { max-height: calc(100vh - 250px); overflow: auto; }
.gantt-container .popup-wrapper { display: none !important; }
.gantt-popover { position: fixed; z-index: 300; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); padding: .7rem .85rem; font-size: .8rem; max-width: 300px; display: flex; flex-direction: column; gap: .15rem; }
.gantt-popover b { font-size: .88rem; color: var(--c-dark); }
.gantt-dragtip { position: fixed; z-index: 310; pointer-events: none; background: var(--c-dark); color: #fff; font-size: .78rem; font-weight: 600; padding: .25rem .55rem; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gantt .month-sep { stroke: #9fb3bd; stroke-width: 1.2; }
.gantt .ms-line { stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .6; }
.gantt .bar-wrapper.kind-milestone .bar, .gantt .bar-wrapper.kind-milestone .bar-progress { opacity: 0; }
.gantt .ms-diamond { stroke: var(--c-dark); stroke-width: 1.5; }
.gantt .ms-label { font-weight: 700; fill: var(--c-dark) !important; }
.gantt .lower-text { font-size: 11px; }
.gantt .bar-wrapper .bar { fill: color-mix(in srgb, var(--bc, #b8c2cc) 35%, #fff); }
.gantt .bar-wrapper .bar-progress { fill: var(--bc, #14a0de); }
.gantt .bar-wrapper.kind-project .bar { fill: var(--c-dark); }
.gantt .bar-wrapper.kind-project .bar-progress { fill: var(--c-primary); }
.gantt .bar-wrapper.kind-project .bar-label { fill: #fff; font-weight: 600; }
.gantt .bar-wrapper.kind-milestone .bar { fill: var(--c-primary); }
.gantt .bar-wrapper.is-blocked .bar { stroke: var(--c-warning); stroke-width: 2; stroke-dasharray: 4 3; }
.gantt .bar-wrapper.is-overdue .bar { stroke: var(--c-error); stroke-width: 2; }
.gantt .bar-wrapper.is-done .bar-label { fill: var(--c-muted); }
.gantt .bar-label { fill: var(--c-dark); font-size: 12px; font-family: var(--font); }
.gantt .bar-label.big { fill: var(--c-dark); }
.gantt .arrow { stroke: #8aa0ab; }
.gantt .today-highlight { fill: #fff3c4; opacity: .7; }
.gantt .lower-text, .gantt .upper-text { font-family: var(--font); }
.gantt-container .popup-wrapper { border-radius: 10px; }
.gantt-popup { padding: .7rem .85rem; min-width: 220px; font-size: .8rem; color: var(--c-text); background: #fff; }
.gantt-popup b { display: block; font-size: .88rem; margin-bottom: .25rem; }
.gantt-popup a { font-weight: 600; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .76rem; color: var(--c-muted); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: .3rem; }

/* ── Netz ──────────────────────────────────────────────────── */
.net-wrap { position: relative; background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow-sm); height: calc(100vh - 250px); min-height: 480px; overflow: hidden; }
#cy { position: absolute; inset: 0; }
.net-info { position: absolute; right: 12px; top: 12px; width: 280px; max-width: calc(100% - 24px); background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: .9rem 1rem; font-size: .82rem; z-index: 5; }
.net-info h4 { font-size: .95rem; margin-bottom: .35rem; }
.net-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: .35rem; z-index: 5; }
.net-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--c-muted); padding: 2rem; }

/* ── Veranstaltungen ───────────────────────────────────────── */
.ev-row { display: flex; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--c-bg); align-items: center; }
.ev-row:last-child { border-bottom: 0; }
.ev-row .date-tile { width: 54px; }
.ev-body { flex: 1; min-width: 0; }
.ev-body .ev-title { font-size: .95rem; }
.ev-meta { font-size: .78rem; color: var(--c-muted); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .15rem; }
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .3rem; }
.rsvp-box { background: var(--c-dark); color: #fff; border-radius: var(--r-card); padding: 1.2rem 1.3rem; margin-bottom: 1.25rem; }
.rsvp-box .eyebrow { color: rgba(255,255,255,.55); }
.rsvp-box p { color: rgba(255,255,255,.8); font-size: .86rem; margin-bottom: .75rem; }
.rsvp-box .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.person-row { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--c-bg); font-size: .85rem; }
.person-row:last-child { border-bottom: 0; }
.person-row .name { flex: 1; min-width: 0; }

/* ── Admin ─────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.admin-nav { background: var(--c-dark); border-radius: var(--r-card); padding: .8rem 0; position: sticky; top: calc(var(--nav-h) + var(--bar-h) + 1rem); }
.admin-nav a { display: block; padding: .5rem 1.2rem; font-size: .85rem; color: rgba(255,255,255,.7); }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.admin-nav a.active { box-shadow: inset 3px 0 0 var(--c-primary); }
.builder-row { display: grid; gap: .5rem; align-items: start; padding: .6rem; border: 1.5px solid var(--c-border); border-radius: var(--r-sm); margin-bottom: .5rem; background: #fcfdfe; }
.field-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 2fr) auto auto; }
.item-row { grid-template-columns: 34px minmax(0, 1.1fr) minmax(0, 2.4fr) 90px 90px minmax(0, 1.3fr) minmax(0, 1.5fr) auto; }
.builder-row .num { font-weight: 700; color: var(--c-muted); padding-top: .5rem; text-align: center; }
.builder-head { display: grid; gap: .5rem; padding: 0 .6rem .3rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
.invite-link { background: var(--c-warning-bg); border-radius: var(--r-sm); padding: .8rem 1rem; font-size: .84rem; margin-bottom: 1rem; word-break: break-all; }

/* Login */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: linear-gradient(135deg, var(--c-dark) 0%, #034f6e 100%); }
.login-card { background: #fff; border-radius: 20px; padding: 2.4rem 2.2rem; width: 100%; max-width: 410px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 1.8rem; }
.login-logo .logo-box { background: var(--c-dark); border-radius: 14px; padding: 1rem 1.2rem; display: inline-block; margin-bottom: 1rem; }
.login-logo .logo-box img { height: 24px; display: block; }
.login-logo h1 { font-size: 1.4rem; }
.login-sub { color: var(--c-muted); font-size: .86rem; margin-top: .2rem; }
.login-card .form-group + .form-group { margin-top: .9rem; }
.login-card .btn-block { margin-top: 1.3rem; padding: .7rem; font-size: 1rem; }

.error-page { max-width: 520px; margin: 5rem auto; text-align: center; padding: 2rem; }
.error-code { font-family: var(--font-display); font-size: 5rem; font-weight: 700; color: var(--c-border); line-height: 1; margin-bottom: 1rem; }

.pagination { display: flex; gap: .3rem; justify-content: center; margin-top: 1rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .nav-burger { display: block; }
  .nav-collapse { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: .25rem; background: var(--c-dark); padding: .5rem 1rem 1rem; box-shadow: 0 10px 20px rgba(0,0,0,.25); }
  .nav-collapse.open { display: flex; }
  .nav-main { flex-direction: column; align-items: stretch; }
  .nav-link { padding: .65rem .8rem; }
  .nav-user { margin: .5rem 0 0; padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.12); justify-content: space-between; }
  .nav-logout-label { display: inline; font-size: .85rem; }
  .notif-dropdown { left: 0; right: auto; }
}
@media (max-width: 980px) {
  .grid-2, .dash-grid { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; flex-wrap: wrap; padding: .4rem; }
  .admin-nav a { padding: .4rem .8rem; border-radius: 8px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .dep-add { flex-wrap: wrap; }
  .dep-add .ac-wrap { flex-basis: 100%; order: -1; }
  .panel-head .btn { white-space: normal; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; padding: 0; }
  .field-row, .item-row { grid-template-columns: 1fr 1fr; }
  .builder-head { display: none; }
  .item-row .num { text-align: left; padding: 0; }
}
@media (max-width: 680px) {
  html { font-size: 14.5px; }
  .page-body { padding: 1rem .85rem 1.5rem; }
  .co-bar { padding: .4rem .85rem; position: static; }
  .co-switch-label { display: none; }
  .co-pill { padding: .22rem .55rem; font-size: .74rem; }
  .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 1.1rem 1rem; }
  .cal-day { min-height: 74px; padding: .2rem; }
  .cal-item .t { display: none; }
  .cal-item { justify-content: center; padding: .1rem; }
  .cal-dow { padding: .35rem .2rem; text-align: center; }
  .task-side .avatars, .task-side .co-chips { display: none; }
  .row-actions { opacity: 1; }
  .hide-sm { display: none; }
  .task-side { gap: .3rem; }
  .quick-add { flex-wrap: wrap; }
  .quick-add .input[type=date] { flex: 1 1 140px; }
  .user-name { display: none; }
  .kanban { grid-template-columns: repeat(4, 82vw); }
  .net-info { position: static; width: auto; margin: .5rem; }
}

/* ── Programm & Teilnehmer (Veranstaltungen) ───────────────── */
.program { display: flex; flex-direction: column; }
.prog-day { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin: 1.1rem 0 .4rem; }
.prog-day:first-child { margin-top: 0; }
.prog-item { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: .8rem; padding: .55rem 0 .55rem; border-left: 2px solid var(--c-border); margin-left: 4px; padding-left: .9rem; position: relative; }
.prog-item::before { content: ''; position: absolute; left: -6px; top: .85rem; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #c5d1d7; }
.prog-item.now { background: var(--c-tint); border-radius: 0 10px 10px 0; border-left-color: var(--c-primary); }
.prog-item.now::before { background: var(--c-primary); border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(20,160,222,.2); }
.prog-time { font-weight: 600; font-size: .86rem; color: var(--c-dark); font-variant-numeric: tabular-nums; }
.prog-time span { display: block; font-weight: 400; color: var(--c-muted); font-size: .78rem; }
.prog-title { font-weight: 600; color: var(--c-dark); }
.prog-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.badge-now { background: var(--c-primary); color: #fff; }
.tabs .badge { margin-left: 0; }

.part-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.part-card { background: #fff; border: 1.5px solid var(--c-border); border-radius: 14px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; min-width: 0; }
.part-card.warn { border-color: var(--c-warning); }
.part-card.muted-card { opacity: .65; }
.part-head { display: flex; align-items: center; gap: .55rem; }
.part-head .name { font-weight: 600; flex: 1; min-width: 0; }
.req-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; padding: .45rem 0; border-top: 1px solid var(--c-bg); font-size: .84rem; }
.req-row .req-name { font-weight: 600; min-width: 70px; }
.req-row .req-note { flex: 1 1 120px; min-width: 0; color: var(--c-muted); overflow-wrap: anywhere; }
.rq-offen { background: var(--c-bg); color: #4b5d66; }
.rq-angefragt { background: var(--c-tint); color: var(--c-primary-d); }
.rq-gebucht { background: var(--c-success-bg); color: #128a5c; }
.rq-storniert { background: var(--c-bg); color: var(--c-muted); text-decoration: line-through; }
.req-add { display: flex; gap: .35rem; flex-wrap: wrap; }
.req-add .select { flex: 1 1 100%; }
.req-add .input { flex: 1 1 0; min-width: 0; }
.storno-box { background: var(--c-warning-bg); border-left: 4px solid var(--c-warning); border-radius: var(--r-sm); padding: .8rem 1rem; font-size: .86rem; margin-bottom: 1rem; }
.storno-box ul { margin: .35rem 0 0 1.1rem; }

/* ── Hilfe (Anleitung, Inhalt = Leitfaden) ─────────────────── */
.help { --line: var(--c-border); --muted: var(--c-muted); --ink: var(--c-text); --ink-strong: var(--c-dark); --accent: var(--c-primary); --accent-ink: var(--c-primary-d); --accent-soft: var(--c-tint); --ok: var(--c-success); --ok-soft: var(--c-success-bg); --wait: var(--c-warning); --wait-soft: var(--c-warning-bg); --late: var(--c-error); --hyx: #0e9f8f; }
.help-head { background: var(--c-dark); color: #fff; border-radius: var(--r-card); padding: 2.4rem 2.2rem 2rem; display: grid; gap: .9rem; margin-bottom: 2rem; }
.help .kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c-primary); font-weight: 600; }
.help-head h1 { color: #fff; font-size: clamp(1.7rem, 3.5vw, 2.4rem); max-width: 20ch; text-wrap: balance; }
.help-head p { color: rgba(255,255,255,.72); max-width: 62ch; }
.help .chain { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .85rem; }
.help .chain span { border: 1px solid rgba(255,255,255,.22); border-radius: 6px; padding: .2rem .6rem; }
.help .chain span.res { border-color: var(--c-primary); color: var(--c-primary); font-weight: 600; }
.help .chain i { font-style: normal; color: rgba(255,255,255,.6); }
.help-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.help .toc { position: sticky; top: calc(var(--nav-h) + var(--bar-h) + 1rem); display: grid; gap: 2px; font-size: .85rem; }
.help .toc b { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.help .toc a { color: var(--muted); padding: .3rem 0 .3rem .7rem; border-left: 2px solid var(--line); }
.help .toc a:hover { color: var(--accent-ink); border-left-color: var(--accent); text-decoration: none; }
.help-main { display: grid; gap: 3.5rem; min-width: 0; }
.help section { display: grid; gap: 1.1rem; min-width: 0; scroll-margin-top: calc(var(--nav-h) + var(--bar-h) + 1rem); }
.help section > h2 { font-size: 1.6rem; }
.help .lead { color: var(--muted); max-width: 65ch; }
.help .prose { max-width: 68ch; display: grid; gap: .6rem; }
.help .blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.help .block { background: var(--c-surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; display: grid; gap: .35rem; align-content: start; }
.help .block h3 { font-size: 1.05rem; display: flex; gap: .5rem; align-items: baseline; }
.help .block h3 .sym { color: var(--accent); width: 18px; }
.help .block p { font-size: .9rem; }
.help .block .ex { font-size: .8rem; color: var(--muted); }
.help .block.key { border-color: var(--accent); background: var(--accent-soft); }
.help .types { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--c-surface); }
.help .types div { padding: .7rem 1rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); font-size: .86rem; }
.help .types b { display: block; color: var(--ink-strong); }
.help .types span { color: var(--muted); }
.help .status-flow { background: var(--c-surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem; display: grid; gap: 1rem; }
.help .st-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.help .st { font-size: .8rem; font-weight: 600; padding: .2rem .75rem; border-radius: 20px; white-space: nowrap; }
.help .st.open { background: var(--c-bg); border: 1px solid var(--line); }
.help .st.work { background: var(--accent-soft); color: var(--accent-ink); }
.help .st.wait { background: var(--wait-soft); color: var(--wait); }
.help .st.done { background: var(--ok-soft); color: var(--ok); }
.help .st.drop { background: var(--c-bg); color: var(--muted); text-decoration: line-through; }
.help .arrow { color: var(--muted); font-size: .85rem; }
.help .auto { font-size: .86rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: .9rem; display: grid; gap: .35rem; }
.help .auto b { color: var(--ink-strong); }
.help .steps { list-style: none; counter-reset: s; }
.help .steps > li { counter-increment: s; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 1rem; padding-block: 1.2rem; border-top: 1px solid var(--line); }
.help .steps > li::before { content: counter(s); font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--accent); line-height: 1.2; }
.help .steps h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.help .steps .body { display: grid; gap: .5rem; max-width: 68ch; }
.help .steps ul { padding-left: 1.2rem; display: grid; gap: .25rem; }
.help .where { font-size: .78rem; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: .1rem .5rem; border-radius: 4px; justify-self: start; }
.help a.where:hover { text-decoration: none; background: var(--c-primary); color: #fff; }
.help .callout { border-left: 3px solid var(--accent); background: var(--c-surface); padding: .75rem 1rem; border-radius: 0 8px 8px 0; font-size: .9rem; }
.help .groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.help .grp { background: var(--c-surface); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: 8px; padding: .7rem .9rem; font-size: .86rem; display: grid; }
.help .grp b { color: var(--ink-strong); }
.help .grp span { color: var(--muted); }
.help .grp.late { border-top-color: var(--late); } .help .grp.go { border-top-color: var(--ok); } .help .grp.week { border-top-color: var(--accent); } .help .grp.wt { border-top-color: var(--wait); }
.help .diagram { background: var(--c-surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; overflow-x: auto; }
.help .diagram svg { display: block; min-width: 620px; width: 100%; height: auto; }
.help .n rect { fill: var(--c-surface); stroke: var(--line); stroke-width: 1.5; }
.help .n.res rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.help .n.wait rect { stroke: var(--wait); stroke-dasharray: 5 4; }
.help .n text { fill: var(--ink-strong); font-family: var(--font); font-size: 13px; }
.help .n text.sub { fill: var(--muted); font-size: 11.5px; }
.help .e { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.help .ah { fill: var(--muted); }
.help .co { font-size: 10.5px; font-weight: 600; }
.help .co.h2a { fill: var(--accent-ink); } .help .co.hyx { fill: var(--hyx); }
.help .story { list-style: none; border-left: 2px solid var(--line); margin-left: 6px; }
.help .story li { position: relative; padding: 0 0 1rem 1.3rem; max-width: 66ch; }
.help .story li::before { content: ''; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--accent); }
.help .story li.hit::before { background: var(--ok); border-color: var(--ok); }
.help .story .who { font-weight: 600; color: var(--ink-strong); }
.help .table-wrap { border: 1px solid var(--line); border-radius: 10px; background: var(--c-surface); }
.help table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 520px; }
.help th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.help td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.help tr:last-child td { border-bottom: 0; }
.help td:first-child { font-weight: 600; color: var(--ink-strong); white-space: nowrap; }
.help details { background: var(--c-surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 1rem; }
.help details + details { margin-top: .5rem; }
.help summary { cursor: pointer; padding: .8rem 0; font-weight: 600; color: var(--ink-strong); }
.help details p { padding-bottom: .8rem; max-width: 66ch; font-size: .92rem; }
.help .foot { color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); padding-top: 1rem; }
@media (max-width: 860px) {
  .help-wrap { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .help .toc { position: static; display: flex; flex-wrap: wrap; gap: .35rem; }
  .help .toc b { width: 100%; margin: 0; }
  .help .toc a { border: 1px solid var(--line); border-radius: 20px; padding: .15rem .7rem; background: var(--c-surface); }
  .help-head { padding: 1.6rem 1.2rem; }
}

/* ── Formatierter Text (Editor + Anzeige) ──────────────────── */
.rich-editor { border: 1.5px solid var(--c-border); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.rich-editor:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(20,160,222,.15); }
.rich-editor .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--c-border); background: var(--c-bg); font-family: var(--font); padding: 6px 8px; }
.rich-editor .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: .9rem; }
.rich-editor .ql-editor { min-height: 160px; max-height: 480px; overflow-y: auto; line-height: 1.55; color: var(--c-text); }
.rich-editor .ql-editor.ql-blank::before { color: var(--c-muted); font-style: normal; }
.rich-editor .ql-snow .ql-picker-label, .rich-editor .ql-snow .ql-stroke { color: var(--c-dark); }
.rich-editor .ql-snow.ql-toolbar button:hover .ql-stroke, .rich-editor .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--c-primary); }
.rich-editor .ql-snow.ql-toolbar button:hover .ql-fill, .rich-editor .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--c-primary); }
.rich-editor .ql-snow .ql-tooltip { z-index: 5; border-radius: 8px; box-shadow: var(--shadow-md); }
.rich-editor .ql-snow .ql-tooltip[data-mode=link]::before { content: "Link:"; }
.rich-editor .ql-snow .ql-tooltip::before { content: "Öffnen:"; }
.rich-editor .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Speichern"; }
.rich-editor .ql-snow .ql-tooltip a.ql-action::after { content: "Bearbeiten"; }
.rich-editor .ql-snow .ql-tooltip a.ql-remove::before { content: "Entfernen"; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Text"; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "Überschrift"; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "Zwischenüberschrift"; }
.rich-editor .ql-snow .ql-picker.ql-header { width: 175px; }

.rich { font-size: .9rem; overflow-wrap: anywhere; }
.rich > * + * { margin-top: .6rem; }
.rich h2 { font-size: 1.05rem; margin-top: 1rem; }
.rich h3 { font-size: .95rem; margin-top: .9rem; }
.rich ul, .rich ol { padding-left: 1.3rem; }
.rich li + li { margin-top: .2rem; }
.rich blockquote { border-left: 3px solid var(--c-primary); padding: .2rem 0 .2rem .8rem; color: var(--c-muted); }
.rich a { text-decoration: underline; }

/* ── Wiki ──────────────────────────────────────────────────── */
.wiki-search { min-width: 320px !important; flex: 1; max-width: 520px; }
.wiki-cat { font-size: 1.05rem; margin: 1.6rem 0 .7rem; }
.wiki-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.wiki-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; color: inherit; border: 1.5px solid transparent; }
.wiki-card:hover { text-decoration: none; border-color: var(--c-primary); }
.wiki-card-head { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.wiki-card-head b { color: var(--c-dark); font-family: var(--font-display); font-weight: 600; }
.wiki-card p { font-size: .82rem; color: var(--c-muted); }
.wiki-card-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .74rem; color: var(--c-muted); margin-top: auto; }
.wk-aktuell { background: var(--c-success-bg); color: #128a5c; }
.wk-zu_pruefen { background: var(--c-warning-bg); color: var(--c-warning); }
.wk-veraltet { background: var(--c-bg); color: var(--c-muted); }
.wiki-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.wiki-article { padding: 1.8rem 2rem; }
.wiki-summary { font-size: 1.02rem; color: var(--c-dark); border-left: 3px solid var(--c-primary); padding-left: .9rem; margin-bottom: 1.4rem; }
.wiki-body { font-size: .95rem; max-width: 900px; }
.wiki-body h2 { font-size: 1.3rem; margin-top: 2rem; padding-bottom: .3rem; border-bottom: 1px solid var(--c-border); scroll-margin-top: calc(var(--nav-h) + var(--bar-h) + 1rem); }
.wiki-body h3 { font-size: 1.08rem; margin-top: 1.4rem; scroll-margin-top: calc(var(--nav-h) + var(--bar-h) + 1rem); }
.wiki-body h4 { font-size: .95rem; margin-top: 1.1rem; }
.wiki-body > :first-child { margin-top: 0; }
.wiki-table { overflow-x: auto; margin: .9rem 0; border: 1px solid var(--c-border); border-radius: 10px; }
.wiki-body table { border-collapse: collapse; width: 100%; font-size: .86rem; font-variant-numeric: tabular-nums; }
.wiki-body th, .wiki-body td { border-bottom: 1px solid var(--c-border); padding: .5rem .75rem; text-align: left; vertical-align: top; }
.wiki-body th + th, .wiki-body td + td, .wiki-body th + td, .wiki-body td + th { border-left: 1px solid var(--c-border); }
.wiki-body thead th, .wiki-body thead td { background: var(--c-bg); font-weight: 600; color: var(--c-dark); }
.wiki-body tr:last-child td, .wiki-body tr:last-child th { border-bottom: 0; }
.wiki-body tbody tr:hover td { background: #fafcfd; }
.wiki-body caption { caption-side: bottom; font-size: .75rem; color: var(--c-muted); padding: .4rem .75rem; text-align: left; }
.wiki-body pre, .wiki-body code { font-size: .82rem; background: var(--c-bg); border-radius: 5px; }
.wiki-body pre { padding: .7rem .9rem; overflow-x: auto; }
.wiki-body code { padding: .05rem .3rem; }
.wiki-body hr { border: 0; border-top: 1px solid var(--c-border); margin: 1.5rem 0; }
.wiki-toc { display: flex; flex-direction: column; gap: .15rem; font-size: .84rem; }
.wiki-toc a { color: var(--c-muted); padding: .2rem 0 .2rem .6rem; border-left: 2px solid var(--c-border); }
.wiki-toc a:hover { color: var(--c-primary-d); border-left-color: var(--c-primary); text-decoration: none; }
.wiki-toc a.lvl-h3 { padding-left: 1.3rem; font-size: .8rem; }
.wiki-rel { display: block; padding: .35rem 0; border-bottom: 1px solid var(--c-bg); font-size: .86rem; }
.tag-chip { display: inline-block; font-size: .74rem; background: var(--c-bg); border-radius: 20px; padding: .05rem .55rem; margin: 0 .15rem .25rem 0; color: var(--c-text); }
.tag-chip:hover { background: var(--c-tint); text-decoration: none; }
.wiki-edit .tox-tinymce { border-radius: var(--r-sm); border: 1.5px solid var(--c-border); }
@media (max-width: 980px) { .wiki-layout { grid-template-columns: 1fr; } .wiki-article { padding: 1.2rem 1rem; } .wiki-search { min-width: 0 !important; } }
