@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #14211c;
  --muted: #67736e;
  --line: #dde4e0;
  --paper: #ffffff;
  --canvas: #f3f5f2;
  --forest: #123d2f;
  --forest-2: #1e5a46;
  --mint: #d8eee4;
  --lime: #c7e46b;
  --amber: #f6c453;
  --rose: #e96b6b;
  --blue: #4c78d0;
  --shadow: 0 12px 35px rgba(20, 33, 28, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.boot { padding: 48px; color: var(--muted); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { background: var(--forest); color: white; padding: 26px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 28px; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.brand-mark { width: 38px; height: 38px; background: var(--lime); color: var(--forest); border-radius: 11px; display: grid; place-items: center; font-weight: 900; }
.brand strong { display: block; letter-spacing: .08em; }
.brand small { color: #b8cbc3; }
.nav { display: grid; gap: 5px; }
.nav button { color: #d5e1dc; border: 0; background: transparent; text-align: left; padding: 11px 12px; border-radius: 9px; display: flex; gap: 11px; align-items: center; }
.nav button:hover, .nav button.active { color: white; background: rgba(255,255,255,.11); }
.nav .icon { width: 24px; text-align: center; font-size: 18px; line-height: 1; filter: saturate(.85); }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.14); }
.sidebar-foot small { display: block; color: #9fb8ae; margin-bottom: 8px; }
.sidebar-foot strong { display: block; font-size: 13px; }
.logout { border: 0; background: transparent; color: #b8cbc3; padding: 8px 0 0; font-size: 12px; text-decoration: underline; }
.logout:hover { color: white; }

.main { min-width: 0; }
.topbar { height: 76px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); padding: 0 34px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px); }
.crumb { color: var(--muted); font-size: 14px; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--forest); font-weight: 800; }
.content { padding: 32px 34px 60px; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { margin: 0 0 6px; font-size: 29px; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }

.btn { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 9px; padding: 10px 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn:hover { border-color: #abbab3; }
.btn.primary { border-color: var(--forest); background: var(--forest); color: white; }
.btn.primary:hover { background: var(--forest-2); }
.btn.lime { border-color: var(--lime); background: var(--lime); color: var(--forest); }
.btn.danger { color: #9c3030; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.metric { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 20px; box-shadow: 0 3px 14px rgba(20,33,28,.025); }
.metric-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.metric-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--mint); color: var(--forest); display: grid; place-items: center; }
.metric strong { display: block; font-size: 28px; margin-top: 11px; letter-spacing: -.04em; }
.metric small { display: block; color: var(--muted); }
.metric-link { width: 100%; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .16s, border-color .16s, box-shadow .16s; }
.metric-link:hover { transform: translateY(-2px); border-color: #9dbbac; box-shadow: 0 10px 26px rgba(20, 53, 40, .09); }
.metric-link:focus-visible { outline: 3px solid rgba(46, 121, 83, .2); outline-offset: 2px; border-color: var(--forest-2); }
.metric-action { display: block; margin-top: 12px; color: var(--forest-2); font-size: 11px; font-weight: 800; }
.result-count { flex: 0 0 auto; min-width: 96px; padding: 7px 10px; border-radius: 999px; background: var(--mint); color: var(--forest); font-size: 11px; font-weight: 800; text-align: center; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 4px 20px rgba(20,33,28,.035); overflow: hidden; }
.card-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card-head h2, .card-head h3 { font-size: 16px; margin: 0; }
.card-body { padding: 20px; }
.card + .card { margin-top: 18px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; padding: 12px 16px; background: #f8faf8; border-bottom: 1px solid var(--line); }
td { padding: 14px 16px; border-bottom: 1px solid #edf1ef; font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable:hover { background: #f8fbf9; cursor: pointer; }
.primary-text { font-weight: 750; }
.secondary-text { color: var(--muted); font-size: 12px; margin-top: 3px; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 12px; font-weight: 750; padding: 5px 9px; background: #eef2f0; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #88948f; }
.status.review, .status.draft { background: #fff4d9; color: #755209; }
.status.review::before, .status.draft::before { background: var(--amber); }
.status.sent { background: #e9f0ff; color: #264d9b; }
.status.sent::before { background: var(--blue); }
.status.approved, .status.accepted, .status.signed, .status.active { background: #e3f5ec; color: #186243; }
.status.approved::before, .status.accepted::before, .status.signed::before, .status.active::before { background: #28a06d; }
.status.rejected, .status.cancelled { background: #fde9e9; color: #983737; }
.status.rejected::before, .status.cancelled::before { background: var(--rose); }
.status.archived { background: #eef0ef; color: #59645f; }
.status.archived::before { background: #89928e; }
.status.update_site_added, .status.update_site_removed, .status.update_sites, .status.invoice_pending { background: #fff1d6; color: #7a5000; }
.status.update_site_added::before, .status.update_site_removed::before, .status.update_sites::before, .status.invoice_pending::before { background: #d98b00; }
.status.invoiced { background: #e5f2ff; color: #185a88; }
.status.invoiced::before { background: #2586c4; }
.archived-row { background: #fafbfa; color: #6e7873; }
.archived-row .primary-text { text-decoration: line-through; text-decoration-color: #aeb6b2; }
.archived-customers { margin-top: 18px; }
.archive-banner { margin-bottom: 18px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.customer-toolbar .search { min-width: 0; transition: flex-basis .18s ease; }
.customer-toolbar #customer-search { font-size: 14px; transition: border-color .18s ease, box-shadow .18s ease; }
.customer-toolbar #customer-search:focus { border-color: #719082; box-shadow: 0 0 0 3px rgba(41, 89, 67, .11); outline: none; }
.customer-toolbar #group-filter { flex: 0 0 190px; width: 190px; min-width: 0; text-overflow: ellipsis; transition: flex-basis .18s ease, width .18s ease; }
.customer-toolbar:has(#customer-search:focus) #group-filter { flex-basis: 150px; width: 150px; }
.contract-starter { background: linear-gradient(135deg, var(--forest), #245844); color: white; border-radius: 15px; padding: 23px; margin-bottom: 20px; box-shadow: var(--shadow); }
.contract-starter-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 18px; }
.contract-starter .eyebrow { color: var(--lime); font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.contract-starter h2 { margin: 4px 0; font-size: 22px; }
.contract-starter p { margin: 0; color: #c7d8d1; font-size: 13px; }
.starter-hint { border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 7px 10px; color: #dce8e3; font-size: 11px; }
.starter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.starter-grid button { position: relative; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: white; border-radius: 11px; padding: 15px; text-align: left; }
.starter-grid button:hover { background: rgba(255,255,255,.14); }
.starter-grid button.recommended { border-color: var(--lime); background: rgba(199,228,107,.1); }
.starter-grid strong, .starter-grid small { display: block; }
.starter-grid small { color: #c7d8d1; margin-top: 5px; line-height: 1.35; }
.starter-icon { width: 36px; height: 36px; display: grid; place-items: center; background: var(--lime); color: var(--forest); border-radius: 9px; font-size: 11px; font-weight: 900; margin-bottom: 10px; }
.recommended-label { position: absolute; right: 10px; top: 10px; color: var(--lime); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.search { flex: 1; position: relative; }
.search input { width: 100%; padding: 11px 12px 11px 38px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 8px; color: var(--muted); font-size: 20px; }
.toolbar select { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 0 12px; }
.wizard-recipient-list [hidden], .wizard-search-empty[hidden] { display: none !important; }

.task-list { display: grid; gap: 2px; }
.task { padding: 13px 0; border-bottom: 1px solid #edf1ef; display: flex; gap: 11px; }
.task:last-child { border: 0; }
.task-check { width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid #aab7b1; margin-top: 1px; }
.task-title { font-size: 14px; font-weight: 650; }
.task small { color: var(--muted); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { border: 1px solid var(--line); background: white; border-radius: 10px; padding: 15px; text-align: left; }
.quick:hover { border-color: #9bb2a7; background: #f7fbf8; }
.quick span { display: block; font-size: 21px; margin-bottom: 8px; }
.quick strong { font-size: 13px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr); gap: 18px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
.info label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.info strong { font-size: 14px; }
.timeline { position: relative; }
.event { border-left: 2px solid var(--line); padding: 0 0 20px 18px; position: relative; }
.event::before { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--forest-2); left: -5px; top: 4px; }
.event strong { font-size: 13px; display: block; }
.event small { color: var(--muted); }
.summary { background: #f6f9f7; border-radius: 10px; padding: 16px; display: grid; gap: 9px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; }
.summary-row.total { border-top: 1px solid var(--line); padding-top: 10px; font-size: 17px; font-weight: 800; }
.price-source { display: inline-flex; color: #28624a; background: #e8f4ed; border-radius: 6px; padding: 4px 7px; font-size: 11px; font-weight: 700; margin-top: 5px; }
.position-text { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 5px; max-width: 680px; white-space: pre-line; }
.hybrid-offer-overview { margin: 0 0 18px; padding: 18px; border: 1px solid #d8e4de; border-radius: 12px; background: #f8fbf9; }
.hybrid-offer-copy h2 { margin: 4px 0 8px; font-size: 17px; }
.hybrid-offer-copy p { margin: 0 0 11px; color: #40534b; font-size: 12px; line-height: 1.55; }
.hybrid-zone-pricing { break-inside: avoid; page-break-inside: avoid; }
.hybrid-zone-table { width: 100%; margin: 8px 0 0; background: #fff; table-layout: fixed; }
.hybrid-zone-table th, .hybrid-zone-table td { overflow-wrap: anywhere; white-space: normal; }
.hybrid-zone-table th:first-child, .hybrid-zone-table td:first-child { width: 9%; }
.hybrid-zone-table th:nth-child(2), .hybrid-zone-table td:nth-child(2) { width: 40%; }
.hybrid-zone-table th:nth-child(n+3), .hybrid-zone-table td:nth-child(n+3) { width: 17%; }
.hybrid-zone-table th:nth-child(n+3), .hybrid-zone-table td:nth-child(n+3) { text-align: right; white-space: nowrap; }
.hybrid-zone-table th:last-child, .hybrid-zone-table td:last-child { text-align: right; }
.hybrid-zone-descriptions { margin-top: 13px; padding-top: 11px; border-top: 1px solid #dce6e1; }
.hybrid-zone-descriptions > strong { display: block; margin-bottom: 7px; color: #284b3f; font-size: 11px; }
.hybrid-zone-descriptions > div { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px; }
.hybrid-zone-descriptions div div { display: grid; grid-template-columns: 48px 1fr; gap: 7px; color: #40534b; font-size: 10.5px; line-height: 1.4; }
.hybrid-zone-descriptions div div strong { color: #1e5a46; }
.hybrid-offer-terms { margin: 12px 0 0; padding-left: 18px; color: #40534b; font-size: 10.5px; line-height: 1.45; }
.hybrid-offer-terms li { margin: 4px 0; }
.hybrid-billing-note { display: grid; gap: 3px; margin-top: 11px; padding: 10px 12px; border-left: 3px solid #1e5a46; background: #eef5f1; color: #40534b; font-size: 10.5px; line-height: 1.45; }
.hybrid-billing-note strong { color: #1e5a46; }
.billing-lines { display: grid; gap: 4px; margin-top: 8px; }
.billing-lines span { display: block; border-left: 2px solid #bfd4c9; padding-left: 8px; color: #40534a; font-size: 11px; line-height: 1.4; }
.billing-lines strong { color: var(--ink); }
.billing-summary { width: min(480px, 100%); margin: 0 0 18px auto; border: 1px solid #b9d2c6; border-radius: 10px; padding: 15px; background: #f1f8f4; display: grid; gap: 8px; }
.billing-summary-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #d4e3dc; }
.billing-summary-head span { color: var(--muted); font-size: 11px; }
.entity-chip { display: inline-flex; border-radius: 6px; padding: 5px 8px; font-size: 11px; font-weight: 800; background: #e9f0fa; color: #193a62; white-space: nowrap; }
.entity-chip.gmbh { background: #fdeae6; color: #9e2d1d; }
.entity-chip.office { background: #e7f1df; color: #315d18; }
.customer-group + .customer-group { margin-top: 18px; }
.customer-group .eyebrow { display: block; color: var(--forest-2); font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 4px; }
.customer-group .card-head h2 { font-size: 18px; }
.group-stats { color: var(--muted); font-size: 12px; text-align: right; }
.compact-group > summary, .customer-compact > summary { list-style: none; }
.compact-group > summary::-webkit-details-marker, .customer-compact > summary::-webkit-details-marker { display: none; }
.compact-group-summary { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.compact-group-summary::after { content: "›"; color: var(--forest-2); font-size: 24px; transition: transform .18s ease; }
.compact-group[open] > .compact-group-summary { border-bottom: 1px solid var(--line); }
.compact-group[open] > .compact-group-summary::after { transform: rotate(90deg); }
.compact-group-summary > div:first-child { flex: 1; }
.compact-group-summary > div:first-child > strong { font-size: 16px; }
.compact-group-body { padding: 6px 14px 12px; }
.nested-group { margin: 10px 0 4px 22px; box-shadow: none; border-left: 3px solid var(--mint); }
.nested-group + .nested-group { margin-top: 10px; }
.nested-group .compact-group-summary small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.nested-group-empty { color: var(--muted); font-size: 11px; padding: 10px 8px; }
.group-offer-action { margin: 8px 0; padding: 10px 12px; border: 1px dashed #b9c9c1; border-radius: 9px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 11px; background: #fbfcfb; }
.customer-compact { border-bottom: 1px solid #edf1ef; }
.customer-compact:last-child { border-bottom: 0; }
.customer-compact > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 8px; cursor: pointer; }
.customer-compact > summary:hover { background: #f8fbf9; }
.customer-compact-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.customer-compact-name strong, .customer-compact-name small { display: block; }
.customer-compact-name small { color: var(--muted); margin-top: 3px; font-size: 11px; }
.hierarchy-dot { width: 7px; height: 30px; border-radius: 9px; background: var(--forest-2); flex: 0 0 7px; }
.hierarchy-dot.child { margin-left: 17px; background: var(--lime); }
.customer-compact-facts { color: var(--muted); display: flex; gap: 14px; font-size: 11px; white-space: nowrap; }
.customer-compact-body { margin: 0 8px 12px 24px; padding: 13px; background: #f7faf8; border-radius: 9px; display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(200px, 1fr) minmax(180px, .8fr) auto; gap: 14px; align-items: center; }
.customer-compact-body > div > span, .customer-compact-body > div > strong, .customer-compact-body > div > small { display: block; }
.customer-compact-body > div > span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.customer-compact-body > div > strong { font-size: 12px; }
.customer-compact-body > div > small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.hierarchy-indent { float: left; width: 3px; height: 34px; border-radius: 4px; background: var(--forest-2); margin-right: 10px; }
.hierarchy-indent.child { margin-left: 22px; background: var(--lime); position: relative; }
.hierarchy-indent.child::before { content: "↳"; position: absolute; left: -20px; top: 5px; color: var(--muted); }
.hierarchy-path { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hierarchy-path span { color: var(--muted); }
.version-badge { border-radius: 999px; background: var(--forest); color: white; padding: 6px 10px; font-size: 11px; }
.contract-site-list .choice { align-items: center; }
.site-choice-name { flex: 1; min-width: 210px; }
.inline-price { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.inline-price input { width: 135px; border: 1px solid #ccd6d1; border-radius: 8px; padding: 9px; color: var(--ink); }
.price-scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.price-scale.four { grid-template-columns: repeat(4, 1fr); }
.zone-price-editor { display: grid; gap: 8px; margin-top: 6px; }
.zone-price-row { display: grid; grid-template-columns: 74px repeat(3, minmax(110px, 1fr)); gap: 8px; align-items: center; }
.zone-price-row strong { font-size: 12px; color: var(--forest); }
.service-catalog { display: grid; gap: 18px; }
.service-category .card-head { background: linear-gradient(90deg, #f4f8f5, white); }
.service-category .eyebrow { display: block; color: var(--forest-2); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
.category-count { color: var(--muted); font-size: 12px; font-weight: 700; }
.service-category > summary { list-style: none; cursor: pointer; user-select: none; }
.service-category > summary::-webkit-details-marker { display: none; }
.service-category-summary { transition: background .16s; }
.service-category-summary:hover { background: #eef5f1; }
.service-category-meta { display: flex; align-items: center; gap: 14px; }
.collapse-chevron { color: var(--forest-2); font-size: 26px; line-height: 1; transition: transform .18s; }
.service-category[open] .collapse-chevron { transform: rotate(90deg); }
.service-category[open] > summary { border-bottom: 1px solid var(--line); }
.template-help { margin-bottom: 18px; }
.template-editor-layout { display: grid; gap: 18px; padding-bottom: 76px; }
.template-section .eyebrow { display: block; color: var(--forest-2); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
.template-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.template-fields textarea { min-height: 128px; line-height: 1.5; }
.template-fields textarea[readonly] { color: var(--muted); background: #f3f6f4; }
.template-savebar { position: sticky; bottom: 16px; z-index: 3; background: rgba(18, 61, 47, .96); color: white; border-radius: 12px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; box-shadow: 0 12px 30px rgba(18,61,47,.22); }
.template-savebar span { font-size: 12px; color: #dbe8e2; }
.template-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.template-document-card { min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); text-align: left; display: grid; grid-template-columns: 50px 1fr auto; gap: 16px; align-items: start; box-shadow: 0 5px 16px rgba(22, 52, 40, .04); transition: transform .16s, border-color .16s, box-shadow .16s; }
.template-document-card:hover { transform: translateY(-2px); border-color: #9dbbac; box-shadow: var(--shadow); }
.template-document-icon { width: 50px; height: 58px; border-radius: 8px; background: var(--forest); color: white; display: grid; place-items: center; font-size: 22px; }
.template-document-card .eyebrow { display: block; color: var(--forest-2); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 5px; }
.template-document-card strong, .template-document-card small, .template-document-card em { display: block; }
.template-document-card strong { font-size: 16px; }
.template-document-card small { color: var(--muted); line-height: 1.45; margin-top: 6px; }
.template-document-card em { color: var(--forest-2); font-size: 10px; font-style: normal; font-weight: 750; margin-top: 12px; }
.template-open-arrow { align-self: center; color: var(--forest-2); font-size: 11px; font-weight: 750; white-space: nowrap; }
.entity-choice { align-items: center; cursor: default; }
.entity-logo-thumb, .entity-logo-placeholder { width: 62px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 5px; flex: 0 0 62px; }
.entity-logo-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 10px; border-style: dashed; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.wizard-service-categories { display: grid; gap: 4px; }
.wizard-service-category + .wizard-service-category { margin-top: 8px; padding-top: 4px; border-top: 1px solid #edf1ef; }
.alert { border: 1px solid #efd38c; background: #fff8e5; color: #684b0d; border-radius: 9px; padding: 12px 14px; font-size: 13px; }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 20, 15, .54); z-index: 20; display: grid; place-items: center; padding: 24px; }
.modal { width: min(920px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: white; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.modal.narrow { width: min(610px, 100%); }
.modal.document-editor-modal { width: min(1180px, 100%); }
.document-editor-modal .modal-body { background: #e9eeeb; }
.modal-head { padding: 21px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: white; z-index: 2; }
.modal-head h2 { margin: 0; font-size: 20px; }
.close { width: 34px; height: 34px; background: #f0f3f1; border: 0; border-radius: 50%; font-size: 20px; }
.modal-body { padding: 24px; }
.modal-foot { padding: 17px 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; position: sticky; bottom: 0; background: white; }
.steps { display: flex; gap: 5px; margin-bottom: 25px; }
.step { flex: 1; height: 5px; border-radius: 99px; background: #e5eae7; }
.step.active { background: var(--forest-2); }
.step.done { background: var(--lime); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 750; color: #44524c; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #ccd6d1; border-radius: 8px; padding: 10px 11px; background: white; color: var(--ink); }
.field textarea { min-height: 90px; resize: vertical; }
.field small { display: block; color: var(--muted); margin-top: 5px; }
.document-template-copy { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #f8faf8; }
.document-template-copy + .document-template-copy { margin-top: 4px; }
.document-template-copy-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.document-template-copy-head strong { color: var(--forest); font-size: 14px; }
.document-template-copy-head small { margin: 0; text-align: right; }
.document-template-copy label:not(:first-of-type) { margin-top: 16px; }
.document-template-copy textarea { min-height: 112px; line-height: 1.5; }
.document-editor-heading { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.document-editor-heading strong, .document-editor-heading small { display: block; }
.document-editor-heading strong { color: var(--forest); font-size: 14px; }
.document-editor-help { width: min(880px, 100%); margin: 0 auto 18px; }
.document-edit-preview { max-width: 880px; margin: auto; background: white; padding: 42px 54px 58px; min-height: 900px; border: 1px solid #d5ddd9; box-shadow: 0 18px 48px rgba(24, 50, 40, .12); }
.document-edit-preview h1 { font-size: 25px; margin-top: 28px; }
.document-preview-toolbar { margin: -42px -54px 34px; padding: 10px 16px; background: var(--forest); color: white; display: flex; justify-content: space-between; gap: 20px; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.document-preview-toolbar small { color: #c9d9d2; text-transform: none; letter-spacing: 0; }
.document-party-logos.compact { min-height: 105px; }
.document-party-logos.compact .document-logo-img { height: 120px; margin-top: -18px; }
.document-party-logos.compact .document-provider-brand > span { margin-top: -18px; }
.preview-recipient { margin-top: 34px; }
.document-inline-editor { margin: 18px 0; padding: 10px 12px 11px; border: 1px solid #bdd5c8; border-radius: 8px; background: #f3faf6; transition: border-color .15s, box-shadow .15s; }
.document-inline-editor:focus-within { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(46, 121, 83, .12); }
.document-inline-label { display: flex; align-items: baseline; gap: 9px; margin-bottom: 6px; }
.document-inline-label strong { color: var(--forest); font-size: 14px; margin-right: auto; }
.document-inline-label span { color: #4a5b53; font-size: 10px; font-weight: 750; }
.document-inline-label em { color: var(--forest-2); font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .04em; }
.document-inline-editor textarea, .document-position-editor { display: block; width: 100%; min-height: 54px; border: 0; resize: none; overflow: hidden; padding: 3px 0; background: transparent; color: var(--ink); font: inherit; line-height: 1.55; }
.document-inline-editor textarea:focus, .document-position-editor:focus { outline: 0; }
.document-inline-editor small { display: block; color: var(--muted); margin-top: 5px; font-size: 9px; }
.preview-position-table { margin: 28px 0 18px; }
.preview-position-table th:first-child, .preview-position-table td:first-child { width: 48px; }
.preview-position-table th:last-child, .preview-position-table td:last-child { width: 125px; text-align: right; }
.document-position-editor { margin-top: 8px; padding: 8px 9px; border: 1px solid #bdd5c8; border-radius: 7px; background: #f3faf6; font-size: 12px; }
.document-position-editor:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(46, 121, 83, .12); }
.prepared-contract-text { margin-top: 10px; color: var(--muted); font-size: 10px; }
.prepared-contract-text summary, .internal-note summary { cursor: pointer; color: var(--forest-2); font-weight: 750; }
.contract-preview-clauses { margin-top: 35px; }
.contract-preview-clauses .document-inline-editor { margin: 13px 0; }
.fixed-preview-clauses { margin: 16px 0; padding: 14px 16px; border-left: 3px solid #cad8d1; background: #f7f9f8; }
.fixed-preview-clauses h3 { color: var(--forest); font-size: 12px; margin: 12px 0 4px; }
.fixed-preview-clauses p { margin: 0; font-size: 11px; line-height: 1.5; }
.customer-portal-preview { margin-top: 42px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f8; }
.customer-portal-preview > strong, .customer-portal-preview > small { display: block; }
.customer-portal-preview > small { color: var(--muted); margin-top: 4px; }
.preview-attachments { margin-top: 45px; padding-top: 20px; border-top: 1px solid var(--line); }
.preview-attachments h2 { font-size: 17px; }
.internal-note { margin-top: 42px; padding: 13px 15px; border: 1px dashed #b9c6c0; border-radius: 8px; background: #fafbfa; }
.internal-note textarea { width: 100%; min-height: 80px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
.choice-list { display: grid; gap: 9px; }
.choice { border: 1px solid var(--line); border-radius: 10px; padding: 13px; display: flex; gap: 12px; align-items: start; cursor: pointer; }
.choice.selected { border-color: var(--forest-2); background: #f3faf6; }
.choice input { margin-top: 3px; }
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.service-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; }
.service-card:hover, .service-card.selected { border-color: var(--forest-2); background: #f4faf7; }
.service-card small { color: var(--muted); display: block; margin: 4px 0 10px; }
.template-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 22px; }
.template-card { border: 1px solid #b9d2c6; background: #f1f8f4; border-radius: 11px; padding: 14px; text-align: left; color: var(--ink); }
.template-card:hover { border-color: var(--forest-2); background: #e8f5ee; }
.template-card.selected { border: 2px solid var(--forest-2); background: #e3f3ea; padding: 13px; }
.template-card strong, .template-card span, .template-card small { display: block; }
.template-card span { color: var(--muted); font-size: 12px; margin: 5px 0 11px; }
.template-card small { color: var(--forest-2); font-weight: 750; }
.tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; background: #edf2ef; padding: 4px 6px; border-radius: 5px; }
.wizard-position { border: 1px solid var(--line); border-radius: 11px; padding: 15px; margin-bottom: 10px; }
.wizard-position-head { display: flex; justify-content: space-between; }
.fixed-partner { border: 1px solid #bad3c7; background: #eef8f2; border-radius: 11px; padding: 15px; margin: 14px 0 20px; display: grid; gap: 3px; }
.fixed-partner span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.fixed-partner small { color: var(--muted); }
.recipient-type-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0 0 18px; padding: 5px; border-radius: 11px; background: #edf2ef; }
.recipient-type-tabs button { border: 0; border-radius: 8px; padding: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.recipient-type-tabs button.active { background: white; color: var(--forest); box-shadow: 0 2px 8px rgba(20,33,28,.08); }
.disabled-choice { opacity: .55; cursor: not-allowed; }
.recipient-preview { border: 1px solid #b9d2c6; background: #f1f8f4; border-radius: 10px; padding: 13px 15px; margin-bottom: 16px; display: grid; gap: 2px; }
.recipient-preview span, .recipient-label { color: var(--forest-2); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.recipient-preview small { color: var(--muted); }
.customer-choice-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.customer-choice-title span, .section-label { color: var(--muted); font-size: 11px; font-weight: 750; }
.section-label { text-transform: uppercase; letter-spacing: .07em; margin: 20px 0 9px; }
.text-editor { border: 1px dashed #b8c6bf; border-radius: 9px; padding: 11px; }
.text-editor summary { cursor: pointer; color: var(--forest-2); font-size: 12px; font-weight: 800; }
.text-editor[open] summary { margin-bottom: 11px; }
.text-editor textarea { margin-top: 5px; }
.readonly-hint { background: #f3f6f4; border: 1px solid var(--line); border-radius: 8px; padding: 11px; font-size: 12px; color: var(--forest); }
.wizard-lead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.wizard-lead strong, .wizard-lead span { border-radius: 999px; padding: 7px 10px; background: #edf2ef; font-size: 11px; }
.wizard-lead strong { background: var(--forest); color: white; }
.addon-list { display: grid; gap: 12px; }
.addon-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.addon-toggle { display: flex; gap: 12px; align-items: center; padding: 15px 17px; background: #f8faf8; cursor: pointer; }
.addon-toggle span, .addon-toggle strong, .addon-toggle small { display: block; }
.addon-toggle small { color: var(--muted); margin-top: 3px; }
.addon-toggle span { flex: 1; }
.addon-toggle b { border-radius: 999px; padding: 5px 8px; background: #e9eeeb; color: var(--muted); font-size: 10px; }
.addon-card.enabled .addon-toggle { background: #edf8f1; }
.addon-card.enabled .addon-toggle b { background: var(--forest); color: white; }
.addon-config { padding: 16px 17px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; border-top: 1px solid var(--line); }
.addon-card:not(.enabled) .addon-config { display: none; }
.site-pill-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.site-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; font-size: 12px; cursor: pointer; }
.site-pill:has(input:checked) { border-color: var(--forest-2); background: #eaf5ef; color: var(--forest); }
.site-breakdown { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.site-breakdown span { background: #edf2ef; border-radius: 5px; padding: 3px 6px; color: var(--muted); font-size: 10px; font-weight: 650; }
.archived-sites { margin: 0 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #f6f7f6; }
.archived-sites > strong { display: block; font-size: 12px; margin-bottom: 8px; }
.archived-sites > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; border-top: 1px solid #e4e8e6; }
.archived-sites span { font-size: 12px; }
.archived-sites small { color: var(--muted); }
.switch-row { display: flex !important; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--ink) !important; }
.switch-row input { width: auto !important; }
.signature-pad { border: 1px dashed #93a59c; border-radius: 9px; width: 100%; height: 170px; touch-action: none; background: #fbfcfb; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { border: 0; background: transparent; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--forest); border-color: var(--forest); font-weight: 750; }
.document { max-width: 820px; margin: auto; background: white; padding: 54px 64px; min-height: 900px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.document h1 { font-size: 25px; }
.document-logo { color: var(--forest); font-weight: 900; letter-spacing: .12em; }
.document-logo-img { width: 190px; height: 165px; object-fit: contain; object-position: left top; margin-top: -24px; }
.document-provider-brand { width: 250px; display: grid; align-content: start; }
.document-provider-brand > span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; margin-top: -22px; }
.document-provider-brand > strong { font-size: 12px; color: var(--forest); margin-top: 2px; }
.customer-logo-editor { display: flex; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 13px; background: #f8faf8; }
.customer-logo-frame, .document-customer-logo { width: 160px; height: 80px; flex: 0 0 160px; border: 1px dashed #b8c6bf; border-radius: 8px; background: white; display: grid; place-items: center; padding: 8px; color: var(--muted); font-size: 11px; text-align: center; }
.customer-logo-frame img, .document-customer-logo img { width: 100%; height: 100%; object-fit: contain; }
.customer-logo-editor small { display: block; margin: 7px 0; }
.contract-start-box { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf8; }
.document-party-logos { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; min-height: 150px; }
.contract-clauses { margin-top: 30px; }
.contract-clauses h2 { font-size: 16px; margin: 22px 0 7px; }
.contract-clauses h3 { font-size: 13px; margin: 16px 0 5px; color: var(--forest); }
.contract-clauses p, .contract-clauses li { font-size: 12px; line-height: 1.55; }
.service-clause { padding-left: 12px; border-left: 2px solid #cfddd6; }
.document-text-block { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #f8faf8; }
.document-text-block small { display: block; margin: 8px 0 4px; color: var(--muted); }
.entity-notice { display: inline-block; margin: 4px 0 18px; padding: 8px 10px; border-left: 3px solid #c22113; background: #fbf3f1; font-size: 12px; color: #59332d; }
.document-address { text-align: right; color: var(--muted); font-size: 12px; margin-top: -58px; }
.document-recipient { color: var(--muted); font-size: 12px; margin-top: 65px; }
.document table { margin: 30px 0; }
.document td, .document th { padding: 10px; }
.document-sign { margin-top: 65px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.sign-party { min-height: 70px; display: flex; flex-direction: column; justify-content: flex-end; }
.signature-image { display: block; width: 170px; height: 64px; object-fit: contain; object-position: left bottom; margin: 0 0 -1px 8px; }
.signature-preview img { object-fit: contain; max-height: 92px; }
.document-attachments li, .preview-attachments li { margin-bottom: 8px; }
.document-attachments a, .preview-attachments a { color: #173f36; font-weight: 700; }
.attachment-ready, .attachment-missing { display: block; margin-top: 2px; font-size: 11px; }
.attachment-ready { color: #347562; }
.attachment-missing { color: #9b5d32; }
.site-service-matrix th, .site-service-matrix td { font-size: 10px; }
.site-service-matrix .matrix-check { text-align: center; font-size: 18px; font-weight: 800; color: var(--forest); }
.site-sizing-list { display: grid; gap: 10px; }
.offer-site-size-list { display: grid; gap: 8px; }
.offer-site-size-row { display: grid; grid-template-columns: minmax(260px, 1fr) 180px; gap: 14px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.site-sizing-row { display: grid; grid-template-columns: minmax(230px, 1.3fr) repeat(3, minmax(130px, .6fr)); gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.site-sizing-select { align-self: center; display: flex; align-items: center; gap: 10px; }
.site-sizing-select span, .site-sizing-select small { display: block; }
.site-sizing-select small { color: var(--muted); margin-top: 3px; }
.wizard-recipient-search { margin: 10px 0; }
.wizard-recipient-list { max-height: 420px; overflow: auto; }
.wizard-master-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.wizard-master-actions > span { margin-right: auto; color: var(--muted); font-size: 12px; font-weight: 650; }
.wizard-quick-form { margin-top: 12px; padding: 16px; border: 1px solid #bfd4c9; border-radius: 10px; background: #f4f8f6; }
.wizard-quick-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.organization-tree-card { margin-bottom: 18px; }
.organization-tree-card > summary { cursor: pointer; list-style: none; }
.organization-tree-card > summary::-webkit-details-marker { display: none; }
.organization-tree-card[open] .collapse-chevron { transform: rotate(90deg); }
.organization-tree { display: grid; gap: 8px; }
.organization-group-node, .organization-company-node { margin-left: calc(var(--tree-depth, 0) * 18px); }
.organization-group-node > summary, .organization-company-node > summary { display: grid; grid-template-columns: 24px minmax(220px, 1fr) auto; gap: 8px; align-items: center; min-height: 38px; padding: 7px 10px; border-radius: 8px; cursor: pointer; list-style: none; }
.organization-group-node > summary::-webkit-details-marker, .organization-company-node > summary::-webkit-details-marker { display: none; }
.organization-group-node > summary { background: #edf4f0; }
.organization-company-node > summary { background: #fafcfb; border: 1px solid var(--line); }
.organization-group-node summary small, .organization-company-node summary small { color: var(--muted); text-align: right; }
.tree-node-mark { color: var(--forest); font-weight: 800; text-align: center; }
.organization-group-body, .organization-company-body { display: grid; gap: 7px; padding: 8px 0 4px 24px; border-left: 1px solid #cbd9d2; margin-left: 11px; }
.organization-group-body > .btn, .organization-company-body > .btn { justify-self: start; }
.organization-site-list { display: grid; gap: 4px; margin: 2px 0 4px 8px; }
.organization-site-list span { display: flex; align-items: center; gap: 7px; color: #40534a; font-size: 11px; }
.organization-site-list i { width: 7px; height: 7px; border-radius: 50%; background: #8eaa9d; }
.organization-site-list small { color: var(--muted); }
.group-management { display: flex; justify-content: flex-end; margin-bottom: 8px; }
@media (max-width: 1050px) { .site-sizing-row { grid-template-columns: 1fr 1fr; } .offer-site-size-row { grid-template-columns: 1fr; } }
.document-footer { margin-top: 42px; padding-top: 12px; border-top: 1px solid #cfd6d2; color: var(--muted); font-size: 9px; line-height: 1.4; }
.document-footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 14px; }
.document-footer-grid strong, .document-footer-grid span { display: block; }
.document-footer-grid strong { color: #36433d; margin-bottom: 3px; font-size: 9px; }
.document-footer-note { margin-top: 9px; padding-top: 7px; border-top: 1px solid #e5e9e7; white-space: pre-line; }
.document-list { display: grid; gap: 8px; }
.document-list .choice { text-decoration: none; color: inherit; justify-content: space-between; }
.import-summary { grid-template-columns: repeat(4, 1fr); }
.import-review-section { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; overflow: hidden; background: white; }
.import-review-section > summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; background: #f7f9f8; }
.import-review-section > summary span { color: var(--muted); font-size: 12px; }
.import-question { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(230px, .8fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.import-question small { display: block; color: var(--muted); margin-top: 4px; }
.import-question.conflict { background: #fff9ee; }
.import-confirm { display: flex; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; }
@media (max-width: 900px) { .import-summary { grid-template-columns: repeat(2, 1fr); } .import-question { grid-template-columns: 1fr; } }
.sign-line { border-top: 1px solid var(--ink); padding-top: 6px; color: var(--muted); font-size: 11px; }
.document-summary { max-width: 340px; margin-left: auto; }
.document-validity { margin-top: 40px; }
.document-closing { margin-top: 28px; font-size: 12px; line-height: 1.55; }
.document-attachments { margin-top: 55px; border-top: 1px solid var(--line); padding-top: 18px; break-before: page; }
.document-attachments h2 { font-size: 17px; }
.document-attachments li { margin: 7px 0; }
.attachment-note { color: var(--muted); font-size: 11px; }

/* Einheitliches Angebots- und Vertragslayout */
.document { font-family: "Inter", sans-serif; color: #19332b; line-height: 1.48; }
.document h1, .document h2, .document h3, .document p { orphans: 3; widows: 3; }
.document h1, .document h2, .document h3 { break-after: avoid; page-break-after: avoid; }
.document-content { padding: 22px 54px 10px; }
.document-kicker { color: #1e5a46; font-size: 9px; font-weight: 780; letter-spacing: .15em; text-transform: uppercase; }
.document-introduction { max-width: 670px; margin: 20px 0 27px; color: #40534b; font-size: 11.5px; }
.offer-document-header { display: flex; min-height: 72px; justify-content: space-between; align-items: flex-start; gap: 28px; padding-bottom: 10px; border-bottom: 1px solid #d8e1dc; }
.offer-document-header .document-logo-img { width: 205px; height: 60px; margin: 0; object-position: left center; }
.offer-document-header .document-provider-brand { width: 250px; }
.offer-document-header .document-customer-logo { width: 150px; height: 72px; flex-basis: 150px; border: 0; padding: 0; }
.offer-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: end; margin: 18px 0 14px; }
.offer-heading .document-kicker { grid-column: 1 / -1; }
.offer-heading h1 { margin: 5px 0 0; font-size: 27px; line-height: 1.1; letter-spacing: -.035em; }
.offer-heading > strong { color: #61716a; font-size: 12px; font-weight: 650; white-space: nowrap; }
.offer-meta { display: grid; grid-template-columns: 1.7fr .75fr .75fr; gap: 18px; padding: 14px 0; border-top: 1px solid #e5ebe8; border-bottom: 1px solid #e5ebe8; }
.offer-meta span, .offer-meta strong, .offer-meta small { display: block; }
.offer-meta span { margin-bottom: 4px; color: #6c7b74; font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.offer-meta strong { font-size: 10.5px; }
.offer-meta small { margin-top: 2px; color: #61716a; font-size: 9px; }
.offer-services h2 { margin: 0 0 11px; font-size: 15px; }
.offer-document .document-introduction { margin: 14px 0 18px; }
.offer-document .document-closing { margin-bottom: 18px; }
.offer-document .document-sign { margin-top: 14px; }
.document .table-wrap { width: 100%; overflow: visible; }
.document table { width: 100%; max-width: 100%; margin: 12px 0 16px; border-collapse: collapse; table-layout: fixed; }
.document thead { display: table-header-group; }
.document tr { break-inside: avoid; page-break-inside: avoid; }
.document th { background: #edf4f0; color: #27473d; font-size: 8.5px; font-weight: 750; letter-spacing: .02em; text-align: left; }
.document td { color: #31483f; font-size: 9px; vertical-align: top; }
.document th, .document td { padding: 8px 7px; border-bottom: 1px solid #dfe7e3; overflow-wrap: anywhere; word-break: normal; white-space: normal; }
.document th:last-child, .document td:last-child { text-align: right; white-space: nowrap; }
.document-position-table th:nth-child(1), .document-position-table td:nth-child(1) { width: 6%; }
.document-position-table th:nth-child(2), .document-position-table td:nth-child(2) { width: 26%; }
.document-position-table th:nth-child(3), .document-position-table td:nth-child(3) { width: 50%; }
.document-position-table th:nth-child(4), .document-position-table td:nth-child(4) { width: 18%; }
.document .hybrid-zone-table th:first-child, .document .hybrid-zone-table td:first-child { width: 9%; }
.document .hybrid-zone-table th:nth-child(2), .document .hybrid-zone-table td:nth-child(2) { width: 40%; }
.document .hybrid-zone-table th:nth-child(n+3), .document .hybrid-zone-table td:nth-child(n+3) { width: 17%; }
.document .site-service-matrix th:first-child, .document .site-service-matrix td:first-child { width: 25%; }
.document .site-service-matrix th:nth-child(2), .document .site-service-matrix td:nth-child(2) { width: 15%; }
.document .site-service-matrix th:last-child, .document .site-service-matrix td:last-child { width: 18%; }
.position-table-block, .clause-block, .service-clause, .keep-heading { break-inside: auto; }
.document-position-table tbody tr { break-inside: avoid; }
.financial-summary, .document-closing-section, .offer-final, .contract-partners { break-inside: avoid; page-break-inside: avoid; }
.financial-summary { margin: 8px 0 12px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(235px, .85fr); gap: 14px; align-items: end; }
.financial-summary .billing-summary, .financial-summary .document-summary { width: 100%; max-width: none; margin: 0; }
.document-summary { width: 100%; max-width: 360px; }
.document-validity, .document-closing { color: #40534b; font-size: 10.5px; line-height: 1.55; }
.document-validity { margin-top: 14px; }
.document-closing { margin: 0 0 32px; }
.document-sign { margin-top: 24px; gap: 44px; }
.signature-image { width: 155px; height: 54px; }
.sign-line { font-size: 9px; }
.document-footer { margin: 28px 54px 0; }

.contract-cover { min-height: 900px; padding: 36px 58px 42px; display: flex; flex-direction: column; background: linear-gradient(145deg, #fff 0%, #fff 58%, #eff5f1 100%); break-after: page; page-break-after: always; }
.cover-brand img { width: 240px; height: 98px; object-fit: contain; object-position: left center; }
.cover-title { margin: 85px 0 62px; max-width: 650px; }
.cover-title > span { color: #1e5a46; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.cover-title h1 { margin: 10px 0 16px; font-size: 35px; font-weight: 560; line-height: 1.13; letter-spacing: -.035em; }
.cover-title > strong { color: #61716a; font-size: 13px; font-weight: 620; }
.cover-parties { display: grid; grid-template-columns: 50px 1fr 42px 1fr; gap: 13px; align-items: center; padding: 22px 0; border-top: 1px solid #d6e0db; border-bottom: 1px solid #d6e0db; }
.cover-parties > span { color: #78877f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.cover-party { min-width: 0; }
.cover-party > img, .cover-party .document-customer-logo { display: block; width: 150px; height: 58px; object-fit: contain; object-position: left center; border: 0; padding: 0; margin-bottom: 8px; }
.cover-party strong, .cover-party small { display: block; }
.cover-party strong { font-size: 10.5px; }
.cover-party small { color: #6a7a72; font-size: 8px; margin-top: 2px; }
.cover-name-mark { min-height: 58px; display: flex; align-items: center; color: #1e5a46; font-size: 17px; font-weight: 680; line-height: 1.15; }
.cover-meta { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.cover-meta span, .cover-meta strong { display: block; }
.cover-meta span { color: #738078; font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.cover-meta strong { margin-top: 4px; font-size: 10px; }
.contract-body { padding-top: 16px; }
.contract-partners h2 { margin: 4px 0 15px; font-size: 19px; }
.partner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.partner-grid article { padding: 16px; border: 1px solid #d9e3de; background: #f8faf9; border-radius: 6px; }
.partner-grid article > span, .partner-grid article > strong, .partner-grid article > small { display: block; }
.partner-grid article > span { color: #1e5a46; font-size: 8px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.partner-grid article > strong { margin-top: 6px; font-size: 11px; }
.partner-grid article p { margin: 5px 0; color: #50615a; font-size: 9px; }
.partner-grid article small { color: #6a7972; font-size: 8px; }
.contract-clauses { margin-top: 24px; }
.contract-clauses h2 { margin: 21px 0 6px; color: #19332b; font-size: 14px; }
.contract-clauses h3 { margin: 14px 0 5px; font-size: 11px; }
.contract-clauses p, .contract-clauses li { margin-top: 0; color: #3d5149; font-size: 9.6px; line-height: 1.58; }
.service-clause { padding-left: 11px; border-left-color: #a9c6b8; break-inside: avoid; }
.compensation-section { break-before: auto; }
.compensation-copy { break-inside: avoid; }
.annex-preview { margin-top: 34px; padding: 17px; border: 1px solid #d9e3de; background: #f7faf8; break-inside: avoid; }
.annex-preview h2 { margin: 0 0 8px; font-size: 14px; }
.annex-preview li, .annex-preview p { color: #50615a; font-size: 9px; }

@media print {
  .document { font-family: "Inter", sans-serif !important; }
  .document-content { padding: 2mm 17mm 0; }
  .document .hybrid-offer-overview { padding: 0; border: 0; background: transparent; }
  .document .hybrid-zone-pricing { break-before: page; page-break-before: always; break-inside: avoid; page-break-inside: avoid; }
  .document table { width: 100% !important; max-width: 100% !important; table-layout: fixed !important; }
  .document .table-wrap { overflow: visible !important; }
  .document th, .document td { overflow-wrap: anywhere !important; white-space: normal; }
  .document th:last-child, .document td:last-child { white-space: nowrap; }
  .document .hybrid-zone-table { break-inside: auto; page-break-inside: auto; }
  .document .hybrid-zone-table thead { display: table-header-group; }
  .document .hybrid-zone-table tr { break-inside: avoid; page-break-inside: avoid; }
  .contract-cover { min-height: 251mm; height: 251mm; padding: 8mm 17mm 10mm; }
  .contract-body { padding-top: 4mm; }
  .offer-document-header .document-logo-img { width: 53mm; height: 15mm; }
  .cover-brand img { width: 62mm; height: 25mm; }
  .cover-title { margin-top: 24mm; margin-bottom: 17mm; }
  .document-footer { display: none !important; }
  .annex-preview { display: none !important; }
}
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; background: var(--forest); color: white; border-radius: 9px; padding: 12px 17px; box-shadow: var(--shadow); transform: translateY(90px); opacity: 0; transition: .2s; }
.toast.show { transform: translateY(0); opacity: 1; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(460px, .95fr); background: white; }
.login-panel { background: var(--forest); color: white; padding: 58px clamp(44px, 7vw, 110px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-panel::after { content: ""; position: absolute; width: 460px; height: 460px; border: 80px solid rgba(199,228,107,.08); border-radius: 50%; right: -210px; bottom: -200px; }
.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-logo { width: 68px; height: 68px; object-fit: contain; }
.login-brand strong { display: block; letter-spacing: .1em; font-size: 19px; }
.login-brand span { color: #b8cbc3; font-size: 13px; }
.login-panel .eyebrow { color: var(--lime); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.login-panel h1 { font-size: clamp(42px, 5vw, 67px); line-height: 1.02; letter-spacing: -.055em; margin: 18px 0; max-width: 700px; }
.login-panel p { color: #c4d3cd; max-width: 500px; font-size: 18px; line-height: 1.55; }
.login-note { color: #91aaa0; font-size: 13px; position: relative; z-index: 1; }
.login-card { display: grid; place-items: center; padding: 40px; background: #f8faf8; }
.login-card form { width: min(410px, 100%); background: white; border: 1px solid var(--line); border-radius: 16px; padding: 34px; box-shadow: var(--shadow); }
.login-card h2 { font-size: 27px; letter-spacing: -.03em; margin: 0 0 7px; }
.login-card form > p { color: var(--muted); margin: 0 0 25px; }
.login-card .field { margin-bottom: 16px; }
.login-submit { width: 100%; margin-top: 5px; padding: 12px; }
.login-help { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.login-help code { color: var(--forest); background: var(--mint); padding: 2px 4px; border-radius: 4px; }
.customer-offer-page { min-height: 100vh; background: #eef2ef; padding-bottom: 70px; }
.customer-offer-head { height: 86px; background: var(--forest); color: white; display: flex; align-items: center; gap: 12px; padding: 0 max(24px, calc((100vw - 960px) / 2)); }
.customer-offer-head img { width: 52px; height: 52px; }
.customer-offer-head strong, .customer-offer-head span { display: block; }
.customer-offer-head strong { letter-spacing: .09em; }
.customer-offer-head span { color: #b8cbc3; font-size: 12px; }
.customer-offer-document { max-width: 960px; margin: 35px auto; background: white; border: 1px solid var(--line); border-radius: 15px; padding: clamp(25px, 5vw, 60px); box-shadow: var(--shadow); }
.customer-offer-document h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -.045em; margin: 42px 0 14px; }
.customer-offer-document .recipient-label { margin-top: 36px; }
.customer-offer-document .recipient-label + h1 { margin-top: 8px; }
.customer-offer-document > p { color: var(--muted); max-width: 680px; margin-bottom: 30px; }
.customer-offer-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.customer-offer-meta span, .customer-offer-meta strong { display: block; }
.customer-offer-meta span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.customer-decision { margin-top: 35px; padding-top: 28px; border-top: 1px solid var(--line); }
.customer-decision h2 { margin-top: 0; }
.customer-decision .actions { justify-content: flex-end; margin-top: 16px; }
.customer-decision > small { display: block; text-align: right; color: var(--muted); margin-top: 12px; }
.decision-result { margin-top: 30px; border-radius: 10px; padding: 20px; display: grid; gap: 5px; }
.decision-result.accepted { background: #e3f5ec; color: #186243; }
.decision-result.rejected { background: #fde9e9; color: #983737; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 76px 1fr; }
  .sidebar { padding: 22px 12px; }
  .brand > div:last-child, .nav button span:last-child, .sidebar-foot { display: none; }
  .brand { padding-left: 7px; }
  .nav button { justify-content: center; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .detail-grid { grid-template-columns: 1fr; }
  .customer-compact-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .shell { display: block; }
  .sidebar { height: auto; position: static; padding: 10px 14px; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .sidebar-foot { display: none; }
  .nav { display: flex; }
  .nav button { white-space: nowrap; }
  .topbar { padding: 0 18px; }
  .content { padding: 24px 16px 50px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .page-head { align-items: start; flex-direction: column; }
  .form-grid, .service-grid, .info-grid, .template-strip, .addon-config, .price-scale.four, .template-fields { grid-template-columns: 1fr; }
  .zone-price-row { grid-template-columns: 1fr; }
  .template-document-grid { grid-template-columns: 1fr; }
  .template-document-card { grid-template-columns: 44px 1fr; }
  .template-open-arrow { grid-column: 2; justify-self: start; }
  .compact-group-summary, .customer-compact > summary { align-items: start; }
  .group-stats, .customer-compact-facts { display: none; }
  .customer-compact-body { grid-template-columns: 1fr; margin-left: 8px; }
  .recipient-type-tabs { grid-template-columns: 1fr; }
  .group-offer-action { align-items: stretch; flex-direction: column; }
  .starter-grid { grid-template-columns: 1fr; }
  .contract-starter-head { display: block; }
  .starter-hint { display: inline-block; margin-top: 12px; }
  .customer-toolbar { flex-direction: column; }
  .customer-toolbar .search, .customer-toolbar #group-filter,
  .customer-toolbar:has(#customer-search:focus) #group-filter { width: 100%; max-width: none; flex-basis: auto; }
  .customer-toolbar #group-filter { min-height: 42px; }
  .contract-site-list .choice { align-items: stretch; flex-wrap: wrap; }
  .site-choice-name { min-width: calc(100% - 36px); }
  .inline-price { width: 100%; }
  .inline-price input { width: 100%; }
  .document { padding: 30px 24px; }
  .modal-backdrop { padding: 0; }
  .modal.document-editor-modal { max-height: 100vh; border-radius: 0; }
  .document-editor-modal .modal-body { padding: 14px; }
  .document-edit-preview { padding: 28px 18px 40px; }
  .document-preview-toolbar { margin: -28px -18px 26px; }
  .document-inline-label { align-items: start; flex-wrap: wrap; }
  .document-inline-label strong { width: 100%; }
  .preview-position-table th:first-child, .preview-position-table td:first-child { display: none; }
  .login-page { display: block; background: #f8faf8; }
  .login-panel { min-height: 290px; padding: 30px 25px; }
  .login-panel h1 { font-size: 37px; margin: 35px 0 10px; }
  .login-panel p, .login-note { display: none; }
  .login-card { padding: 24px 16px; }
  .login-card form { padding: 25px; margin-top: -55px; position: relative; z-index: 2; }
  .customer-offer-document { margin: 18px 12px; }
  .customer-offer-meta { grid-template-columns: 1fr; }
}

@media print {
  body { background: white; }
  .sidebar, .topbar, .page-head, .no-print, .toast { display: none !important; }
  .shell, .main, .content { display: block; padding: 0; margin: 0; }
  .card { border: 0; box-shadow: none; }
  .document { border: 0; box-shadow: none; padding: 20mm 18mm; max-width: none; }
}
