/* ---------- conQuaesso / contec Look ---------- */
:root {
  --cream: #f4f0e8;
  --paper: #faf8f3;
  --card: #ffffff;
  --navy: #1f3553;
  --navy-soft: #2c466b;
  --gold: #b8862c;
  --gold-strong: #a3751f;
  --gold-light: #e9d9b4;
  --gold-bg: #f7efe0;
  --ink: #33312c;
  --muted: #8b857a;
  --line: #e6dfd0;
  --green: #3d8b5f;
  --green-bg: #e6f2ea;
  --red: #b0503c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 50, 30, .05), 0 6px 24px rgba(60, 50, 30, .06);
  --serif: 'Georgia', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

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

/* ---------- Logo ---------- */
.logo { line-height: 1.1; user-select: none; }
.logo .word { font-family: var(--serif); font-size: 22px; color: var(--navy); letter-spacing: .01em; }
.logo .word sup { font-size: 10px; }
.logo .sub { font-size: 8.5px; letter-spacing: .34em; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.logo.small .word { font-size: 18px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar .who { text-align: right; line-height: 1.25; }
.topbar .who .name { font-weight: 600; color: var(--navy); font-size: 14px; }
.topbar .who .org { font-size: 12px; color: var(--muted); }
.nav-tabs { display: flex; gap: 6px; margin-left: 40px; flex: 1; }
.nav-tabs a {
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px;
  padding: 7px 14px; border-radius: 999px;
}
.nav-tabs a.active { background: var(--navy); color: #fff; }
.nav-tabs a:not(.active):hover { background: #eee7d8; color: var(--navy); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent;
  border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  background: #efe9dc; color: var(--navy); transition: filter .12s;
}
.btn:hover { filter: brightness(.96); }
.btn.gold { background: var(--gold); color: #fff; }
.btn.navy { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: transparent; border-color: #e3c9c0; color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- Chips ---------- */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.entwurf { background: #eee7d8; color: #7c6f52; }
.chip.freigabe { background: #fdeeda; color: #b8730f; }
.chip.versendet { background: #e3ebf5; color: var(--navy); }
.chip.angenommen { background: var(--green-bg); color: var(--green); }
.chip.pflicht { background: var(--green-bg); color: var(--green); font-size: 11px; }
.chip.gold { background: var(--gold-bg); color: var(--gold-strong); }
.chip.intern { background: #e3ebf5; color: var(--navy); }
.chip.extern { background: var(--gold-bg); color: var(--gold-strong); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 40px 38px; width: 400px; max-width: 100%; }
.login-card .logo { text-align: center; margin-bottom: 6px; }
.login-card .claim { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold-light); border-color: var(--gold); }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.demo-hint { margin-top: 22px; background: var(--gold-bg); border: 1px solid var(--gold-light); border-radius: 12px; padding: 13px 15px; font-size: 12.5px; color: #6d5a33; }
.demo-hint b { color: var(--gold-strong); }
.error-box { background: #f8e9e5; color: var(--red); border-radius: 10px; padding: 10px 13px; font-size: 13px; margin-bottom: 14px; }

/* ---------- Seiten-Layout ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 30px 28px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--serif); color: var(--navy); font-size: 25px; font-weight: 600; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

/* ---------- Angebotsliste ---------- */
.offer-list { display: grid; gap: 14px; }
.offer-row {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 22px; display: flex; align-items: center; gap: 18px; cursor: pointer;
  border: 1px solid transparent; transition: border-color .12s;
}
.offer-row:hover { border-color: var(--gold-light); }
.offer-row .grow { flex: 1; min-width: 0; }
.offer-row .titel { font-family: var(--serif); font-size: 17px; color: var(--navy); font-weight: 600; }
.offer-row .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.offer-row .qbadge { background: var(--gold-bg); color: var(--gold-strong); border-radius: 999px; font-size: 12px; font-weight: 600; padding: 3px 10px; }

/* ---------- Tabellen (Benutzer) ---------- */
.table-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.users { width: 100%; border-collapse: collapse; }
table.users th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 13px 20px; border-bottom: 1px solid var(--line); }
table.users td { padding: 13px 20px; border-bottom: 1px solid #f1ece1; font-size: 14px; }
table.users tr:last-child td { border-bottom: none; }

.form-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-top: 20px; }
.form-card h3 { font-family: var(--serif); color: var(--navy); margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Editor ---------- */
.editor-layout { display: grid; grid-template-columns: 270px 1fr; gap: 26px; align-items: start; }
.editor-side { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; position: sticky; top: 84px; }
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-main { order: 1; }
  .editor-side { order: 2; position: static; }
}
.editor-side h2 { font-family: var(--serif); font-size: 18px; color: var(--navy); margin-bottom: 4px; }
.editor-side .hint { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 7px 4px; font-size: 13.5px; color: var(--navy); }
.side-item .lbl { flex: 1; display: flex; align-items: center; gap: 8px; }
.side-item .ico { color: var(--gold); display: inline-flex; }
.side-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 0 4px; }
.side-actions { margin-top: 20px; display: grid; gap: 9px; }
.side-actions .btn { width: 100%; justify-content: center; }
.last-change { margin-top: 16px; font-size: 11.5px; color: var(--muted); }

/* 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: #ddd6c8; 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(--gold); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:disabled + .slider { opacity: .55; cursor: default; }

/* Baustein-Karten */
.block-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; margin-bottom: 14px; }
.block-card.off { opacity: .55; }
.block-head { display: flex; align-items: center; gap: 12px; }
.block-head .ico { color: var(--gold); display: inline-flex; }
.block-head .name { font-weight: 600; color: var(--navy); flex: 1; display: flex; align-items: center; gap: 10px; }
.block-body { margin-top: 13px; padding-top: 13px; border-top: 1px solid #f1ece1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.block-body .variant select { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: #fff; color: var(--navy); font-weight: 500; }
.block-body .spacer { flex: 1; }
.block-preview-text { font-size: 13px; color: var(--muted); width: 100%; }
.edit-form { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 6px; }
.edit-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 700px) { .edit-form .row { grid-template-columns: 1fr; } }
.edit-form textarea { min-height: 80px; resize: vertical; }
.edit-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.add-block { border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; text-align: center; color: var(--muted); background: transparent; width: 100%; font-size: 14px; font-weight: 500; }
.add-block:hover { border-color: var(--gold); color: var(--gold-strong); }

/* Rückfragen-Panel */
.questions-card { background: var(--gold-bg); border: 1px solid var(--gold-light); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px; }
.questions-card h3 { font-family: var(--serif); color: var(--gold-strong); font-size: 16px; margin-bottom: 10px; }
.question-item { background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: 13.5px; }
.question-item .qmeta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---------- Angebots-Dokument (Kundenansicht) ---------- */
.doc-wrap { max-width: 940px; margin: 0 auto; padding: 26px 22px 90px; }
.preview-banner {
  background: var(--navy); color: #fff; border-radius: 12px; padding: 11px 18px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px;
}
.preview-banner a { color: var(--gold-light); font-weight: 600; text-decoration: none; }
.accepted-banner {
  background: var(--green-bg); border: 1px solid #bcdcc8; color: var(--green); border-radius: 12px;
  padding: 13px 18px; margin-bottom: 18px; font-weight: 600; font-size: 14px;
}
.doc { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: 34px 36px 26px; }
@media (max-width: 640px) { .doc { padding: 22px 18px; } }

.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.doc-top .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Cover */
.cover {
  position: relative; overflow: hidden; border-radius: 16px; min-height: 250px;
  background: linear-gradient(115deg, #f4efe6 0%, #efe7d7 55%, #e9dfc9 100%);
  padding: 30px 34px; margin-bottom: 22px;
}
.cover .art { position: absolute; top: 0; right: 0; bottom: 0; width: 46%; pointer-events: none; }
.cover .art .tri1 { position: absolute; inset: 0; background: linear-gradient(135deg, #d9b25f, #b8862c); clip-path: polygon(38% 50%, 100% 0, 100% 100%); opacity: .95; }
.cover .art .tri2 { position: absolute; inset: 0; background: #fdfbf6; clip-path: polygon(36% 50%, 76% 0, 76% 100%); opacity: .5; }
.cover .label { color: var(--gold-strong); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 10px; }
.cover h1 { font-family: var(--serif); font-size: 30px; color: var(--navy); font-weight: 600; line-height: 1.2; white-space: pre-line; max-width: 55%; }
.cover .fuer { margin-top: 14px; font-size: 13px; color: var(--muted); }
.cover .kunde { font-family: var(--serif); font-size: 18px; color: var(--gold-strong); font-weight: 600; margin-top: 2px; }
.cover .ap-label { margin-top: 12px; font-size: 12px; color: var(--muted); }
.cover .ap { color: var(--gold-strong); font-weight: 600; font-size: 14px; }
.cover .contec { position: absolute; right: 26px; bottom: 22px; text-align: left; max-width: 200px; }
.cover .contec .mark { font-family: var(--serif); font-size: 22px; color: var(--navy); font-weight: 600; }
.cover .contec .claim { font-size: 12.5px; color: var(--navy); font-weight: 600; line-height: 1.35; }
.cover .contec .desc { font-size: 10px; color: #6f6a5e; margin-top: 4px; line-height: 1.35; }
@media (max-width: 640px) { .cover h1 { max-width: 100%; font-size: 24px; } .cover .contec { display: none; } }

/* Karten-Raster */
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .doc-grid { grid-template-columns: 1fr; } }
.dcard { background: var(--card); border: 1px solid #eee8db; border-radius: 14px; padding: 20px 22px; }
.dcard.span2 { grid-column: 1 / -1; }
.dcard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dcard-head .ico {
  width: 32px; height: 32px; border-radius: 50%; background: var(--gold-bg); color: var(--gold-strong);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.dcard-head .t { font-weight: 700; color: var(--navy); font-size: 14.5px; flex: 1; }
.dcard p { font-size: 13.5px; color: #55503f; }
.dcard .linklike { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--gold-strong); font-weight: 600; font-size: 13px; text-decoration: underline; background: none; border: none; padding: 0; }

/* Vorgehen / Schritte */
.steps { display: flex; align-items: flex-start; gap: 4px; margin-top: 6px; }
.step { flex: 1; text-align: center; min-width: 0; }
.step .circ {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--gold-light); color: var(--gold-strong);
  display: inline-flex; align-items: center; justify-content: center; background: #fff;
}
.step .num { font-weight: 700; color: var(--gold-strong); font-size: 13px; margin-top: 7px; }
.step .cap { font-size: 11.5px; color: var(--navy); font-weight: 600; line-height: 1.25; }
.step-arrow { color: #cdc4b0; padding-top: 13px; flex: none; }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 4px; }
@media (max-width: 800px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
.member { border: 1px solid #eee8db; border-radius: 12px; overflow: hidden; background: #fff; position: relative; }
.member .photo {
  height: 108px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #dfe5ee, #c6cfdd); font-family: var(--serif);
  font-size: 30px; color: var(--navy); font-weight: 600;
}
.member .badge { position: absolute; top: 8px; left: 8px; background: var(--gold); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.member .info { padding: 11px 12px 12px; }
.member .n { font-weight: 700; color: var(--navy); font-size: 13px; }
.member .r { font-size: 11.5px; color: var(--gold-strong); font-weight: 600; margin-top: 1px; }
.member .d { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.member .contact { display: flex; gap: 14px; margin-top: 9px; color: var(--navy); opacity: .7; }

/* Referenzen */
.ref-list { list-style: none; display: grid; gap: 9px; margin-top: 2px; }
.ref-list li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--navy); font-weight: 500; }
.ref-list .ok { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Honorar */
.fee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
@media (max-width: 640px) { .fee-grid { grid-template-columns: 1fr; } }
.fee-box { border: 1px solid #eee8db; border-radius: 14px; background: var(--paper); padding: 20px; text-align: center; position: relative; }
.fee-box.recommended { border: 1.5px solid var(--gold); background: #fdf8ee; }
.fee-box .rec-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 7px; white-space: nowrap;
}
.fee-box .fname { font-size: 13px; color: var(--navy); font-weight: 600; }
.fee-box .pct { font-family: var(--serif); font-size: 34px; color: var(--gold-strong); font-weight: 700; margin: 6px 0 2px; }
.fee-box .base { font-size: 12px; color: var(--muted); }
.fee-box .min { font-size: 13px; color: var(--navy); font-weight: 600; margin-top: 10px; }

/* Nächster Schritt */
.next-actions { display: flex; gap: 14px; align-items: center; margin-top: 14px; flex-wrap: wrap; }

/* Rechtliches */
.legal-card p { font-size: 12.5px; color: var(--muted); }

.doc-footer { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); padding: 20px 4px 0; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(30, 26, 18, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 18px; padding: 28px; width: 480px; max-width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { font-family: var(--serif); color: var(--navy); font-size: 20px; margin-bottom: 6px; }
.modal .msub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.pick-option { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; cursor: pointer; }
.pick-option.sel { border-color: var(--gold); background: #fdf8ee; }
.pick-option input { accent-color: var(--gold); }
.pick-option .po-t { font-weight: 600; color: var(--navy); font-size: 14px; }
.pick-option .po-s { font-size: 12.5px; color: var(--muted); }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast-msg { background: var(--navy); color: #fff; padding: 11px 20px; 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 (Angebot als PDF) ---------- */
@media print {
  body { background: #fff; }
  .topbar, .no-print, .preview-banner, #toast, #modal-root { display: none !important; }
  .doc-wrap { padding: 0; max-width: none; }
  .doc { box-shadow: none; border-radius: 0; padding: 0; }
  .dcard, .fee-box, .member { break-inside: avoid; }
}
