/* ---------- contec Look (schlicht, ohne Bilder) ---------- */
:root {
  --navy: #003f73;
  --navy2: #00508f;
  --blue: #0058a8;
  --cyan: #00b9c7;
  --teal: #078983;
  --bg: #eef3f6;
  --soft: #f7fafc;
  --light: #eaf1f5;
  --card: #ffffff;
  --ink: #173b5f;
  --muted: #5a6673;
  --line: #d6e5ee;
  --green: #1f8a5b;
  --green-bg: #e4f4ec;
  --red: #b3412f;
  --red-bg: #f9e8e5;
  --amber: #8a6300;
  --amber-bg: #fff3d1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 43, 83, .05), 0 8px 24px rgba(0, 43, 83, .06);
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, Helvetica, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.5; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: var(--blue); }
b, strong { color: var(--navy); }

/* ---------- Marke ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; user-select: none; text-decoration: none; color: var(--navy); }
.brand .mark { display: inline-flex; flex: none; }
.brand .word { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); line-height: 1; }
.brand .claim { font-size: 10.5px; line-height: 1.3; color: var(--blue); border-left: 1.5px solid var(--cyan); padding-left: 10px; margin-left: 4px; }
.brand.light .word, .brand.light .claim { color: #fff; }
.brand.light .claim { border-color: var(--cyan); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 26px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .right { display: flex; align-items: center; gap: 10px; }
.topbar .who { text-align: right; line-height: 1.25; }
.topbar .who .name { font-weight: 700; color: var(--navy); font-size: 13.5px; }
.topbar .who .org { font-size: 12px; color: var(--muted); }
.nav-tabs { display: flex; gap: 4px; margin-left: 28px; flex: 1; }
.nav-tabs a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 7px 13px; border-radius: 8px; }
.nav-tabs a.active { background: var(--navy); color: #fff; }
.nav-tabs a:not(.active):hover { background: var(--light); color: var(--navy); }
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .nav-tabs { margin-left: 0; order: 3; width: 100%; }
  .topbar .who { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 15px; font-size: 13.5px; font-weight: 700;
  background: #fff; color: var(--navy); text-decoration: none; transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--soft); border-color: #b9cfdc; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy2); }
.btn.teal { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn.teal:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { color: var(--red); border-color: #e7c8c2; }
.btn.danger:hover { background: var(--red-bg); }
.btn:disabled { opacity: .5; cursor: default; }
.linklike { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Chips ---------- */
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; }
.chip.entwurf { background: #e6ecf1; color: #4b6376; }
.chip.freigabe { background: var(--amber-bg); color: var(--amber); }
.chip.versendet { background: #dcebf7; color: var(--navy); }
.chip.angenommen { background: var(--green-bg); color: var(--green); }
.chip.pflicht { background: #dcebf7; color: var(--navy); font-size: 10.5px; }
.chip.optional { background: #e2f5f3; color: var(--teal); font-size: 10.5px; }
.chip.intern { background: #dcebf7; color: var(--navy); }
.chip.extern { background: #e2f5f3; color: var(--teal); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #eef3f6 0%, #e2ecf3 100%); }
.login-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 36px 34px; width: 400px; max-width: 100%; border-top: 6px solid var(--navy); }
.login-card .brand { margin-bottom: 4px; }
.login-card .claim-line { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(0, 185, 199, .35); border-color: var(--cyan); }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.demo-hint { margin-top: 20px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); }
.demo-hint b { color: var(--navy); }
.error-box { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 10px 13px; font-size: 13px; margin-bottom: 14px; }

/* ---------- Seiten-Layout ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 26px 80px; }
.page.wide { max-width: 1560px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 14px; flex-wrap: wrap; }
.page-head h1 { color: var(--navy); font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.page-head .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); margin-bottom: 4px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meta-cards { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 8px; margin: 0 0 18px; }
.meta-card { background: var(--light); border-radius: 10px; padding: 10px 13px; }
.meta-card span { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 2px; }
.meta-card strong { color: var(--navy); font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .meta-cards { grid-template-columns: 1fr; } }

/* ---------- Angebotsliste ---------- */
.offer-list { display: grid; gap: 10px; }
.offer-row {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  padding: 16px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: border-color .12s, box-shadow .12s;
  border-left: 4px solid var(--navy);
}
.offer-row:hover { border-color: var(--cyan); box-shadow: var(--shadow); }
.offer-row .grow { flex: 1; min-width: 0; }
.offer-row .titel { font-size: 16px; color: var(--navy); font-weight: 800; }
.offer-row .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.offer-row .qbadge { background: var(--amber-bg); color: var(--amber); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 3px 10px; }

/* ---------- Tabellen & Formulare (Benutzer, Einstellungen) ---------- */
.table-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: auto; }
table.users { width: 100%; border-collapse: collapse; }
table.users th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--soft); }
table.users td { padding: 12px 18px; border-bottom: 1px solid #edf2f5; font-size: 13.5px; }
table.users tr:last-child td { border-bottom: none; }
.form-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 22px; margin-top: 16px; }
.form-card h3 { color: var(--navy); font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--cyan); display: inline-block; }
.form-card p.help { font-size: 13px; color: var(--muted); margin: -6px 0 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.check-row input { accent-color: var(--teal); width: 16px; height: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Editor (3 Spalten) ---------- */
.workspace { display: grid; grid-template-columns: 230px 350px minmax(0, 1fr); gap: 16px; align-items: start; }
.panel-title { font-size: 12px; font-weight: 800; color: var(--navy); margin-bottom: 8px; letter-spacing: .08em; text-transform: uppercase; }
.panel-title small { font-weight: 600; color: var(--muted); letter-spacing: 0; text-transform: none; margin-left: 6px; }
.bnav { display: flex; flex-direction: column; gap: 5px; }
.bnav .sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 10px 2px 2px; font-weight: 700; }
.bnav button { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 11px; text-align: left; color: var(--ink); cursor: pointer; display: flex; align-items: center; gap: 9px; transition: border-color .12s; width: 100%; }
.bnav button:hover { border-color: #b9cfdc; }
.bnav button strong { display: block; font-size: 13px; color: var(--navy); line-height: 1.2; }
.bnav button span.s { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.bnav button .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); flex: none; }
.bnav button.off .dot { background: #cbd6de; }
.bnav button.off strong { color: var(--muted); }
.bnav button .txt { flex: 1; min-width: 0; }
.bnav button.active { background: var(--navy); border-color: var(--navy); }
.bnav button.active strong, .bnav button.active span.s { color: #fff; }
.bnav button.active span.s { color: #d7eaf5; }
.bnav button.active .dot { background: var(--cyan); }
.bnav button.add { border-style: dashed; color: var(--muted); font-weight: 700; font-size: 13px; justify-content: center; }
.bnav button.add:hover { color: var(--navy); border-color: var(--cyan); }

.editor-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.editor-card h3 { color: var(--navy); font-size: 17px; margin: 0; }
.editor-card .sub { color: var(--muted); font-size: 12.5px; margin: 3px 0 14px; }
.editor-card .box { border-left: 4px solid var(--cyan); background: var(--soft); padding: 12px 13px; border-radius: 9px; margin-top: 12px; }
.editor-card .box > strong { display: block; color: var(--navy); font-size: 13px; margin-bottom: 8px; }
.editor-card .box .field:last-child { margin-bottom: 0; }
.editor-card .box .note { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.editor-card .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.editor-card .switch-row .lbl { font-weight: 700; color: var(--navy); }
.editor-card .editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ki-row { display: flex; gap: 6px; margin-top: 6px; }
.ki-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }

.preview-col .preview-note { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.preview-frame { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; box-shadow: var(--shadow); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 230px minmax(0, 1fr); }
  .preview-col { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
}

/* Toggle-Switch */
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cbd6de; border-radius: 999px; transition: .15s; cursor: pointer; }
.switch .slider::before { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--teal); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:disabled + .slider { opacity: .5; cursor: default; }

/* Rückfragen */
.questions-card { background: var(--amber-bg); border: 1px solid #f0dc9a; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.questions-card h3 { color: var(--amber); font-size: 14px; margin-bottom: 8px; }
.question-item { background: #fff; border-radius: 8px; padding: 9px 12px; margin-bottom: 6px; font-size: 13.5px; }
.question-item .qmeta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Kundenansicht (Kapitel-Navigation + Seite) ---------- */
.viewer { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 57px); }
.viewer .sidebar { background: linear-gradient(180deg, #003f73 0%, #00508f 100%); color: #fff; padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.viewer .sidebar .head { padding: 0 8px 12px; border-bottom: 1px solid rgba(255,255,255,.18); }
.viewer .sidebar .head .t { font-size: 15px; font-weight: 800; line-height: 1.25; }
.viewer .sidebar .head .s { font-size: 11px; color: #d7eaf5; margin-top: 4px; line-height: 1.4; }
.cnav { display: flex; flex-direction: column; gap: 3px; }
.cnav button { appearance: none; border: 0; background: transparent; color: #e8f2f8; text-align: left; padding: 9px 11px; border-radius: 9px; font-size: 12.5px; line-height: 1.2; cursor: pointer; transition: .15s; border-left: 4px solid transparent; }
.cnav button:hover { background: rgba(255,255,255,.09); }
.cnav button.active { background: #fff; color: var(--navy); font-weight: 800; border-left-color: var(--cyan); }
.cnav button small { display: block; font-size: 10px; opacity: .75; margin-top: 2px; font-weight: 500; }
.cnav button .n { display: inline-block; min-width: 22px; font-weight: 800; opacity: .8; }
.viewer .sidebar .foot { margin-top: auto; padding: 10px 8px 0; color: #d7eaf5; font-size: 10.5px; line-height: 1.45; border-top: 1px solid rgba(255,255,255,.18); }
.viewer .stagewrap { padding: 22px 28px 40px; min-width: 0; }
.viewer .stage { max-width: 1120px; margin: 0 auto; }
.viewer .controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.viewer .controls .count { font-size: 12px; color: var(--muted); min-width: 60px; text-align: center; }
.preview-banner { background: var(--navy); color: #fff; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.preview-banner a { color: #9be9ef; font-weight: 700; text-decoration: none; }
.accepted-banner { background: var(--green-bg); border: 1px solid #b9dfc9; color: var(--green); border-radius: 10px; padding: 11px 16px; margin: 0 auto 14px; font-weight: 700; font-size: 13.5px; max-width: 1120px; }
@media (max-width: 860px) {
  .viewer { grid-template-columns: 1fr; }
  .viewer .sidebar { flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; overflow-x: auto; }
  .viewer .sidebar .head, .viewer .sidebar .foot { display: none; }
  .cnav { flex-direction: row; gap: 4px; }
  .cnav button { white-space: nowrap; padding: 7px 10px; border-left: 0; border-bottom: 3px solid transparent; border-radius: 7px; }
  .cnav button.active { border-bottom-color: var(--cyan); }
  .cnav button small { display: none; }
  .viewer .stagewrap { padding: 14px 14px 30px; }
}

/* Eine Angebotsseite */
.pg { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.pg::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--navy) 0 74%, var(--cyan) 74% 100%); }
.pg-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 30px 12px; }
.pg-top .services { font-size: 9.5px; letter-spacing: .16em; font-weight: 800; color: var(--blue); text-align: right; line-height: 1.5; }
.pg-top .services::after { content: ''; display: block; width: 34px; height: 2px; background: var(--cyan); margin: 5px 0 0 auto; }
.pg-body { padding: 10px 30px 26px; }
.pg-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.pg-num { display: flex; align-items: flex-start; gap: 7px; flex: none; padding-top: 4px; }
.pg-num .n { font-size: 34px; line-height: .9; font-weight: 800; color: var(--navy); letter-spacing: -1px; }
.pg-num .bar { width: 3px; height: 32px; background: var(--cyan); border-radius: 2px; }
.pg-head h2 { color: var(--navy); font-size: 28px; line-height: 1.05; letter-spacing: -.5px; font-weight: 800; }
.pg-head .sub { font-size: 16px; color: var(--cyan); margin-top: 3px; font-weight: 500; }
.pg .lead { font-size: 14.5px; line-height: 1.65; color: #2f5273; max-width: 760px; margin-bottom: 18px; }
.pg-foot { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 30px; border-top: 1px solid var(--line); font-size: 11px; color: #43617b; }
.pg-foot .pipe { color: #8ca6b8; margin: 0 7px; }
@media (max-width: 640px) {
  .pg-top, .pg-body, .pg-foot { padding-left: 18px; padding-right: 18px; }
  .pg-top .services { display: none; }
  .pg-head h2 { font-size: 22px; }
  .pg-foot { grid-template-columns: 1fr; }
}

/* Deckblatt */
.cover { position: relative; overflow: hidden; background: linear-gradient(135deg, #003e78 0%, #07578e 68%, #078983 145%); color: #fff; padding: 46px 40px 40px; min-height: 380px; }
.cover::before { content: ''; position: absolute; right: -90px; top: -100px; width: 320px; height: 320px; border-radius: 46% 54% 60% 40%; background: rgba(255,255,255,.07); }
.cover::after { content: ''; position: absolute; right: -80px; bottom: -160px; width: 380px; height: 380px; border-radius: 50%; border: 1px solid rgba(255,255,255,.24); }
.cover .in { position: relative; z-index: 1; }
.cover .eyebrow { font-size: 12px; letter-spacing: .17em; text-transform: uppercase; font-weight: 800; color: #d7eaf5; }
.cover .eyebrow::after { content: ''; display: block; width: 34px; height: 2px; background: var(--cyan); margin-top: 10px; }
.cover h1 { font-size: 40px; line-height: 1.08; margin: 26px 0 14px; max-width: 720px; font-weight: 800; letter-spacing: -.5px; white-space: pre-line; color: #fff; }
.cover .client { font-size: 20px; color: #eef5f8; max-width: 720px; }
.cover .pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.cover .pill { border: 1px solid rgba(255,255,255,.33); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: #eef5f8; }
.cover-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 22px 40px 26px; }
.cover-strip .lbl { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; color: var(--blue); margin-bottom: 6px; }
.cover-strip .v { font-weight: 800; color: var(--navy); font-size: 15px; }
.cover-strip .r { font-size: 12.5px; color: var(--muted); }
.cover-strip .contact { display: flex; gap: 12px; align-items: center; }
.cover-strip .avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--light); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.cover-strip .cline { font-size: 12.5px; color: var(--ink); display: flex; align-items: center; gap: 6px; margin-top: 3px; }
@media (max-width: 640px) {
  .cover { padding: 30px 22px 28px; min-height: 0; }
  .cover h1 { font-size: 28px; }
  .cover-strip { grid-template-columns: 1fr; padding: 18px 22px 22px; }
}

/* Inhalts-Bausteine */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 15px; }
.tile > strong { color: var(--navy); display: block; margin-bottom: 4px; }
.tile .t { font-size: 13px; color: var(--muted); line-height: 1.5; }
.soft-tile { border-left: 4px solid var(--cyan); border-radius: 10px; background: var(--soft); padding: 14px 15px; }
.soft-tile > strong { color: var(--navy); display: block; margin-bottom: 6px; }
.soft-tile .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.soft-tile .kv span:nth-child(odd) { color: var(--muted); }
.soft-tile .kv span:nth-child(even) { color: var(--navy); font-weight: 700; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.prose p { margin-bottom: 12px; font-size: 14.5px; line-height: 1.65; color: #2f5273; }
.prose p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .grid2, .grid3, .two-col { grid-template-columns: 1fr; } }

/* Info-Knopf (ⓘ) */
.ibtn { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--blue); background: #fff; color: var(--blue); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; font-family: Georgia, serif; }
.ibtn:hover { background: var(--blue); color: #fff; }

/* Vorgehen */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.steps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { min-width: 0; }
.step .circ { width: 56px; height: 56px; border-radius: 50%; background: var(--light); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; }
.step .row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.step .num { font-weight: 800; color: var(--navy); font-size: 14px; }
.step .num::after { content: ''; display: block; width: 22px; height: 2px; background: var(--cyan); margin-top: 3px; }
.step .cap { font-size: 14px; color: var(--navy); font-weight: 800; line-height: 1.25; margin-top: 8px; }
.step ul { list-style: none; margin-top: 8px; }
.step li { font-size: 12.5px; color: #2f5273; line-height: 1.4; padding-left: 12px; position: relative; margin-bottom: 4px; }
.step li::before { content: '•'; color: var(--cyan); position: absolute; left: 0; }
.value-strip { margin-top: 20px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 14px; align-items: center; }
.value-strip .h { font-weight: 800; color: var(--navy); font-size: 15px; padding-right: 14px; border-right: 1px solid var(--line); }
.value-strip .it { font-size: 12px; color: var(--muted); line-height: 1.4; display: flex; gap: 8px; }
.value-strip .it b { display: block; font-size: 12.5px; }
.value-strip .ok { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--blue); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; }
@media (max-width: 860px) {
  .steps, .steps.three { grid-template-columns: 1fr 1fr; }
  .value-strip { grid-template-columns: 1fr; }
  .value-strip .h { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
}
@media (max-width: 520px) { .steps, .steps.three { grid-template-columns: 1fr; } }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.team-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; }
.person { border: 1px solid var(--line); border-radius: 12px; padding: 16px 14px; text-align: center; background: #fff; position: relative; }
.person .avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px; background: var(--light); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
.person .badge { position: absolute; top: 10px; left: 10px; background: var(--teal); color: #fff; font-size: 9.5px; font-weight: 800; padding: 3px 7px; border-radius: 6px; letter-spacing: .03em; }
.person .n { font-weight: 800; color: var(--navy); font-size: 13.5px; }
.person .r { font-size: 12px; color: var(--blue); font-weight: 700; margin-top: 1px; }
.person .d { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.4; }
@media (max-width: 860px) { .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .team-grid, .team-grid.two { grid-template-columns: 1fr; } }

/* Referenzen */
.ref-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ref-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--navy); font-weight: 700; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.ref-list .ok { width: 22px; height: 22px; border-radius: 50%; background: var(--light); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; flex: none; }
@media (max-width: 640px) { .ref-list { grid-template-columns: 1fr; } }

/* Honorar */
.fee-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fee-box { border-left: 4px solid var(--line); border-radius: 10px; background: var(--soft); padding: 18px; position: relative; }
.fee-box.recommended { border-left-color: var(--teal); background: #f2f9f8; }
.fee-box .rec-badge { position: absolute; top: 12px; right: 12px; background: var(--teal); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 6px; letter-spacing: .04em; }
.fee-box .fname { font-size: 13.5px; color: var(--navy); font-weight: 800; }
.fee-box .pct { font-size: 34px; color: var(--navy); font-weight: 800; margin: 4px 0 0; line-height: 1.1; }
.fee-box .base { font-size: 12px; color: var(--muted); }
.fee-box .min { font-size: 13px; color: var(--navy); font-weight: 700; margin-top: 10px; }
.fee-note { margin-top: 14px; }
@media (max-width: 640px) { .fee-grid { grid-template-columns: 1fr; } }

/* Vereinbarungen + Annahme */
.final-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.legal-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); padding: 12px 14px; margin-bottom: 8px; }
.legal-card strong { display: block; color: var(--navy); font-size: 13.5px; }
.legal-card small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.accept-panel { background: linear-gradient(180deg, #eef7fb 0%, #e9f3f8 100%); border: 1px solid #d4e6ef; border-radius: 12px; padding: 20px 18px 16px; display: flex; flex-direction: column; gap: 9px; }
.accept-panel .ico { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.accept-panel h3 { color: var(--navy); font-size: 22px; line-height: 1.1; margin-top: 2px; }
.accept-panel p { font-size: 12.5px; color: #365b76; line-height: 1.45; }
.accept-panel .btn { width: 100%; }
.accept-panel .sep { display: flex; align-items: center; gap: 8px; color: #678399; font-size: 11px; }
.accept-panel .sep::before, .accept-panel .sep::after { content: ''; height: 1px; background: #abc7d6; flex: 1; }
.accept-panel .contact { margin-top: 6px; border-top: 1px solid #c6dce7; padding-top: 10px; font-size: 11.5px; line-height: 1.45; color: #46647c; }
.accept-panel .contact strong { display: block; color: var(--navy); margin-bottom: 3px; }
.accept-panel .done { background: var(--green-bg); color: var(--green); border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 700; }
@media (max-width: 860px) { .final-grid { grid-template-columns: 1fr; } }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(2, 29, 52, .52); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 16px; border-top: 6px solid var(--navy); padding: 24px 26px; width: 560px; max-width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal .kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); font-weight: 800; }
.modal h3 { color: var(--navy); font-size: 21px; margin: 4px 0 6px; }
.modal .msub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; line-height: 1.5; }
.modal .mbody { font-size: 14.5px; line-height: 1.6; color: #34526b; }
.modal .mbody p { margin-bottom: 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal .sep-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 16px 0 8px; }
.pick-option { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.pick-option.sel { border-color: var(--teal); background: #f2f9f8; }
.pick-option input { accent-color: var(--teal); }
.pick-option .po-t { font-weight: 700; color: var(--navy); font-size: 14px; }
.pick-option .po-s { font-size: 12.5px; color: var(--muted); }
.key-box { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; margin-bottom: 14px; }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast-msg { background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.25); animation: toast-in .2s ease; }
.toast-msg.err { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; }

/* ---------- Druck (alle Seiten nacheinander) ---------- */
@media print {
  body { background: #fff; }
  .topbar, .no-print, .preview-banner, #toast, #modal-root, .viewer .sidebar, .viewer .controls { display: none !important; }
  .viewer { display: block; }
  .viewer .stagewrap { padding: 0; }
  .viewer .stage { max-width: none; }
  .pgwrap { display: block !important; }
  .pg { display: block !important; box-shadow: none; border: 0; border-radius: 0; break-after: page; }
  .accept-panel .btn, .accept-panel .sep, .ibtn { display: none !important; }
  .pg::before { display: none; }
  .cover { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Version 2: Verwaltung, Daten, Unterschrift ---------- */
.subtabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.subtabs a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subtabs a.active { color: var(--navy); border-bottom-color: var(--cyan); }
.login-links { margin-top: 18px; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.info-box { background: var(--light); border-left: 4px solid var(--cyan); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; color: var(--ink); margin-bottom: 16px; line-height: 1.5; }
p.help { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.modal.wide { width: 760px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.json-box, .log-box, pre.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; line-height: 1.5; color: var(--ink); }
.log-box { max-height: 300px; font-size: 11.5px; }
.lib-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.lib-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; }
.lib-item .lib-kurz { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.qanswer { margin-top: 8px; background: var(--light); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.qform { display: flex; gap: 8px; margin-top: 8px; }
.qform input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font-size: 13px; }
.sigpad { position: relative; border: 1.5px dashed #b9cfdc; border-radius: 10px; background: #fff; overflow: hidden; }
.sigpad canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 34px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); padding-top: 4px; pointer-events: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; border-top: 4px solid var(--navy); }
.kpi.ok { border-top-color: var(--green); } .kpi.warn { border-top-color: var(--amber); }
.kpi-n { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kpi-l { font-size: 12.5px; color: var(--ink); font-weight: 700; margin-top: 4px; }
.kpi-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-grid { display: grid; gap: 16px; }
.card-grid.two { grid-template-columns: 1fr 1fr; }
.card-grid .form-card { margin-top: 0; }
@media (max-width: 960px) { .card-grid.two { grid-template-columns: 1fr; } }
svg.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
details.chart-table, details.doc-details { margin-top: 10px; font-size: 13px; }
details summary { cursor: pointer; color: var(--blue); font-weight: 700; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.mini th, table.mini td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #edf2f5; vertical-align: top; }
table.mini th { color: var(--muted); font-weight: 700; font-size: 12px; }
.activity { display: grid; gap: 6px; }
.act { display: flex; gap: 10px; font-size: 12.5px; align-items: baseline; flex-wrap: wrap; }
.act-t { color: var(--muted); white-space: nowrap; } .act-w { font-weight: 700; color: var(--navy); } .act-a { color: var(--ink); } .act-e { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }

.data-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.data-side { display: flex; flex-direction: column; gap: 4px; }
.data-side a { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--ink); font-size: 13px; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.data-side a b { color: var(--muted); font-weight: 700; font-size: 12px; }
.data-side a.active { background: var(--navy); color: #fff; border-color: var(--navy); } .data-side a.active b { color: #d7eaf5; }
.data-main { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--soft); }
.toolbar input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; min-width: 200px; }
.toolbar select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-size: 12.5px; background: #fff; }
.toolbar .spacer, .pager .spacer { flex: 1; }
.dtable-wrap { overflow: auto; max-height: 70vh; }
table.dtable { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.dtable th { position: sticky; top: 0; background: #fff; text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--line); color: var(--navy); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; cursor: pointer; user-select: none; }
table.dtable th.sorted { color: var(--cyan); }
table.dtable td { padding: 8px 10px; border-bottom: 1px solid #edf2f5; vertical-align: top; max-width: 320px; }
table.dtable tbody tr { cursor: pointer; } table.dtable tbody tr:hover { background: var(--soft); }
table.dtable td.empty { text-align: center; color: var(--muted); padding: 30px; }
.muted { color: var(--muted); }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.form-grid .span2 { grid-column: 1 / -1; }
.field .ro { font-size: 13px; color: var(--ink); padding: 8px 0; word-break: break-all; }
@media (max-width: 860px) { .data-layout { grid-template-columns: 1fr; } .data-side { flex-direction: row; flex-wrap: wrap; } }

.checks { display: grid; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: #fff; }
.check .mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.check.ok .mark { background: var(--green-bg); color: var(--green); } .check.warn .mark { background: var(--amber-bg); color: var(--amber); }
.check b { font-size: 13px; color: var(--navy); } .check .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.action-list { display: grid; gap: 12px; }
.action-list > div { border-top: 1px solid var(--line); padding-top: 10px; }
.action-list > div:first-child { border-top: 0; padding-top: 0; }
.action-list b { color: var(--navy); font-size: 13.5px; } .action-list p { font-size: 12.5px; color: var(--muted); margin: 3px 0 8px; }
.action-list input[type=file] { font-size: 12px; }
.steps-list { padding-left: 20px; font-size: 13.5px; line-height: 1.6; display: grid; gap: 6px; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; margin-bottom: 12px; font-size: 13px; }

/* ---- 2.1: Microsoft-Anmeldung, Bestätigungscode, Belege ---- */
.btn.ms { background: #fff; border-color: #c9ced3; color: #1b1b1b; display: inline-flex; align-items: center; gap: 9px; justify-content: center; width: 100%; }
.btn.ms.small { width: auto; }
.btn.ms:hover { background: #f3f5f7; }
.otp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 8px; }
.otp-row .field { margin-bottom: 0; }
.otp-row .btn { margin-bottom: 2px; white-space: nowrap; }
.chip.neu { background: var(--amber-bg); color: var(--amber); }
.chip.geprueft { background: #dcebf7; color: var(--navy); }
.chip.bezahlt { background: var(--green-bg); color: var(--green); }
.chip.abgelehnt { background: var(--red-bg); color: var(--red); }
.dropzone { margin-top: 14px; border: 2px dashed #c9ced3; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); font-size: 13px; transition: .15s; }
.dropzone.over { border-color: var(--teal); background: #e2f5f3; color: var(--teal); }
.beleg-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; }
@media (max-width: 900px) { .beleg-detail { grid-template-columns: 1fr; } }
.section-title { font-size: 17px; margin: 26px 0 10px; color: var(--navy); }
table.mini tr[onclick]:hover td { background: #f3f6f9; }
#bl-toolbar input[type=date] { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #eef2f5; padding: 1px 5px; border-radius: 4px; }

/* ---- 2.2: Admincenter, Konto, Lesezeichen, Assistent, Hilfe, Ansichten ---- */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-nav a { text-decoration: none; color: var(--navy); font-weight: 600; font-size: 13.5px; padding: 7px 13px; border-radius: 999px; border: 1px solid transparent; }
.admin-nav a:hover { background: #eef3f6; }
.admin-nav a.active { background: var(--navy); color: #fff; }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.admin-tiles a { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; transition: .15s; }
.admin-tiles a:hover { border-color: var(--teal); transform: translateY(-1px); }
.admin-tiles h3 { margin: 0 0 6px; font-size: 15px; color: var(--navy); }
.admin-tiles p { margin: 0; font-size: 13px; color: var(--muted); }
.admin-tiles .n { font-size: 24px; font-weight: 700; color: var(--navy); }
.form-card h3 .k { font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .06em; margin-left: 8px; }
.offers-toolbar { margin-bottom: 12px; }
.offers-toolbar input { min-width: 240px; }
.offer-row .star { background: none; border: 0; font-size: 18px; line-height: 1; color: #c9ced3; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.offer-row .star:hover { color: var(--amber); background: #fff3d1; }
.offer-row .star.on { color: var(--amber); }
.btn.star { font-size: 16px; padding: 6px 10px; }
.btn.star.on { color: var(--amber); border-color: #e8d8a8; background: #fff8e6; }
.bm-wrap { position: relative; }
.bm-count { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 11px; text-align: center; }
.bm-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 420px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 40, 80, .14); z-index: 60; text-align: left; }
.bm-head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 14px 6px; }
.bm-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 14px; }
.bm-item a { flex: 1; min-width: 0; text-decoration: none; color: var(--navy); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-item .bm-kind { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .05em; margin-right: 6px; }
.bm-item button { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 2px 6px; }
.bm-item:hover { background: #f3f6f9; }
.bm-empty { padding: 10px 14px 14px; font-size: 12.5px; color: var(--muted); }
.bm-foot { border-top: 1px solid var(--line); padding: 8px 14px; font-size: 12.5px; }
.chat-fab { position: fixed; right: 22px; bottom: 22px; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(0, 40, 80, .28); cursor: pointer; z-index: 70; }
.chat-fab:hover { background: var(--navy2); }
.chat-fab.open { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.chat-panel { position: fixed; right: 22px; bottom: 88px; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 48px rgba(0, 40, 80, .2); display: flex; flex-direction: column; z-index: 69; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f6f9fb; }
.chat-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chat-agent { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--navy); background: #fff; max-width: 220px; }
.chat-desc { font-size: 12px; color: var(--muted); padding: 8px 14px 0; }
.chat-log { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-log .msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; }
.chat-log .msg.user { align-self: flex-end; background: var(--navy); color: #fff; white-space: pre-wrap; }
.chat-log .msg.assistant { align-self: flex-start; background: #eef3f6; color: #1d2a36; }
.chat-log .msg.assistant p { margin: 0 0 6px; } .chat-log .msg.assistant p:last-child { margin: 0; }
.chat-log .msg.assistant ul { margin: 4px 0 6px 18px; padding: 0; }
.chat-log .msg.assistant b { color: var(--navy); }
.msg-warn { margin-top: 6px; font-size: 11.5px; color: var(--amber); }
.chat-hints p { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.chip-btn { display: inline-block; margin: 0 6px 6px 0; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 12.5px; color: var(--navy); cursor: pointer; }
.chip-btn:hover { border-color: var(--teal); background: #e2f5f3; }
.chat-ctx { padding: 4px 14px; font-size: 12.5px; color: var(--muted); }
.chat-input { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13.5px; }
.chat-foot { font-size: 10.5px; color: var(--muted); padding: 0 14px 10px; }
@media print { .chat-fab, .chat-panel, .bm-menu { display: none !important; } }
.hilfe-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 900px) { .hilfe-layout { grid-template-columns: 1fr; } }
.hilfe-side { position: sticky; top: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; max-height: calc(100vh - 40px); overflow: auto; }
.hilfe-side input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; margin-bottom: 10px; }
.hilfe-toc a { display: block; text-decoration: none; color: var(--navy); font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.hilfe-toc a.l3 { padding-left: 20px; font-size: 12.5px; color: #3d4f60; }
.hilfe-toc a.l4 { padding-left: 32px; font-size: 12px; color: var(--muted); }
.hilfe-toc a:hover, .hilfe-toc a.active { background: #eef3f6; }
.hilfe-doc { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px 34px; max-width: 900px; }
.hilfe-doc h1 { font-size: 24px; margin: 0 0 14px; color: var(--navy); }
.hilfe-doc h2 { font-size: 19px; margin: 30px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--navy); }
.hilfe-doc h3 { font-size: 15.5px; margin: 20px 0 8px; color: var(--navy); }
.hilfe-doc h4 { font-size: 14px; margin: 14px 0 6px; }
.hilfe-doc p, .hilfe-doc li { font-size: 14px; line-height: 1.6; }
.hilfe-doc ul, .hilfe-doc ol { padding-left: 22px; margin: 6px 0 12px; }
.hilfe-doc .tbl { overflow-x: auto; margin: 10px 0 14px; }
.hilfe-doc table { border-collapse: collapse; width: 100%; font-size: 13px; }
.hilfe-doc th, .hilfe-doc td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.hilfe-doc th { background: #f3f6f9; color: var(--navy); }
.hilfe-doc pre { background: #0f2238; color: #e6eef7; border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.5; }
.hilfe-doc pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.hilfe-doc blockquote { border-left: 4px solid var(--teal); margin: 10px 0; padding: 6px 12px; background: #eef7f6; border-radius: 6px; }
.hilfe-doc hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.hilfe-doc mark { background: #fff3d1; }
.hilfe-results { margin-top: 8px; }
.hilfe-results a { display: block; text-decoration: none; padding: 8px; border-radius: 8px; border: 1px solid transparent; }
.hilfe-results a:hover { background: #f3f6f9; }
.hilfe-results b { display: block; font-size: 13px; color: var(--navy); }
.hilfe-results span { font-size: 12px; color: var(--muted); }
.view-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.view-tabs a { text-decoration: none; font-size: 12.5px; font-weight: 600; color: var(--navy); padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.view-tabs a.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.view-tabs a .sh { font-weight: 400; color: inherit; opacity: .75; font-size: 11px; margin-left: 4px; }
.view-tabs .lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.invite-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2em; }

[hidden] { display: none !important; }

/* ---- 2.3 ---- */
.chat-model { border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font: inherit; font-size: 11.5px; color: var(--navy); background: #fff; max-width: 200px; }
.msg-meta { margin-top: 6px; font-size: 11px; color: var(--muted); }
.msg-meta summary { cursor: pointer; }
.msg-meta .chip-btn { margin-top: 6px; }

/* ---- 2.4: Datei-Schleuse ---- */
.chip.abgelehnt { background: var(--red-bg); color: var(--red); }
.chip.sauber { background: var(--green-bg); color: var(--green); }
ul.befunde { margin: 6px 0 10px; padding-left: 18px; font-size: 13px; }
ul.befunde li { margin: 2px 0; }
ul.befunde li.kritisch { color: var(--red); }
ul.befunde li.warnung { color: var(--amber); }
ul.befunde li.info { color: var(--muted); }

/* ---------- Projekt-Plattform: Ergänzungen ---------- */
.chip.aktiv, .chip.bezahlt, .chip.genehmigt, .chip.gestellt-ok { background: var(--green-bg); color: var(--green); }
.chip.anbahnung, .chip.beantragt, .chip.teilbezahlt { background: var(--amber-bg); color: var(--amber); }
.chip.pausiert, .chip.abgelaufen, .chip.storniert { background: #eceff2; color: var(--muted); }
.chip.abgeschlossen, .chip.gestellt { background: #e3ecf7; color: var(--blue); }
.chip.ueberfaellig, .chip.abgelehnt, .chip.krank { background: var(--red-bg); color: var(--red); }
.chip.archiviert { background: #eceff2; color: var(--muted); text-decoration: line-through; }
.chip.tagwerk, .chip.aufwand, .chip.festpreis, .chip.retainer, .chip.intern-abr { background: var(--light); color: var(--navy); }
.chip.urlaub, .chip.fortbildung, .chip.feiertag, .chip.sonstiges { background: var(--light); color: var(--navy); }
.chip.abschlag, .chip.schluss, .chip.gutschrift, .chip.storno, .chip.rechnung { background: var(--light); color: var(--navy); }
.nav-tabs a.more { color: var(--muted); }
.timer-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--green-bg); color: var(--green); border-radius: 999px; padding: 5px 10px 5px 12px; font-size: 12.5px; font-weight: 600; max-width: 320px; }
.timer-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: puls 1.4s ease-in-out infinite; }
@keyframes puls { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.timer-chip span.t { font-family: ui-monospace, Menlo, monospace; }
.timer-chip button { border: 0; background: var(--green); color: #fff; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; }
.timer-chip .lbl { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; cursor: pointer; }
.list-row:hover { border-color: var(--cyan); box-shadow: var(--shadow); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .titel { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.list-row .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.list-row .num { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--muted); min-width: 92px; }
.list-row .amount { font-weight: 700; color: var(--navy); min-width: 110px; text-align: right; }
.list-row .stat { min-width: 120px; text-align: right; font-size: 12.5px; color: var(--muted); }
.list-row .colorbar { width: 5px; align-self: stretch; border-radius: 4px; background: var(--light); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--blue); flex: none; }
.avatars { display: inline-flex; }
.avatars .avatar { margin-left: -8px; border: 2px solid #fff; width: 26px; height: 26px; font-size: 10px; }
.avatars .avatar:first-child { margin-left: 0; }
.progress { height: 8px; background: var(--light); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--cyan); border-radius: 999px; }
.progress.warn i { background: #d9a400; }
.progress.over i { background: var(--red); }
.progress-lbl { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; justify-content: space-between; }
.detail-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; flex: 1; }
.detail-head .facts span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.detail-head .facts b { font-size: 14px; color: var(--navy); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0 14px; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--cyan); }
.tabs a .n { display: inline-block; background: var(--light); color: var(--navy); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 5px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 130px; }
.week .day.today { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(0, 185, 199, .15); }
.week .day.we { background: var(--soft); }
.week .day .dh { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.week .day .dh b { font-size: 14px; color: var(--navy); }
.week .day .sum { font-size: 12px; font-weight: 700; color: var(--navy); }
.week .day .ent { font-size: 11.5px; padding: 5px 7px; border-radius: 7px; background: var(--light); margin-bottom: 4px; cursor: pointer; border-left: 3px solid var(--blue); }
.week .day .ent:hover { background: #dfe9f0; }
.week .day .ent .p { font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .day .ent .d { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .day .abw { font-size: 11px; color: var(--amber); background: var(--amber-bg); border-radius: 6px; padding: 3px 6px; margin-bottom: 4px; }
.week .day .add { border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 7px; width: 100%; padding: 4px; font-size: 11.5px; margin-top: 4px; }
.week .day .add:hover { color: var(--navy); border-color: var(--navy); }
@media (max-width: 900px) { .week { grid-template-columns: repeat(2, 1fr); } }
.pos-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pos-table th { text-align: left; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 8px; background: var(--soft); border-bottom: 1px solid var(--line); }
.pos-table td { padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pos-table tr.titel td { background: var(--soft); }
.pos-table tr.optional td { opacity: .7; }
.pos-table input, .pos-table select, .pos-table textarea { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 7px; border-radius: 6px; font-size: 13.5px; }
.pos-table input:focus, .pos-table select:focus, .pos-table textarea:focus { border-color: var(--cyan); background: #fff; outline: none; }
.pos-table textarea { min-height: 34px; resize: vertical; font-size: 12.5px; color: var(--muted); }
.pos-table .r input { text-align: right; }
.pos-table .betrag { text-align: right; font-weight: 700; color: var(--navy); white-space: nowrap; padding-top: 10px; }
.pos-table .hnd { color: var(--muted); cursor: grab; text-align: center; width: 22px; padding-top: 10px; }
.pos-table .act button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px; }
.pos-table .act button:hover { color: var(--navy); }
.sum-box { margin-left: auto; width: 340px; max-width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.sum-box .row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; }
.sum-box .row.total { border-top: 2px solid var(--navy); margin-top: 6px; padding-top: 8px; font-weight: 700; color: var(--navy); font-size: 15px; }
.doc-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.side-card h4 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.side-card .kv { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 13px; }
.side-card .kv span:nth-child(odd) { color: var(--muted); }
.side-card .kv span:nth-child(even) { text-align: right; color: var(--navy); font-weight: 600; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.timeline .ev { position: relative; margin-bottom: 10px; font-size: 13px; }
.timeline .ev::before { content: ''; position: absolute; left: -20px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); }
.timeline .ev .t { font-size: 11.5px; color: var(--muted); }
.msg-list .msg-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.msg-list .msg-item.intern { background: var(--amber-bg); border-color: #f0dfa5; }
.msg-list .msg-item.extern { border-left: 4px solid var(--cyan); }
.msg-list .msg-item .mh { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 4px; }
.file-list .file { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; font-size: 13px; }
.file-list .file .n { font-weight: 600; color: var(--navy); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.file-list .file .m { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; background: var(--light); color: var(--navy); border-radius: 6px; padding: 1px 7px; font-size: 11.5px; margin-right: 4px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.proj-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; border-top: 4px solid var(--blue); }
.proj-card:hover { box-shadow: var(--shadow); }
.proj-card h3 { font-size: 15px; color: var(--navy); margin-bottom: 2px; }
.proj-card .k { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.proj-card .row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-top: 8px; }
.cal { display: grid; grid-template-columns: 180px repeat(var(--days, 31), minmax(22px, 1fr)); gap: 2px; font-size: 11.5px; overflow-x: auto; }
.cal .hd { text-align: center; color: var(--muted); padding: 4px 0; }
.cal .hd.we { background: var(--soft); border-radius: 4px; }
.cal .nm { padding: 6px 8px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .c { min-height: 26px; border-radius: 4px; background: var(--soft); }
.cal .c.urlaub { background: #cfe9dc; } .cal .c.krank { background: #f6cfc9; } .cal .c.fortbildung { background: #cfe0f5; } .cal .c.feiertag { background: #e6dcf5; } .cal .c.sonstiges { background: #e5e8eb; } .cal .c.beantragt { outline: 2px dashed var(--amber); outline-offset: -2px; }
.stat-strip { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 6px 0 12px; }
.stat-strip b { color: var(--navy); font-size: 15px; }
.portal-hero { background: linear-gradient(120deg, var(--navy), var(--blue)); color: #fff; border-radius: var(--radius); padding: 26px 30px; margin-bottom: 18px; }
.portal-hero h1 { font-size: 24px; margin-bottom: 6px; }
.portal-hero p { opacity: .9; max-width: 720px; }
.field-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mini-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 800px) { .mini-form { grid-template-columns: 1fr 1fr; } }
.kpi.small .kpi-n { font-size: 20px; }
.dtable td.r, .dtable th.r, table.mini td.r, table.mini th.r { text-align: right; }
.dtable td.r, table.mini td.r, .list-row .amount { white-space: nowrap; }
.hint-inline { font-size: 12px; color: var(--muted); }
.warn-box { background: var(--amber-bg); border: 1px solid #f0dfa5; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; color: var(--amber); margin-bottom: 12px; }
.ok-box { background: var(--green-bg); border: 1px solid #c7e6d3; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; color: var(--green); margin-bottom: 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .form-grid.three { grid-template-columns: 1fr; } }
.field .with-ki { display: flex; gap: 6px; align-items: flex-start; }
.field .with-ki textarea { flex: 1; }
.btn.tiny { padding: 3px 8px; font-size: 11.5px; }
.sigpad-wrap { max-width: 720px; }
.status-flow { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 12px; }
.status-flow span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--light); color: var(--muted); }
.status-flow span.done { background: var(--green-bg); color: var(--green); }
.status-flow span.cur { background: var(--navy); color: #fff; }
