/* ═══════════════════════════════════════════════════════════════
   BE:KI Direct – Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Palette exakt wie BE:KI Base (Vorbild) */
  --navy:           #1648a6;
  --navy-d:         #0f3683;
  --teal:           #23b5a0;
  --teal-d:         #1c9583;
  --sky:            #15a7ce;

  --primary:        var(--navy);
  --primary-light:  var(--teal-d);
  --primary-bg:     #e8eef8;
  --accent:         var(--navy);

  --success:        #3a8c68;
  --success-bg:     #d4ede2;
  --warning:        #d97706;
  --warning-bg:     #fef3c7;
  --danger:         #dc2626;
  --danger-bg:      #fee2e2;
  --info:           #3a6cb0;
  --info-bg:        #e0eaf8;
  --muted:          #6b7a8d;
  --muted-bg:       #f4f6fa;

  --bg:             #f3f5f9;
  --surface:        #ffffff;
  --border:         #eef1f5;
  --border-dark:    #e1e6ee;
  --text:           #1a2740;
  --text-sub:       #64748b;

  --sidebar-w:      232px;
  --topbar-h:       58px;
  --radius:         10px;
  --radius-lg:      16px;
  --shadow:         0 1px 6px rgba(30,61,115,.07);
  --shadow-md:      0 4px 16px rgba(30,61,115,.10);
  --shadow-lg:      0 8px 40px rgba(30,61,115,.16);

  --font:           'Segoe UI', system-ui, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; height: 100vh; overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ─── Layout ─────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(160deg, #0d2557 0%, var(--navy) 58%, #1a7a6a 100%);
  box-shadow: 3px 0 18px rgba(13,35,71,.26);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s ease;
  overflow: hidden;
}

.sidebar-brand {
  background: #fff;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  flex-shrink: 0;
  cursor: pointer;
}

.sidebar-logo-img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 5px;
  opacity: .95;
}

.brand-tagline {
  font-size: .72rem;
  font-weight: 700;
  color: #4a6a9a;
  display: block;
  letter-spacing: .03em;
  margin-top: 2px;
}

.brand-org {
  font-size: .68rem;
  color: #9ba8bb;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: rgba(255,255,255,.72);
  font-size: .88rem;
  font-weight: 600;
  transition: background .12s, color .12s, border-color .12s;
  position: relative;
  text-decoration: none !important;
  border-left: 3px solid transparent;
}

.nav-item:hover   { background: rgba(255,255,255,.09); color: #fff; border-left-color: rgba(122,220,176,.55); }
.nav-item.active  { background: rgba(255,255,255,.14); color: #fff; border-left-color: rgba(122,220,176,.8); }

.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.nav-static {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.nav-badge {
  min-width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 9px;
  padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-bottom {
  padding: 10px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 190;
}

/* Nicht angemeldet: Nav-Items sichtbar, aber gesperrt (Suite-Stil) */
#sidebar.nav-locked .nav-item {
  opacity: .42;
  cursor: default;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════
   HERO / LANDING (vor Login, exakt wie BE:KI Base)
   ════════════════════════════════════════════════════════════ */
.hero-page {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 28px;
  margin: -28px -28px -48px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(22, 72, 166, .22) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(13, 74, 107, .26) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 80%, rgba(35, 181, 160, .18) 0%, transparent 50%),
    linear-gradient(to right, transparent 0%, rgba(5,10,20,.4) 100%),
    linear-gradient(to bottom, #0d2347 0%, var(--navy) 55%, #1a7a6a 100%);
}
.hero-content { max-width: 920px; width: 100%; text-align: center; }
.hero-footnote {
  margin-top: 18px;
  color: rgba(255,255,255,.45);
  font-size: 11.5px;
  letter-spacing: .04em;
  font-weight: 500;
}
.hero-logo {
  width: 720px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 38px;
  filter: drop-shadow(0 6px 24px rgba(0,0,0,.3));
}
.hero-headline {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.hero-sub {
  margin: 0 auto 22px;
  color: #cdd6e3;
  font-size: .98rem;
  line-height: 1.65;
  max-width: 580px;
  text-align: center;
}

/* 4 Module-Cards in Reihe */
.hero-modules {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 26px;
}
@media (max-width: 760px) {
  .hero-modules { grid-template-columns: repeat(2, 1fr); }
}
.hero-module {
  background: rgba(255, 255, 255, .07);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  padding: 14px 12px 16px;
  text-align: center;
  transition: transform .15s, border-color .15s;
}
.hero-module:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .26);
}
.hero-module-icon {
  font-size: 22px;
  margin-bottom: 4px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.3));
}
.hero-module-name {
  color: #f1f5f9;
  font-weight: 800;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.hero-module-desc {
  color: #94a3b8;
  font-size: 11.5px;
  line-height: 1.45;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-hero-primary {
  background: linear-gradient(135deg, var(--sky), var(--navy));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 18px 44px;
  font-size: 1.18rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 28px rgba(22, 72, 166, .5);
  transition: filter .15s, transform .05s;
  letter-spacing: .01em;
}
.btn-hero-primary:hover  { filter: brightness(1.1); }
.btn-hero-primary:active { transform: scale(.98); }
.btn-hero-ghost {
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(4px);
  color: #f1f5f9;
  border: 1.5px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  padding: 13px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}
.btn-hero-ghost:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .35);
}

/* Header-Login-Formular (Base-Stil: .text-inp / .btn-navy) */
.text-inp {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-dark);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.text-inp:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22,72,166,.10); }
.btn-navy {
  width: 100%;
  background: linear-gradient(135deg, var(--navy), var(--teal-d));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: filter .15s;
}
.btn-navy:hover { filter: brightness(1.08); }
.btn-navy:disabled { opacity: .6; cursor: not-allowed; }
.hero-login-err {
  background: #ffe1ec; color: #b73166;
  border-radius: 8px; padding: 7px 11px;
  font-size: 12px; font-weight: 600; margin-bottom: 8px;
}

/* ─── Main ───────────────────────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Topbar ─────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 3px solid var(--navy);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 250;
  box-shadow: 0 2px 16px rgba(22,72,166,.10);
}

.topbar-logo-institut {
  height: 80px;
  width: auto;
  opacity: .92;
  mix-blend-mode: multiply;
  flex-shrink: 0;
}

/* Login button (Gradient-Pille wie Base) */
#login-btn {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--navy), var(--teal-d));
  border: none; color: #fff;
  border-radius: 22px; padding: 7px 14px 7px 12px;
  cursor: pointer; font-family: inherit; font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(22,72,166,.15);
  transition: filter .15s, transform .05s;
}
#login-btn:hover  { filter: brightness(1.08); }
#login-btn:active { transform: scale(.98); }

.login-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(160deg, var(--navy), var(--teal));
  color: #fff;
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

#login-panel {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18), 0 1px 0 rgba(255,255,255,.4) inset;
  width: 280px; z-index: 400;
  overflow: hidden;
}

.lp-block { padding: 12px 18px; }
.modal-error {
  background: #ffe1ec; color: #b73166;
  border-radius: 8px; padding: 7px 11px;
  font-size: 12px; font-weight: 600; margin-bottom: 8px;
}

.lp-profile { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin: 0; }
.lp-av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(160deg, var(--navy), var(--teal)); color: #fff; font-size: .88rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lp-name { font-size: 14px; font-weight: 800; color: var(--text); }
.lp-org  { font-size: 11.5px; color: var(--text-sub); margin-top: 1px; }
.lp-sep  { height: 1px; background: #f0f4f8; margin: 0; }
.lp-nav-btn {
  display: block; width: calc(100% - 36px); text-align: left;
  margin: 8px 18px; background: #fff; border: 1.5px solid var(--border-dark); padding: 9px 12px;
  font-size: 12.5px; font-weight: 700; color: var(--navy);
  cursor: pointer; font-family: inherit; border-radius: 10px;
  transition: all .12s;
}
.lp-nav-btn:hover { border-color: var(--navy); background: var(--muted-bg); }

/* API-Key Modal */
.modal-overlay-custom {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 600; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box-custom {
  background: #fff; border-radius: 18px; padding: 28px 26px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); position: relative;
}
.modal-close-custom {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-sub);
}

/* Footer */
#app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
}

#app-footer .footer-copy {
  font-size: 11.5px;
  color: #9ba8bb;
  font-weight: 500;
}

#app-footer .footer-copy strong {
  color: #6b7a8d;
  font-weight: 600;
}

#app-footer .footer-version {
  font-size: 11px;
  color: #c8d0dc;
}

#menu-toggle { display: none; }


/* ─── Page outlet ────────────────────────────────────────────── */
#page-outlet {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 48px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ─── Page header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card.highlight {
  background: linear-gradient(180deg, rgba(58,140,104,.08), rgba(58,140,104,.02));
  border-color: rgba(58,140,104,.18);
}

/* ─── Erste Schritte (aus BE:KI First) ────────────────────────── */
.check-list { padding-left: 18px; }
.check-list li { margin-bottom: 9px; font-size: .88rem; line-height: 1.6; }

.accordion-wrap { display: grid; gap: 12px; }
.accordion-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.accordion-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: none;
  border: none;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
}
.accordion-title { font-size: .92rem; font-weight: 700; color: var(--navy); }
.accordion-icon { color: var(--teal-d); font-size: 1.1rem; font-weight: 700; }
.accordion-content { display: none; padding: 0 18px 18px; font-size: .88rem; line-height: 1.6; color: var(--text-sub); }
.accordion-item.open .accordion-content { display: block; }

.dialogue-card { border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.dialogue-q { padding: 14px 16px; background: var(--muted-bg); color: var(--navy); font-size: .95rem; font-weight: 700; }
.dialogue-a { padding: 14px 16px 16px; font-size: .88rem; line-height: 1.6; min-height: 24px; }

.card-title {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

/* ════════════════════════════════════════════════════════════
   PINNWAND-DASHBOARD (exakt wie BE:KI Base/Suite)
   ════════════════════════════════════════════════════════════ */
.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.page-sub {
  font-size: 13px;
  color: var(--muted);
}

.dashboard-pinwand {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dashboard-pinwand .desk-surface {
  flex: 1;
  grid-template-rows: 1fr auto;
}
.dashboard-pinwand .desk-card { min-height: 0; }

.desk-surface {
  position: relative;
  display: grid;
  grid-template-columns: 1.04fr .96fr .9fr;
  gap: 16px;
  padding: 18px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(251,255,248,.88), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0)),
    radial-gradient(circle at 22% 26%, rgba(111,146,104,.08) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 68% 62%, rgba(106,139,100,.06) 0 1px, transparent 1px 6px),
    radial-gradient(circle at 82% 34%, rgba(98,129,93,.05) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, #dfead6 0%, #d2e2c8 24%, #c4d8bc 54%, #d7e5ce 78%, #e8f1df 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.36),
    inset 0 -10px 24px rgba(67,96,62,.08),
    0 16px 36px rgba(67,96,62,.12);
  flex-shrink: 0;
}
.desk-surface::before {
  content:''; position:absolute; inset:14px;
  border-radius:18px; border:1px solid rgba(255,255,255,.16);
  pointer-events:none;
}
.desk-surface::after {
  content:''; position:absolute; inset:0; border-radius:26px;
  pointer-events:none; opacity:.5;
  background:
    radial-gradient(circle at var(--stain-x1, 26%) var(--stain-y1, 24%),
      rgba(111,82,47,.12) 0, rgba(161,130,86,.07) 28%, transparent 55%),
    radial-gradient(circle at var(--stain-x2, 72%) var(--stain-y2, 66%),
      rgba(114,82,44,.10) 0, rgba(168,140,92,.05) 24%, transparent 50%);
  background-size: var(--stain-s1, 110px) var(--stain-s1, 110px),
                   var(--stain-s2, 88px) var(--stain-s2, 88px);
  background-repeat: no-repeat;
  filter: blur(.2px);
}

.desk-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(205,214,229,.96);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: 0 10px 22px rgba(30,61,115,.07), 0 3px 8px rgba(53,34,15,.08);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.desk-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}
.desk-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.desk-card-date {
  font-size: 11px;
  color: #8a96a8;
  font-weight: 700;
}
.desk-card-pin {
  position: absolute; top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b7f0d0, var(--teal-d) 68%, #2f6e54 100%);
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
}
.desk-card-clip {
  position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%);
  width: 64px; height: 18px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #dde3eb, #b4becd);
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.desk-thumbtack {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #f3f3f3 66%, #d8d8d8 100%);
  border: 1px solid rgba(160,160,160,.7);
  box-shadow: 0 2px 5px rgba(0,0,0,.16);
}
.desk-thumbtack::before {
  content:''; position:absolute; left:50%; top:10px; transform:translateX(-50%);
  width:2px; height:13px;
  background: linear-gradient(180deg, #8b8b8b, #d4d4d4);
  border-radius:2px; box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

.desk-termine {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(251,253,255,.96)),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(30,61,115,.06) 32px 33px);
  padding-top: 22px;
}
.desk-aufgaben {
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.72)),
    linear-gradient(180deg, #d9ecfb 0 18px, #eef7fe 18px, #f7fbff 100%);
  transform: rotate(-1deg);
  padding-top: 14px;
}
.desk-fristen {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,250,252,.95)),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(30,61,115,.05) 32px 33px);
  padding-top: 22px;
}
.desk-sticky {
  grid-column: 1 / -1;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.9)),
    linear-gradient(180deg, #fffef6 0%, #f9efc8 100%);
  transform: rotate(-.6deg);
}
.desk-sticky::before, .desk-sticky::after {
  content:''; position:absolute; top:-12px;
  width:64px; height:18px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #dde3eb, #b4becd);
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.desk-sticky::before { left: 24px; transform: rotate(-7deg); }
.desk-sticky::after  { right: 24px; transform: rotate(7deg); }

.desk-letterhead {
  margin: -2px -2px 10px;
  padding: 6px 10px 8px;
  border-bottom: 1px solid rgba(30,61,115,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(236,242,250,.95), rgba(247,249,252,.65));
}
.desk-letterhead img {
  display: block;
  width: 44px; height: 44px;
  object-fit: contain;
  mix-blend-mode: multiply;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 2px rgba(30,61,115,.08));
}

.desk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}
.desk-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 7px 0;
  border-top: 1px dashed #d9e1ee;
}
.desk-item:first-child { border-top: none; padding-top: 2px; }
.desk-item-badge {
  min-width: 48px;
  border-radius: 10px;
  background: #f4f7fb;
  color: var(--navy);
  font-size: 10.5px;
  font-weight: 800;
  padding: 6px 8px;
  text-align: center;
  flex-shrink: 0;
}
.desk-item-badge.urgent { background: #ffe1ec; color: #b73166; }
.desk-item-badge.warn   { background: #fdf3d3; color: #a07c00; }
.desk-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}
.desk-item-meta {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
.desk-item-empty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 4px 0;
}

.desk-writing-area {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  border-radius: 10px;
  padding: 10px 12px 8px;
  font: 500 12.5px/24px "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  color: #39465b;
  background:
    linear-gradient(180deg, transparent 0 23px, rgba(30,61,115,.10) 23px 24px),
    linear-gradient(90deg, rgba(199,79,61,.14) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.76));
  background-size: 100% 24px, 100% 100%, 100% 100%;
  box-shadow: inset 0 1px 3px rgba(30,61,115,.05);
  flex: 1;
  min-height: 60px;
}
.desk-writing-area::placeholder { color: #8e8f96; font-style: italic; }
.desk-writing-area:focus {
  box-shadow: inset 0 1px 3px rgba(30,61,115,.05), 0 0 0 2px rgba(30,61,115,.08);
}

/* ─── Dashboard grid ─────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.dash-grid .card-title {
  margin-bottom: 14px;
}

/* ─── Tables ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.data-table th {
  background: var(--muted-bg);
  border-bottom: 1px solid var(--border);
  padding: 11px 14px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-sub);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f0f4fa; }

.data-table .actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

/* ─── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: .875rem;
  background: var(--surface);
  color: var(--text);
}

.filter-bar input[type="text"],
.filter-bar input[type="search"] { min-width: 220px; }
.filter-bar select { min-width: 150px; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group label .req { color: var(--danger); margin-left: 2px; }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-group input,
.form-group textarea { width: 100%; }

/* Auswahlfenster sollen sich am Inhalt orientieren, nicht die ganze Spalte füllen */
.form-group select { width: auto; min-width: 140px; max-width: 100%; }

/* Kurze Eingaben (Alter, Reihenfolge, PLZ …) sollen nicht die ganze Spaltenbreite einnehmen */
.form-group.field-xs input { width: auto; max-width: 90px; }
.form-group.field-sm input { width: auto; max-width: 180px; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: .75rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.form-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--primary);
  margin: 22px 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-bg);
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 400;
  cursor: pointer;
  background: var(--muted-bg);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: background .1s;
}

.checkbox-group label:has(input:checked) {
  background: var(--primary-bg);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.checkbox-group input[type="checkbox"] { margin: 0; }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0;
  cursor: pointer;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
  text-decoration: none !important;
  white-space: nowrap;
}

.btn:active { transform: scale(.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--primary); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border-dark);
}
.btn-ghost:hover { background: var(--muted-bg); }

/* ─── Demo-Zugang (Button auf Hero-Seite + im Login-Panel) ───── */
.btn-demo {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 18px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #fff;
  font-family: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
  transition: filter .15s;
}
.btn-demo:hover  { filter: brightness(1.07); }
.btn-demo:disabled { opacity: .6; cursor: not-allowed; }

#lp-demo { margin-top: 10px; padding-top: 12px; border-top: 1px solid #eef2f7; }
.demo-hint { font-size: .72rem; color: var(--muted); text-align: center; margin: 8px 0 0; line-height: 1.4; }

.hero-demo { max-width: 340px; margin: 4px auto 30px; }
.hero-demo-hint { font-size: .78rem; color: #cdd6e3; text-align: center; margin: 9px 0 0; line-height: 1.5; }

.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-xs { padding: 3px 8px; font-size: .75rem; }
.btn-icon { padding: 6px 8px; }

.icon-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text-sub);
  cursor: pointer;
  transition: background .15s;
}

.icon-btn:hover { background: var(--muted-bg); }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-green   { background: var(--success-bg); color: var(--success); }
.badge-yellow  { background: var(--warning-bg); color: var(--warning); }
.badge-orange  { background: #fed7aa; color: #c2410c; }
.badge-red     { background: var(--danger-bg); color: var(--danger); }
.badge-gray    { background: var(--muted-bg); color: var(--muted); }
.badge-purple  { background: #ede9fe; color: #7c3aed; }
.badge-dark    { background: #1e293b; color: #f1f5f9; }

/* GdB badge */
.gdb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px; height: 24px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--primary-bg);
  color: var(--primary);
}

/* ─── Person avatar ──────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-lg {
  width: 56px; height: 56px;
  font-size: 1.1rem;
}

/* ─── Merkzeichen pills ──────────────────────────────────────── */
.merkzeichen-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.merkzeichen-pill {
  display: inline-block;
  padding: 1px 7px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 4px;
}

/* ─── Detail view ────────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.detail-header-info { flex: 1; min-width: 0; }
.detail-header-info h2 { font-size: 1.4rem; font-weight: 700; }
.detail-header-info .meta { color: var(--text-sub); font-size: .875rem; margin-top: 4px; }

.detail-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 20px;
  margin-bottom: 24px;
}

.info-item label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-sub);
  display: block;
  margin-bottom: 2px;
}

.info-item .value {
  font-size: .9rem;
  color: var(--text);
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-bg);
}

.detail-text {
  font-size: .9rem;
  color: var(--text);
  white-space: pre-wrap;
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 48px;
}

.empty-text {
  color: var(--text-sub);
  font-style: italic;
  font-size: .875rem;
}

/* ─── Personen cards ─────────────────────────────────────────── */
.personen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  text-decoration: none !important;
  color: var(--text);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.person-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.person-card-info { flex: 1; min-width: 0; }
.person-card-name { font-weight: 700; font-size: .95rem; margin-bottom: 2px; }
.person-card-sub  { font-size: .8rem; color: var(--text-sub); margin-bottom: 8px; }

/* ─── Aufgaben Kanban ────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.kanban-col {
  background: var(--muted-bg);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.kanban-count {
  min-width: 22px; height: 22px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-sub);
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow .15s;
  font-size: .875rem;
}

.task-card:hover { box-shadow: var(--shadow-md); }

.task-card-title {
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}

.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  font-size: .78rem;
  color: var(--text-sub);
}

.task-due {
  font-size: .78rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.task-due.overdue { background: var(--danger-bg); color: var(--danger); }
.task-due.today   { background: var(--warning-bg); color: var(--warning); }
.task-due.normal  { background: var(--muted-bg); color: var(--text-sub); }

/* ─── Termine calendar ───────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cal-header {
  background: var(--muted-bg);
  padding: 8px;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-sub);
}

.cal-day {
  background: var(--surface);
  min-height: 80px;
  padding: 6px;
  position: relative;
}

.cal-day.other-month { background: #fafafa; }
.cal-day.today { background: #e8eef8; }

.cal-day-num {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 2px;
}

.cal-day.today .cal-day-num {
  background: var(--accent);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.cal-event {
  font-size: .68rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--primary-bg);
  color: var(--primary);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* ─── Sitzungsplaner: drei Monate kompakt nebeneinander ─────── */
.sitzkal-mini .cal-day { min-height: 38px; padding: 4px; }
.sitzkal-mini .cal-day-num { font-size: .72rem; margin-bottom: 1px; }
.sitzkal-mini .cal-event { font-size: .6rem; padding: 0 3px; }
.sitzkal-mini .cal-header { padding: 5px; font-size: .68rem; }

/* ─── Anwesenheit (Ordentliche Mitglieder / Ersatzmitglieder, wie Session) ─── */
.anwesenheit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.anwesenheit-check {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border-dark);
  border-radius: var(--radius); font-size: .85rem; cursor: pointer;
}
.anwesenheit-check input { flex-shrink: 0; }
.anwesenheit-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }

.sitzorg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.static-field {
  padding: 9px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--muted-bg);
  color: var(--text);
}

/* ─── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── View toggle ────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}

.view-toggle-btn {
  background: none;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: background .15s;
}

.view-toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.empty-state h3   { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.empty-state p    { font-size: .875rem; }

/* ─── Modal ──────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#modal-box.wide { max-width: 820px; }

#modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}

#modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ─── Confirm dialog ─────────────────────────────────────────── */
#confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#confirm-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

#confirm-box h2 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
#confirm-box p  { font-size: .9rem; color: var(--text-sub); margin-bottom: 20px; }

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── Toasts ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
  animation: toast-in .2s ease;
  font-size: .875rem;
}

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-text { flex: 1; }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-msg   { color: var(--text-sub); font-size: .82rem; }

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--accent); }

/* ─── Begrüßung ──────────────────────────────────────────────── */
/* ─── Upcoming list ──────────────────────────────────────────── */
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}

.upcoming-item:last-child { border-bottom: none; }

.upcoming-date {
  flex-shrink: 0;
  text-align: center;
  min-width: 44px;
}

.upcoming-date .day   { font-size: 1.1rem; font-weight: 700; line-height: 1; }
.upcoming-date .month { font-size: .68rem; text-transform: uppercase; color: var(--text-sub); }

.upcoming-info { flex: 1; min-width: 0; }
.upcoming-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-sub   { font-size: .78rem; color: var(--text-sub); }

/* ─── Overdue list ───────────────────────────────────────────── */
.overdue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  cursor: pointer;
}

.overdue-item:last-child { border-bottom: none; }
.overdue-item:hover .overdue-title { color: var(--accent); }

.overdue-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

.overdue-info { flex: 1; min-width: 0; }
.overdue-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overdue-due   { font-size: .75rem; color: var(--danger); font-weight: 600; }

/* ─── Einstellungen ──────────────────────────────────────────── */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-section-title {
  font-size: .85rem;
  font-weight: 700;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--muted-bg);
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.settings-body {
  padding: 20px;
}

.data-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
}

.data-stat-row:last-child { border-bottom: none; }
.data-stat-row .label { color: var(--text-sub); }
.data-stat-row .value { font-weight: 600; }

/* ─── Utilities ──────────────────────────────────────────────── */
.hidden       { display: none !important; }
.text-muted   { color: var(--text-sub); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm      { font-size: .8rem; }
.fw-600       { font-weight: 600; }
.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.flex         { display: flex; }
.flex-gap-8   { display: flex; gap: 8px; }
.flex-gap-12  { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.back-link    { font-size: .85rem; color: var(--text-sub); margin-bottom: 12px; display: inline-flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--accent); }

.vertraulich-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .85rem;
  color: #c2410c;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Protokoll / Timeline ───────────────────────────────────── */
.protokoll-entry {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.protokoll-entry:last-of-type { border-bottom: none; }

.protokoll-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}
.protokoll-dot[data-typ="statusaenderung"] { background: var(--warning); }
.protokoll-dot[data-typ="aktion"]          { background: var(--success); }
.protokoll-dot[data-typ="kontakt"]         { background: var(--info, #0284c7); }
.protokoll-dot[data-typ="dokument"]        { background: var(--muted); }

.protokoll-body { flex: 1; min-width: 0; }

.protokoll-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .75rem;
  color: var(--text-sub);
  margin-bottom: 4px;
}
.protokoll-typ   { font-weight: 600; }
.protokoll-autor { font-style: italic; }
.protokoll-text  { font-size: .88rem; white-space: pre-wrap; }

/* ─── Kontakte ───────────────────────────────────────────────── */
.kontakt-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--primary);
  text-decoration: none;
  padding: 2px 0;
}
.kontakt-link:hover { text-decoration: underline; }

/* ─── Ladescreen ─────────────────────────────────────────────── */
#loader-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-box {
  text-align: center;
}

.loader-spinner {
  width: 42px; height: 42px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-msg {
  color: var(--text-sub);
  font-size: .9rem;
}

/* ─── Schreiben ──────────────────────────────────────────────── */
/* Gruppen-Überschriften Schritt 1 */
.sw-gruppe { margin-bottom: 28px; }
.sw-gruppe-title {
  font-size: .8rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .8px; color: var(--primary);
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-bg);
}

/* Karten-Selektion */
.sw-typ-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.sw-typ-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.sw-typ-selected { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(30,61,115,.1) !important; }

/* Schritt 2 */
.sw-step2-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.sw-section-card { margin-bottom: 14px; }
.sw-typ-hint-inline {
  font-size: .72rem; font-weight: 700; color: var(--success);
  background: var(--success-bg); padding: 2px 7px; border-radius: 10px; margin-left: 6px;
}

/* Schritt 3 */
.sw-result-layout {
  display: grid; grid-template-columns: 1fr 220px; gap: 16px; align-items: start;
}
.sw-result-main {}
.sw-result-sidebar {}

@media (max-width: 860px) {
  .sw-result-layout { grid-template-columns: 1fr; }
}

.sw-steps {
  display: flex; align-items: center; gap: 0;
  margin-left: auto;
}
.sw-step {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; color: var(--text-sub);
}
.sw-step.active .sw-step-num { background: var(--primary); color: #fff; }
.sw-step.active { color: var(--primary); }
.sw-step.done .sw-step-num { background: var(--success); color: #fff; }
.sw-step.done { color: var(--success); }
.sw-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--border); color: var(--text-sub);
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sw-step-line { width: 28px; height: 2px; background: var(--border); margin: 0 4px; }

.sw-section-title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--text-sub); margin-bottom: 14px;
}

.sw-typ-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.sw-typ-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: var(--muted-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: border-color .15s, background .15s;
}
.sw-typ-btn:hover { border-color: var(--primary); background: var(--primary-bg); }
.sw-typ-btn.selected { border-color: var(--primary); background: var(--primary-bg); }

.sw-typ-icon  { font-size: 1.4rem; margin-bottom: 2px; }
.sw-typ-label { font-size: .82rem; font-weight: 700; color: var(--text); }
.sw-typ-hint  { font-size: .7rem; color: var(--success); font-weight: 600; }

.sw-back-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.sw-cur-typ { font-size: .85rem; font-weight: 700; color: var(--primary); }

.sw-two-col {
  display: grid; grid-template-columns: 320px 1fr; gap: 24px;
  align-items: start;
}

.sw-context-box {
  background: var(--primary-bg); border: 1px solid var(--border-dark);
  border-radius: var(--radius); padding: 10px 12px;
  font-size: .8rem; color: var(--primary); line-height: 1.5;
  margin-top: 8px;
}

.sw-ton-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--muted-bg); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 5px 12px;
  font-size: .8rem; font-weight: 600; color: var(--text-sub);
  cursor: pointer; transition: all .12s;
}
.sw-ton-btn input[type="radio"] { display: none; }
.sw-ton-btn.selected,
.sw-ton-btn:has(input:checked) { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }

.sw-loading {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; gap: 16px;
}
.sw-loading-msg { color: var(--text-sub); font-size: .9rem; }

.sw-result-actions {
  display: flex; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px;
}

@media (max-width: 860px) {
  .sw-two-col { grid-template-columns: 1fr; }
  .sw-typ-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  #sidebar, #topbar, .page-header .btn, .page-header .view-toggle,
  .page-header .filter-bar, #toast-container, #modal-overlay,
  #confirm-overlay, .detail-header-actions, .data-table .actions,
  .btn-primary, .btn-accent { display: none !important; }

  #main    { margin-left: 0 !important; }
  body     { background: #fff !important; color: #000 !important; }
  .card, .table-wrap, .settings-section {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  #page-outlet { padding: 0 !important; }
  a { color: #000 !important; text-decoration: none !important; }

  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #000;
  }

  .print-header h1 { font-size: 1.2rem; }
  .print-header p  { font-size: .85rem; color: #555; }

  .no-print { display: none !important; }
}

.print-header { display: none; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .kanban-board { grid-template-columns: 1fr; }
}

/* ─── Persönlicher Bereich ────────────────────────────────────── */
.profil-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--muted-bg); border: 1.5px solid var(--border-dark);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; position: relative;
}
.profil-avatar span { font-size: 22px; font-weight: 800; color: var(--muted); }
.profil-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ─── KI-Widget (Eingruppierung / Wissen) – Optik wie Law/Grade ── */
.ki-intake {
  background: var(--surface);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  margin-bottom: 16px;
}
.ki-intake-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.ki-intake-desc  { font-size: 13px; color: var(--text-sub); margin-bottom: 16px; line-height: 1.6; }
.ki-intake-textarea { resize: vertical; min-height: 140px; line-height: 1.6; margin-bottom: 0; }
.ki-analyse-btn {
  width: 100%; margin-top: 14px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--navy), var(--navy-d));
  color: #fff; border: none; border-radius: 12px;
  font-size: 14.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 16px rgba(22,72,166,.35);
  transition: all .2s;
}
.ki-analyse-btn:hover  { box-shadow: 0 6px 24px rgba(22,72,166,.45); transform: translateY(-1px); }
.ki-analyse-btn:active { transform: translateY(0); }

.ki-followup { margin-top: 4px; }
.ki-followup textarea { resize: vertical; min-height: 70px; margin-bottom: 0; }

.ki-msg { max-width: 88%; margin-bottom: 12px; }
.ki-msg-user { margin-left: auto; }
.ki-msg-ai   { margin-right: auto; }
.ki-msg-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-sub); margin-bottom: 3px;
}
.ki-msg-user .ki-msg-label { text-align: right; }
.ki-msg-text {
  padding: 10px 14px; border-radius: var(--radius-lg);
  font-size: .88rem; line-height: 1.55;
}
.ki-msg-user .ki-msg-text { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.ki-msg-ai   .ki-msg-text { background: var(--muted-bg); color: var(--text); border-bottom-left-radius: 4px; }

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    z-index: 210;
  }
  #sidebar.open { transform: translateX(0); }
  #sidebar-overlay.open { display: block; }

  #main { margin-left: 0; }
  #menu-toggle { display: block; }

  #page-outlet { padding: 16px 14px 40px; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .dash-grid  { grid-template-columns: 1fr; }
  .desk-surface { grid-template-columns: 1fr; }
  .personen-grid { grid-template-columns: 1fr; }
  .calendar-grid { display: none; }

  .page-header { gap: 8px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input, .filter-bar select { min-width: 0; }
}
