/* ZaPhi Manager v0.21.5 · Feinschliff und neue Arbeitsabläufe. */

/* Leistungsstruktur: exakt dieselbe App-Schrift wie die Leistungen und beliebig
   viele Textzeilen; Zähler und Aktionen dürfen den Namen nie überdecken. */
#serviceMasterPane,#serviceMasterPane *,#serviceTree,#serviceTree *{font-family:var(--font-app,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif)!important;font-synthesis:none}
#serviceTree .v203-service-tree-row{display:grid!important;grid-template-columns:24px 34px minmax(0,1fr) 38px!important;grid-template-areas:"toggle code name count" ". . actions actions"!important;height:auto!important;min-height:48px!important;align-items:start!important;row-gap:5px!important;overflow:visible!important}
#serviceTree .v203-tree-name{display:block!important;grid-area:name!important;min-width:0!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;text-overflow:clip!important;white-space:normal!important;word-break:normal!important;overflow-wrap:anywhere!important;hyphens:auto!important;-webkit-line-clamp:unset!important;-webkit-box-orient:initial!important;font-family:inherit!important;font-size:13px!important;font-weight:700!important;line-height:1.3!important;letter-spacing:normal!important}
#serviceTree .v203-tree-name strong,#serviceTable .service-name,#serviceTable .service-name strong{font-family:inherit!important;font-weight:700!important;white-space:normal!important;overflow-wrap:anywhere!important}
#serviceTree .v203-tree-count{grid-area:count!important;align-self:start!important}.v203-tree-actions{grid-area:actions!important;position:static!important;justify-self:end!important;display:flex!important;flex-wrap:wrap!important;gap:4px!important;max-width:100%!important}

/* Briefpapier: innerhalb der Karte scrollen nur die Regler; beide Seiten bleiben
   vollständig und unverrückbar sichtbar. */
@media(min-width:900px){
 .stationery-card{overflow:visible!important}
 .stationery-layout{height:calc(100dvh - 235px)!important;min-height:510px!important;max-height:760px!important;overflow:hidden!important;align-items:stretch!important}
 .stationery-controls{height:100%!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain;padding-right:8px}
 .stationery-preview-wrap{position:sticky!important;top:92px!important;height:100%!important;max-height:none!important;min-height:0!important;overflow:hidden!important;overscroll-behavior:contain;display:flex!important;flex-direction:column!important;align-self:stretch!important}
 .stationery-preview-wrap>.preview-title{flex:0 0 auto}.stationery-preview-wrap>#stationeryPreview{min-height:0;flex:1;display:grid;align-items:start;overflow:hidden}
 .v20-stationery-preview-pages{height:100%!important;min-height:0!important;align-items:start!important}
 .v20-stationery-preview-pages .v20-paper-page{width:auto!important;height:min(calc(100dvh - 286px),650px)!important;max-height:100%!important}
}
@media(max-width:899px){.stationery-layout{height:auto!important;max-height:none!important;overflow:visible!important}.stationery-controls{overflow:visible!important}.stationery-preview-wrap{height:auto!important;overflow:visible!important}}

/* A5 ist in den Einstellungen eine kompakte Postkartenvorschau. */
#v214CardLayoutCard .v214-card-layout-preview{width:min(100%,430px)!important;max-height:305px;margin:14px auto!important;border-radius:8px!important}

/* Unsichtbarer, aber echt gerenderter A4-Messplatz für die Seitenteilung. */
.v215-pagination-measure{position:fixed!important;z-index:-9999!important;left:-20000px!important;top:0!important;width:760px!important;height:auto!important;visibility:hidden!important;pointer-events:none!important;contain:layout style}
.v215-pagination-measure .v20-paper-page{width:760px!important;height:1074.86px!important;max-width:none!important;aspect-ratio:auto!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important}
.v215-pagination-measure .v20-paper-content{overflow:visible!important}

/* Tabellenköpfe stehen exakt über ihren Zahlen. */
.v211-offer-table thead th:nth-child(6),.v211-offer-table thead th:nth-child(7),.v203-invoice-table:not(.v211-offer-table) thead th:nth-child(7),.v203-invoice-table:not(.v211-offer-table) thead th:nth-child(8){text-align:right!important}
.v215-document-case-action{text-align:right;white-space:nowrap}.v215-current-version{display:block!important;margin-top:4px;color:#68737d!important;font-weight:750}.v215-mailto-note span{display:block;margin-top:4px}

/* KVA-Schnellvorlagen wie ein kompakter Dokumenteditor. */
.v215-template-editor{display:grid;grid-template-columns:minmax(250px,.72fr) minmax(360px,1.05fr) minmax(290px,.78fr);gap:13px;align-items:start;min-height:620px}
.v215-template-basics,.v215-template-document,.v215-template-catalog{min-width:0;border:1px solid #dbe1e5;border-radius:12px;background:#fafbfc;padding:12px}
.v215-template-basics{display:grid;gap:10px;max-height:70vh;overflow:auto}.v215-template-basics>label,.v215-template-flags>label{display:grid;gap:4px;font-size:9px;font-weight:800;color:#5d6873}.v215-template-basics textarea{width:100%;resize:vertical;border:1px solid #cad2d8;border-radius:8px;background:#fff;padding:8px;font:11px var(--font-app)}
.v215-template-flags{display:grid;grid-template-columns:1fr 1fr;gap:6px}.v215-template-flags>label:last-child{grid-column:1/-1}.v215-template-flags .checkline{display:flex!important;align-items:center;gap:7px;border:1px solid #d5dce1;border-radius:999px;background:#fff;padding:7px 9px;margin:0}.v215-template-flags .checkline span{font-size:10px;color:#2b343d}
.v215-template-surcharges{display:grid;gap:4px;border:1px solid #d7dde2;border-radius:9px;background:#fff;padding:8px}.v215-template-surcharges .checkline{margin:0;padding:4px 2px}
.v215-template-document{display:grid;gap:10px}.v215-template-document .section-title{align-items:flex-start}.v215-template-blocks{display:grid;gap:6px;max-height:300px;overflow:auto}.v215-template-block{display:grid;grid-template-columns:25px minmax(0,1fr) auto;gap:8px;align-items:center;border:1px solid #d5dce1;border-radius:9px;background:#fff;padding:8px}.v215-template-block.heading{border-left:4px solid #e8771f}.v215-template-block.text{border-left:4px solid #7b8794}.v215-template-block>div:nth-child(2){min-width:0;display:grid}.v215-template-block strong{white-space:normal;overflow-wrap:anywhere;font-size:11px}.v215-template-block small{color:#6b7680;font-size:8px}.v215-template-block label{display:grid;gap:3px;color:#68737d;font-size:8px;font-weight:800}.v215-template-block textarea{width:100%;min-height:34px;resize:vertical;border:1px solid #d1d8dd;border-radius:7px;padding:6px;font:11px var(--font-app)}.v215-template-order{display:grid;place-items:center;width:24px;height:24px;border-radius:999px;background:#edf1f4;color:#5b6671;font-size:9px;font-weight:850}.v215-template-block-actions{display:flex!important;gap:3px}.v215-template-block-actions button{width:28px;height:28px;border:1px solid #d2d9de;border-radius:7px;background:#fff;cursor:pointer}.v215-template-block-actions button:disabled{opacity:.35}.v215-template-block-actions .danger{color:#a8413b}
.v215-template-preview-title{display:flex;justify-content:space-between;align-items:end}.v215-template-preview-title small{color:#6b7680}.v215-template-preview{display:grid;place-items:center;border-radius:9px;background:#e7ebee;padding:12px;max-height:310px;overflow:auto}.v215-mini-paper{width:min(100%,330px);min-height:430px;background:#fff;box-shadow:0 4px 14px rgba(20,31,42,.14);padding:28px 25px;color:#20262d;font-size:7px;line-height:1.38}.v215-mini-paper header{display:flex;justify-content:space-between;border-bottom:1px solid #b9c0c5;padding-bottom:6px;margin-bottom:13px}.v215-mini-paper p{white-space:normal;margin:8px 0}.v215-mini-positions{display:grid;gap:5px;margin:12px 0}.v215-mini-positions h4{margin:7px 0 1px;font-size:9px}.v215-mini-positions>div{display:grid;grid-template-columns:54px 1fr;gap:7px;border-bottom:1px solid #e5e7e9;padding:4px 0}.v215-mini-positions strong{font-size:7px}
.v215-template-catalog{position:sticky;top:0;max-height:70vh;overflow:auto}.v215-template-search{position:sticky;top:-12px;z-index:2;display:grid;gap:5px;background:#fafbfc;padding:12px 0 8px;font-size:10px;font-weight:850}.v215-template-search input{width:100%;border:1px solid #cbd3d9;border-radius:9px;padding:9px}.v215-template-tree>button{display:grid;grid-template-columns:18px minmax(0,1fr) auto;gap:6px;align-items:center;width:100%;border:0;border-bottom:1px solid #e2e6e9;background:transparent;padding:8px 4px;text-align:left;cursor:pointer}.v215-template-tree.sub{margin-left:calc((var(--depth,0) + 1) * 9px)}.v215-template-tree strong{min-width:0;white-space:normal;overflow-wrap:anywhere;font-size:10px}.v215-template-tree small,.v215-template-result-count{color:#6b7680;font-size:8px}.v215-template-service{display:grid;width:100%;border:0;border-bottom:1px solid #e7eaec;background:#fff;padding:8px;text-align:left;cursor:pointer}.v215-template-service:hover{background:#fff4e9}.v215-template-service strong{font-size:10px}.v215-template-service small{font-size:8px;color:#6b7680}.v215-template-actions{position:sticky;bottom:-16px;z-index:3;justify-content:flex-end;margin:12px -16px -16px;padding:10px 16px;border-top:1px solid #dce1e5;background:#fff}

/* Kalkulation: alle abhängigen Werte in einer stabilen Karte. */
.v215-legacy-pricing{display:none!important}.v215-calculation-card{margin-bottom:14px}.v215-calculation-grid{display:grid;grid-template-columns:repeat(4,minmax(145px,1fr));gap:9px;align-items:end}.v215-calculation-grid>label{display:grid;gap:4px;color:#5d6872;font-size:9px;font-weight:800}.v215-calculation-grid input{width:100%;border:1px solid #ced6db;border-radius:8px;padding:9px;font:12px var(--font-app)}.v215-calculation-grid output{display:grid;gap:3px;border:1px solid #d8dee3;border-radius:9px;background:#f5f7f8;padding:8px}.v215-calculation-grid output span{color:#68737d;font-size:8px}.v215-calculation-grid output strong{font-size:15px}.v215-wage-row{grid-template-columns:minmax(170px,1fr) minmax(120px,.55fr) repeat(3,minmax(105px,.5fr)) auto!important}.v215-wage-row output{display:grid;gap:3px;border:1px solid #dce1e5;border-radius:8px;background:#f7f9fa;padding:7px}.v215-wage-row output span{color:#68737d;font-size:8px}.v215-wage-row output strong{font-size:11px}

/* Geführtes Aufmaß. */
.v215-measurement-workflow-settings{display:grid;gap:8px}.v215-workflow-config{display:grid;gap:8px;border:1px solid #d9dfe4;border-radius:10px;background:#f8fafb;padding:10px}.v215-workflow-config>label,.v215-workflow-config .form-grid>label{display:grid;gap:4px;color:#5e6973;font-size:9px;font-weight:800}.v215-workflow-config input{width:100%;border:1px solid #cdd5da;border-radius:8px;background:#fff;padding:8px;font:11px var(--font-app)}.v215-workflow-config input:disabled{opacity:.55;background:#edf0f2}.v215-parking-question{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;border:2px solid #e3a168;border-radius:12px;background:#fff8f1;padding:14px;cursor:pointer}.v215-parking-question input{width:20px;height:20px}.v215-parking-question span{display:grid;gap:4px}.v215-parking-question small{color:#68737d}

@media(max-width:1180px){.v215-template-editor{grid-template-columns:1fr 1fr}.v215-template-catalog{grid-column:1/-1;position:static;max-height:420px}.v215-calculation-grid{grid-template-columns:repeat(2,1fr)}.v215-wage-row{grid-template-columns:1fr 1fr!important}}
@media(max-width:720px){.v215-template-editor{grid-template-columns:1fr}.v215-template-catalog{grid-column:auto}.v215-template-basics{max-height:none}.v215-calculation-grid,.v215-wage-row{grid-template-columns:1fr!important}.v215-template-flags{grid-template-columns:1fr}}
