/* Shared workspace treatment, following the work-planning hierarchy. */
body .view{font-size:13px;line-height:1.55;min-width:0;color:var(--text)}
body :is(#rohleads-content,#termine-content,#kunden-content,#zahlungen-content,#users-content,#motivation-content,#callcenter-content,#finanzen-content){max-width:1440px;margin-inline:auto;min-width:0}
body .view :is(h1,h2,h3,h4){font-family:var(--app-font);line-height:1.4;overflow-wrap:anywhere}
body .view :is(.detail-btn,.btn-flat,.cc-range-btn,.cc-datum,.zg-toggle,.zg-btn){font:500 12px/1.4 var(--app-font);min-height:38px;border-radius:var(--radius);box-shadow:none}
body .view :is(.cc-kpi-v,.zahlungen-stat-value,.kpi-stat-value){font-variant-numeric:tabular-nums;font-weight:500;letter-spacing:-.3px;line-height:1.35;overflow-wrap:anywhere}
body .view :is(.cc-karte,.zahlungen-table-wrap,.chart-card){border-radius:var(--radius);box-shadow:none;background:var(--card)}
body .view table :is(th,td){vertical-align:top;line-height:1.5}
body .view table th{font-weight:500;font-size:10px;letter-spacing:.035em;color:var(--muted)}
body .view table td{font-size:12px;font-variant-numeric:tabular-nums}
body .workspace-table-wrap{overflow-x:auto!important;max-width:100%;border-radius:var(--radius) !important}
body .workspace-table-wrap table{min-width:640px}
body .customer-kpis{gap:0!important;border-block:1px solid var(--border);padding:22px 0;margin-bottom:28px!important}
body .customer-kpis>div{background:transparent!important;text-align:left!important;border-radius:0!important;border-left:1px solid var(--border);padding:0 22px!important;color:var(--text)!important;min-width:0}
body .customer-kpis>div:first-child{border-left:0;padding-left:0!important}
body .customer-kpis>div>div:first-child{font-size:clamp(25px,2.2vw,32px)!important;font-weight:500!important;font-variant-numeric:tabular-nums;letter-spacing:-.5px;line-height:1.35;overflow-wrap:anywhere}
body .customer-kpis>div>div:not(:first-child){font-weight:400!important;color:var(--muted)!important;opacity:1!important}
body .customer-breakdown>div{background:transparent!important;border:0!important;border-bottom:1px solid var(--border)!important;border-radius:0!important;padding:8px 0 22px!important}
body .customer-month-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:baseline;gap:8px;padding:.4rem 0;border-bottom:1px solid var(--border);font-size:.85rem;font-variant-numeric:tabular-nums;}
body .customer-month-label,body .customer-month-count{color:var(--muted);white-space:nowrap;}
body .customer-month-count{text-align:center;}
body .customer-month-value{text-align:right;white-space:nowrap;}
body .customer-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr))!important;gap:16px!important}
body .customer-grid>div{padding:20px!important;box-shadow:none!important;border:1px solid var(--border)!important;border-radius:var(--radius) !important;background:var(--card)!important;min-width:0}
body .customer-grid>div:hover{border-color:var(--border-strong)!important;transform:none!important}
body .customer-grid>div>div[style*="position:absolute"]{display:none}
body .customer-grid>div>div:nth-child(2){flex-wrap:wrap;gap:12px!important}
body .customer-grid>div>div:nth-child(2)>div:first-child{background:var(--primary-light)!important;color:var(--primary)!important;width:38px!important;height:38px!important;flex-basis:38px!important;border-radius:var(--radius) !important;font-size:14px!important;font-weight:550!important}
body .customer-grid>div>div:nth-child(2)>div:nth-child(2){min-width:120px;flex:1}
body .customer-grid>div>div:nth-child(2)>div:nth-child(2)>div:first-child{font-size:14px!important;font-weight:550!important;overflow-wrap:anywhere}
body .customer-grid>div>div:nth-child(2)>div:last-child>div:first-child{font-size:16px!important;font-weight:550!important;color:var(--primary)!important;font-variant-numeric:tabular-nums}
body .customer-grid>div>div:nth-child(3)>span{border-radius:var(--radius) !important;font-size:10px!important}
body .customer-grid>div>div:last-child{flex-wrap:wrap}
body .appointment-row{border:0!important;border-bottom:1px solid var(--border)!important;border-left:3px solid var(--primary)!important;border-radius:0!important;background:transparent!important;padding:18px 14px!important;gap:22px!important;min-width:0}
body .appointment-row>div{min-width:0;overflow-wrap:anywhere}
body .appointment-row button,body .appointment-row a{border-radius:var(--radius) !important;font-weight:500!important}
body .appointment-week{gap:6px!important;overflow-x:auto;scrollbar-width:thin;grid-template-columns:repeat(7,minmax(72px,1fr))!important;padding-bottom:6px}
body .appointment-week>div{border-radius:var(--radius) !important;font-weight:500!important}

body #motivation-content>div:first-child h2 i{color:var(--primary)!important;font-size:20px}
body #motivation-content>div:last-child>div{border-radius:var(--radius) !important}
body #motivation-content>div:last-child>div>div:first-child{color:var(--primary)!important;background:var(--primary-light)!important}
body #motivation-content button[onclick^="playMedia"]{color:var(--primary)!important;border-color:var(--border-strong)!important;font-weight:500!important}
body #rohleads-content .kpi-flat{border:0;border-radius:0;background:transparent;border-right:1px solid var(--border);box-shadow:none;padding:14px 20px;text-align:left}
body #rohleads-content .kpi-stat-value{font-size:28px;font-weight:500}
body .cc-h3{font-size:14px;font-weight:550;letter-spacing:-.2px}
body .cc-kpis,body .zahlungen-stats{gap:0;border-block:1px solid var(--border);margin-block:22px;padding-block:18px}
body .cc-kpis>.cc-kpi,body .zahlungen-stats>.zahlungen-stat-card{border:0!important;border-left:1px solid var(--border)!important;border-radius:0!important;background:transparent!important;padding:0 20px!important;box-shadow:none!important;min-width:0}
body .cc-kpis>.cc-kpi:first-child,body .zahlungen-stats>.zahlungen-stat-card:first-child{border-left:0!important;padding-left:0!important}
body :is(.cc-range,.zg-switch){border-radius:var(--radius);background:var(--surface-2)}
body .cc-range-btn.an{box-shadow:none;background:var(--primary-light);color:var(--primary)}
body .payment-badge,body .status-badge{border-radius:var(--radius);font-size:10px;font-weight:500}
body #cockpit-frame{border:1px solid var(--border);border-radius:var(--radius);max-width:100%}
body .ob-admin h3{font-family:var(--app-font);font-weight:550}
@media(max-width:1024px){body .customer-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:20px!important}body .customer-kpis>div{padding:0!important;border-left:0!important}}
@media(max-width:768px){
 body :is(#rohleads-content,#termine-content,#kunden-content,#zahlungen-content,#users-content,#motivation-content,#callcenter-content,#finanzen-content){padding-inline:0!important;width:100%!important}
 body .customer-breakdown{grid-template-columns:minmax(0,1fr)!important;gap:18px!important}
 body .customer-grid{grid-template-columns:minmax(0,1fr)!important;gap:0!important}
 body .customer-grid>div{padding:18px 0!important;border:0!important;border-bottom:1px solid var(--border)!important;border-radius:0!important;background:transparent!important}
 body .customer-grid>div>div:nth-child(2)>div:last-child{flex-basis:100%!important;text-align:left!important;margin-left:50px!important}
 body .appointment-row{display:flex!important;flex-direction:column!important;padding:16px 0 16px 12px!important;gap:12px!important}
 body .appointment-row>div{width:100%!important;min-width:0!important;flex-wrap:wrap!important}
 body .appointment-row>div:last-child{flex-direction:row!important}
 body .view :is(.detail-btn,.btn-flat,.cc-range-btn,.cc-datum,.zg-toggle,.zg-btn){min-height:44px!important;white-space:normal!important}
 body .cc-kpis,body .zahlungen-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:22px 14px!important;padding:18px 0!important}
 body .cc-kpis>.cc-kpi,body .zahlungen-stats>.zahlungen-stat-card{border:0!important;padding:0!important}
 body .cc-kpi-v,body .zahlungen-stat-value{font-size:clamp(22px,5.6vw,29px)!important}
 body #motivation-content>div:last-child>div{flex-wrap:wrap!important;padding:16px 0!important;background:transparent!important;border:0!important;border-bottom:1px solid var(--border)!important;border-radius:0!important}
 body #motivation-content>div:last-child>div>button{flex:1!important}
 body #rohleads-content .kpi-flat{padding:10px 0!important;border:0!important}
 body .view :is(h2,h3){max-width:100%!important}
 body #cockpit-frame{border-radius:var(--radius) !important}
}
/* Content appears immediately; hover and focus still provide subtle feedback. The old rise animation of
   views and KPI tiles is gone from crm-style.css, so no !important override is needed here any more; a real
   view switch fades with .view-enter (crm-motion.css). */
body .view .btn-add-lead,body .cold-note-save{background:var(--brand,#1fae8c)!important;color:var(--on-brand,#04110d)!important;box-shadow:none!important;border:1px solid var(--brand,#1fae8c)!important;border-radius:var(--radius) !important;font-weight:550!important}
body #view-users>div{max-width:1440px!important;padding-inline:0!important}
body #view-users>div>div:first-child{gap:24px;flex-wrap:wrap}
body #view-users>div>div:first-child>div{min-width:min(100%,280px);flex:1}

body .workspace-filters{display:flex;gap:12px;flex-wrap:wrap;align-items:end;margin-bottom:10px}
.workspace-filter{display:flex;flex-direction:column;gap:5px;min-width:160px;max-width:100%;font-size:10px;color:var(--muted)}
.workspace-filter select{font:400 12px var(--app-font);padding:9px 12px;background:var(--card);color:var(--text);border:1px solid var(--border);min-height:38px;max-width:100%}
body .zg-kunde{border-radius:var(--radius)}.zg-kopf-name strong{font-weight:550!important}.zg-marke{border-radius:var(--radius);font-weight:500}.zg-balken{height:4px}.zg-nr{font-family:var(--app-font)}
@media(max-width:768px){
 body #view-users>div{padding-inline:0!important}
 body #view-users>div>div:first-child{gap:12px!important;align-items:start!important}
 body #view-users>div>div:first-child>div{flex-basis:100%!important;min-width:0!important}
 body #view-users .btn-add-lead{min-height:44px!important}
 body .workspace-filter{flex:1 1 140px!important;min-width:0!important}.workspace-filter select{min-height:44px!important;font-size:16px!important;width:100%!important}
 body .workspace-filters>.btn-flat{flex:1 1 100%!important;min-height:44px!important}
 body .zg-liste{gap:20px!important}body .zg-kunde{background:transparent!important;border:0!important;border-top:1px solid var(--border)!important;border-radius:0!important}
 body .zg-kunde>summary{padding:16px 0!important}.zg-kunde-inhalt{padding:0!important}
 body .zg-projekt{border:0!important;border-top:1px solid var(--border)!important;border-radius:0!important;background:transparent!important}
 body .zg-projekt>summary{padding:14px 0!important}body .zg-zeile{padding:12px 0!important}
 body .zg-oeffnen{min-width:44px!important;min-height:44px!important}
}

body #view-users .workspace-table-wrap table{min-width:720px!important;table-layout:auto!important}
body #view-users .workspace-table-wrap :is(th,td){white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important}

/* The same control language also applies to customer and contract dialogs. */
body .modal-header{border-radius:var(--radius) var(--radius) 0 0 !important}
body :is(.detail-primary-action button,.modal .btn-primary){background:var(--brand,#1fae8c)!important;color:var(--on-brand,#04110d)!important;border:1px solid var(--brand,#1fae8c)!important;border-radius:var(--radius) !important;box-shadow:none!important;font:550 13px/1.5 var(--app-font)!important;min-height:40px}
body .detail-primary-action button:hover{transform:none!important;background:var(--brand-hover,#25be99)!important}
body .detail-section{border-radius:var(--radius)}
body #contract-configurator-modal>div{border-radius:var(--radius) !important;background:var(--card)!important}
body #contract-configurator-modal :is(input,select,textarea){font-family:var(--app-font)!important;border-radius:var(--radius) !important;font-weight:500!important}
body #contract-configurator-modal>div>div:first-child>div>div:first-child{font-weight:550!important}
@media(max-width:768px){
 body :is(.detail-primary-action button,.modal .btn-primary){min-height:44px!important}
 body #contract-configurator-modal{padding:8px!important}
 body #contract-configurator-modal>div{max-height:calc(100dvh - 16px)!important}
 body #contract-configurator-modal>div>div{padding:16px!important}
 body #contract-configurator-modal :is(input,select,textarea){font-size:16px!important;min-height:44px!important}
 body #contract-configurator-modal input[type=checkbox]{min-height:20px!important;min-width:20px!important}
 body #contract-configurator-modal button{min-height:44px!important}
 body #view-users .workspace-table-wrap:before{content:'Weitere Spalten: seitlich wischen';display:block!important;position:sticky!important;left:0!important;width:fit-content!important;padding:10px 16px!important;color:var(--muted)!important;font-size:11px!important}
}

body .ob-admin dialog{margin:auto!important;inset:0!important}

/* Planning parity: the same typography and component geometry on every CRM page. */
body .view { font:400 var(--ui-body-size)/1.5 var(--app-font); }
body .view :is(strong,b) { font-weight:550; }
body :is(.workspace-heading,.insight-heading) { padding:var(--ui-heading-space); margin:0; }
body .workspace-heading { align-items:center; }
body .workspace-heading>div { min-width:0; }
body :is(.workspace-heading h2,.insight-heading h2) {
    font:var(--ui-title-weight) var(--ui-title-size)/1.3 var(--app-font)!important;
    letter-spacing:var(--ui-title-tracking)!important;margin:7px 0 0!important;
}
body :is(.workspace-eyebrow,.insight-heading>span) { font:600 10px/1.5 var(--app-font);letter-spacing:.13em;color:var(--muted);text-transform:uppercase; }
body :is(.workspace-description,.workspace-heading>div>p:not(.workspace-eyebrow),.workspace-heading>div>div,.insight-heading p) {
    font:400 12px/1.6 var(--app-font)!important;color:var(--muted);margin:8px 0 0!important;
}
body .workspace-heading h2>span { display:inline;font-weight:400; }
body :is(.workspace-section-heading h3,.insight-section h2,.workspace-admin-section h3,.cc-h3,.chart-card h3) {
    font:550 var(--ui-section-size)/1.4 var(--app-font)!important;letter-spacing:-.3px!important;margin-top:0;
}
body .view :is(.kpi-stat-label,.zahlungen-stat-label,.cc-kpi-l,.insight-metric h3) {
    font:400 var(--ui-label-size)/1.5 var(--app-font)!important;letter-spacing:0!important;text-transform:none!important;color:var(--muted)!important;min-height:0;margin-bottom:6px;
}
body .view :is(.kpi-stat-value,.zahlungen-stat-value,.cc-kpi-v,.insight-metric strong),body .customer-kpis>div>div:first-child {
    font:500 var(--ui-metric-size)/1.4 var(--app-font)!important;letter-spacing:-.6px!important;font-variant-numeric:tabular-nums!important;overflow-wrap:anywhere;
}
body :is(.dash-metric-note,.cc-kpi-s,.insight-metric p) { font:400 11px/1.5 var(--app-font);color:var(--muted);margin:4px 0 0; }
body :is(.dash-kpis,.insight-metrics,.customer-kpis,.cc-kpis,.zahlungen-stats) {
    padding:20px 24px!important;border:1px solid var(--border)!important;border-radius:var(--radius) !important;background:var(--card)!important;margin:0 0 24px!important;gap:0;
}
body :is(.dash-kpis .kpi-flat,.insight-metric,.customer-kpis>div,.cc-kpis>.cc-kpi,.zahlungen-stats>.zahlungen-stat-card) {
    padding:0 20px!important;min-width:0;border:0!important;border-left:1px solid var(--border)!important;background:transparent!important;border-radius:0!important;gap:0;
}
body :is(.dash-kpis .kpi-flat,.insight-metric,.customer-kpis>div,.cc-kpis>.cc-kpi,.zahlungen-stats>.zahlungen-stat-card):first-child { border-left:0!important;padding-left:0!important; }
body .customer-kpis>div>div:not(:first-child) { font-size:11px!important;text-transform:none!important;letter-spacing:0!important; }
body :is(.zahlungen-stat-card,.customer-kpis>div) { display:flex;flex-direction:column; }
body .zahlungen-stat-label,body .customer-kpis>div>div:nth-child(2) { order:-1; }
body .dash-kpis .kpi-stat-label { min-height:0; }
body .insight-filter { border:0;padding-bottom:20px;gap:8px; }
body .insight-filter label { font-size:var(--ui-label-size); }
body .insight-columns { gap:24px; }
body .insight-section { padding:22px 0; }
body .insight-section p { font-size:11px;line-height:1.6; }
body .insight-quality summary,body .insight-method summary { font-size:13px; }
body .cc-kopf { margin-bottom:20px; }
body .cc-zeitraum-text { font-size:13px;font-weight:500; }
body .cc-sync { font-size:11px;line-height:1.6; }
body .cc-kopf-rechts { gap:8px;flex-wrap:wrap; }
body .view :is(.btn-flat,.btn-secondary,.btn-primary,.btn-add-lead,.detail-btn,.cc-btn,.ra-knopf,.zg-btn,.cc-range-btn,.zg-toggle),
body :is(.modal,.workspace-overlay,.cc-modal,.profile-dialog,.agent-deal) :is(button:not(.modal-close):not(.modal-tab):not(.tbl-btn):not(.profile-close):not([data-close]),.detail-btn),
body .ob-admin button {
    font:500 13px/1.5 var(--app-font)!important;min-height:var(--ui-control-height);padding:var(--ui-control-padding);border-radius:var(--radius) !important;box-shadow:none!important;transform:none;letter-spacing:0;max-width:100%;
}
body :is(.btn-flat,.btn-secondary,.cc-btn,.detail-btn.secondary) { background:var(--card);color:var(--text);border:1px solid var(--border); }
body :is(.btn-flat-primary,.btn-primary,.detail-btn.primary) { background:var(--brand,#1fae8c)!important;color:var(--on-brand,#04110d)!important;border:1px solid var(--brand,#1fae8c)!important; }
body :is(.btn-flat,.btn-secondary,.cc-btn,.detail-btn.secondary):hover { border-color:var(--muted);background:var(--surface); }
body :is(.cc-range,.zg-switch) { display:flex;gap:4px;background:transparent;border:0;padding:0;box-shadow:none;flex-wrap:wrap; }
body :is(.cc-range-btn,.zg-toggle) { background:transparent;color:var(--muted);border:1px solid transparent; }
body :is(.cc-range-btn.an,.zg-toggle.an,.zg-toggle.active) { color:var(--primary);background:var(--primary-light);border-color:var(--border); }
body :is(.view,.modal,.workspace-overlay,.cc-modal,.profile-dialog,.agent-deal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),select,textarea) {
    font:400 12px/1.5 var(--app-font)!important;color:var(--text)!important;background:var(--ui-field-bg)!important;border:1px solid var(--border);border-radius:var(--radius) !important;min-width:0;max-width:100%;min-height:38px;padding:10px 11px;box-shadow:none;
}
body :is(.modal,.workspace-overlay,.cc-modal,.profile-dialog,.agent-deal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),select,textarea) { min-height:42px;font-size:13px!important; }
body :is(input,textarea)::placeholder { color:var(--muted);opacity:.8; }
body :is(.view,.modal,.workspace-overlay,.cc-modal,.profile-dialog,.agent-deal) :is(input[type=checkbox],input[type=radio]) { accent-color:var(--primary); }
body :is(.view,.modal,.workspace-overlay,.cc-modal,.profile-dialog,.agent-deal) :is(button:disabled,input:disabled,select:disabled) { opacity:.5;cursor:not-allowed; }
body :is(.view,.modal,.workspace-overlay,.cc-modal,.profile-dialog,.agent-deal) :is(label,.form-group label) { font-weight:500; }
body .view :is(.leads-table-wrap,.zahlungen-table-wrap,.workspace-table-wrap) { border-radius:var(--radius) !important;background:var(--card);border:1px solid var(--border);box-shadow:none; }
body .view table { border-collapse:collapse; }
body .view table :is(th,td) { padding:12px;line-height:1.5;vertical-align:middle; }
body .view table th { font:500 10px/1.5 var(--app-font)!important;letter-spacing:.06em;background:var(--card);border-bottom:1px solid var(--border);color:var(--muted); }
body .view table td { font-size:12px; }
body .view .leads-table :is(th,td)+:is(th,td) { border-left:0; }
body .view .leads-table :is(th,td):last-child { white-space:nowrap; }
body .view table tbody tr { border-bottom:1px solid var(--border); }
body .view table tbody tr:hover { background:color-mix(in srgb,var(--primary) 4%,transparent); }
body .view :is(.stage-badge,.badge,.due-badge,.tag,.cc-status,.payment-badge) { border-radius:var(--radius-sm);font-size:10px;font-weight:500;letter-spacing:0; }
body :is(.tbl-btn,.cc-mini,.contract-action-btn) { width:34px;min-width:34px;height:34px;border-radius:var(--radius) !important;display:inline-flex;align-items:center;justify-content:center;box-shadow:none; }
body .workspace-admin-section,body .view .cc-karte { background:transparent!important;border:0!important;border-top:1px solid var(--border)!important;border-radius:0!important;padding:24px 0!important;margin-top:24px;box-shadow:none!important; }
body .workspace-admin-section>div:first-child { display:flex;align-items:flex-start!important;justify-content:space-between;gap:16px; }
body .workspace-admin-section>div:first-child>div { min-width:0; }
body .workspace-admin-section h3 i { color:var(--muted)!important;font-size:14px; }
body .workspace-admin-section p { font:400 11px/1.6 var(--app-font)!important; }
body .fi-jetzt { border-radius:var(--radius);background:var(--card);border:1px solid var(--border);padding:20px 24px; }
body .fi-formel strong { font-size:21px;font-weight:500;letter-spacing:-.6px; }
body .fi-jetzt-l { font-size:10px;font-weight:500;letter-spacing:.08em; }
body .view :is(.cc-pers,.cc-note,.cold-card) { border-radius:var(--radius);box-shadow:none; }
body .appointment-row { border-left-width:2px!important; }
body #termine-content>h2 { font:550 17px/1.4 var(--app-font)!important;text-transform:none!important;letter-spacing:-.3px!important; }
body .appointment-row>div:nth-child(2)>div:first-child { font-size:14px!important; }
body .workspace-toolbar button { border-radius:var(--radius) !important;font:500 12px/1.5 var(--app-font)!important;min-height:38px; }
body .workspace-toolbar { padding-bottom:20px;border-bottom:1px solid var(--border); }
body :is(.modal,.cc-modal,.profile-dialog,.agent-deal,.workspace-overlay>div:not(.toast)) { border-radius:var(--radius) !important;background:var(--card)!important;border:1px solid var(--border)!important;font:400 13px/1.5 var(--app-font);box-shadow:0 30px 120px #0008!important; }
body .workspace-overlay>div { max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain; }
body :is(.modal-header h2,.workspace-overlay h3,.cc-modal-kopf h3,.profile-dialog h2,.agent-deal h2) { font:500 22px/1.3 var(--app-font)!important;letter-spacing:-.6px!important;margin:6px 0; }
body .modal-header { padding:24px 25px 18px!important;background:var(--card); }
body .modal-body { padding:22px 25px; }
body .modal :is(.detail-section,.detail-card) { background:transparent;border:0;border-top:1px solid var(--border);border-radius:0;padding:20px 0;box-shadow:none; }
body .modal .detail-section-title { font:550 13px/1.5 var(--app-font)!important;text-transform:none;letter-spacing:0;color:var(--text); }
body .modal .detail-label { font:500 11px/1.5 var(--app-font)!important;letter-spacing:0;text-transform:none; }
body .modal :is(.detail-value,.detail-value a) { font-size:13px;line-height:1.6; }
body .modal :is(.modal-tabs,.detail-tabs) { border-bottom:1px solid var(--border);padding:0 18px;gap:7px; }
body .modal .modal-tab { background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;min-height:47px;padding:12px 17px 15px;font:400 13px/1.5 var(--app-font);color:var(--muted); }
body .modal .modal-tab.active { border-bottom-color:var(--primary);color:var(--primary);background:transparent; }
body :is(.modal-overlay,.cc-modal-hg,.workspace-overlay) { backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px); }
@media(max-width:1024px){
 body :is(.dash-kpis,.insight-metrics,.customer-kpis,.cc-kpis,.zahlungen-stats){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:20px!important;}
 body :is(.dash-kpis .kpi-flat,.insight-metric,.customer-kpis>div,.cc-kpis>.cc-kpi,.zahlungen-stats>.zahlungen-stat-card){padding:0!important;border:0!important;}
}
@media(max-width:768px){
 body :is(.workspace-heading,.insight-heading){padding:8px 0 24px!important;gap:16px!important;align-items:flex-start!important;flex-wrap:wrap!important;}
 body .workspace-heading>div{width:100%!important;}
 body .workspace-heading>button,body .workspace-heading>.workspace-actions{min-height:44px!important;}
 body :is(.workspace-heading h2,.insight-heading h2){font-size:var(--ui-title-size)!important;}
 body :is(.dash-kpis,.insight-metrics,.customer-kpis,.cc-kpis,.zahlungen-stats){padding:18px 0!important;border-inline:0!important;border-radius:0!important;background:transparent!important;gap:22px 16px!important;}
 body :is(.view,.modal,.workspace-overlay,.cc-modal,.profile-dialog,.agent-deal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),select,textarea){min-height:44px!important;font-size:16px!important;}
 body .view :is(.btn-flat,.btn-secondary,.btn-primary,.detail-btn,.cc-btn,.ra-knopf,.zg-btn,.cc-range-btn,.zg-toggle),body :is(.modal,.workspace-overlay,.cc-modal,.profile-dialog,.agent-deal) button:not(.modal-tab),body .ob-admin button{min-height:44px!important;white-space:normal!important;}
 body :is(.tbl-btn,.cc-mini,.contract-action-btn){width:44px!important;min-width:44px!important;height:44px!important;}
 /* Won and lost dialog (index.html): 44 px targets and a 16 px field like every other dialog on the phone (iOS zoomed
    into the 14 px reason field). !important only on the font size: it beats the inline style of that field. */
 body :is(#won-modal,#lost-modal) button{min-height:44px;}
 body #lost-modal input{font-size:16px!important;}
 body .workspace-admin-section>div:first-child{flex-wrap:wrap!important;gap:12px!important;}
 body .workspace-admin-section>div:first-child>div{flex-basis:100%!important;}
 body .workspace-admin-section,body .view .cc-karte{padding:20px 0!important;margin-top:20px!important;}
 body .fi-jetzt{padding:18px 0!important;border-inline:0!important;border-radius:0!important;background:transparent!important;}
 body .workspace-overlay{padding:8px!important;}
 body .workspace-overlay>div{width:100%!important;max-height:calc(100dvh - 16px)!important;padding:18px!important;}
 body .modal-header{padding:18px 16px!important;}
 body .modal-body{padding:16px!important;}
 body .modal .detail-section{padding:18px 0!important;}
 body .modal :is(.modal-tabs,.detail-tabs){padding-inline:8px!important;}
 body .modal .modal-tab{padding-inline:10px!important;}
 body .workspace-toolbar button{min-height:44px!important;}
}

body .workspace-heading>.btn-add-lead{width:auto;flex:0 0 auto;}
body .workspace-integration{background:transparent!important;border:0!important;border-top:1px solid var(--border)!important;border-radius:0!important;padding:24px 0!important;box-shadow:none!important;}
body .workspace-integration h3{font:550 17px/1.4 var(--app-font)!important;letter-spacing:-.3px;}
@media(max-width:768px){body .workspace-integration{padding:20px 0!important;}}

body .detail-tab-bar{display:flex;gap:7px;padding:0;margin:0 0 22px;border:0;border-bottom:1px solid var(--border);background:transparent;}
body .det-tab{border:0;border-bottom:2px solid transparent;border-radius:0!important;background:transparent;font:400 13px/1.5 var(--app-font);color:var(--muted)!important;min-height:47px;padding:12px 17px 15px;box-shadow:none;}
body .det-tab-active{border-bottom-color:var(--primary);color:var(--primary)!important;background:transparent;}
body .workspace-integration>div:first-child{font:550 17px/1.4 var(--app-font)!important;}
body .workspace-integration>div:first-child i{color:var(--muted)!important;font-size:14px;}
@media(max-width:768px){body .det-tab{padding-inline:10px!important;font-size:12px!important;}}
body .modal .detail-section-title{font-size:13px!important;font-weight:550!important;text-transform:none!important;letter-spacing:0!important;}
body .modal .detail-section-title i{color:var(--muted)!important;font-size:13px;}
body .modal .detail-field .d-label{font:500 11px/1.5 var(--app-font)!important;letter-spacing:0!important;text-transform:none!important;color:var(--muted);}
body .modal .detail-field .d-val{font:400 13px/1.6 var(--app-font);overflow-wrap:anywhere;}
body .modal .detail-grid{gap:18px 22px;}
body .modal .det-tab{background:transparent!important;border:0!important;border-bottom:2px solid transparent!important;font-weight:400!important;}
body .modal .det-tab.det-tab-active{border-bottom-color:var(--primary)!important;color:var(--primary)!important;}
body .detail-status-banner{background:var(--primary-light)!important;border-radius:var(--radius) !important;padding:14px!important;}
body .detail-status-banner>span{font-size:16px!important;color:var(--primary);}
body .detail-won-badge{background:var(--primary-light);color:var(--primary);border:1px solid var(--border);border-radius:var(--radius);box-shadow:none;font:500 10px/1.5 var(--app-font);letter-spacing:0;text-transform:none;}
body .detail-primary-action{justify-content:flex-start;}
body .ob-admin{font-size:13px;}body .ob-admin h2{font:500 22px/1.3 var(--app-font);letter-spacing:-.6px;}
body .ob-admin h3{font:550 17px/1.4 var(--app-font);letter-spacing:-.3px;}
body .ob-admin dialog{border-radius:var(--radius);}
@media(max-width:480px){body .modal .detail-grid{grid-template-columns:minmax(0,1fr)!important;gap:14px!important;}}
body .workspace-dialog-title{font:500 22px/1.3 var(--app-font)!important;letter-spacing:-.6px;margin:0 0 6px;}
body .workspace-overlay h3>i{color:var(--muted)!important;}
body .workspace-email-heading{background:var(--card);border-bottom:1px solid var(--border);}
body .workspace-email-heading>div>div:first-child{font:500 22px/1.3 var(--app-font)!important;color:var(--text)!important;letter-spacing:-.6px;}
body .workspace-email-heading>div>div:last-child{font-size:12px!important;color:var(--muted)!important;}
body .workspace-email-heading>button{background:transparent!important;color:var(--muted)!important;}
body #contract-configurator-modal>div{padding:0!important;border-radius:var(--radius) !important;}
body #contract-configurator-modal label:not(:has(input)){font:500 11px/1.5 var(--app-font)!important;text-transform:none!important;letter-spacing:0!important;}
body #cv-leistungen-list label,body #cv-ausbau-list label{font-size:12px!important;font-weight:400!important;line-height:1.6!important;}
body #contract-configurator-modal>div>div:last-child>button:first-child{background:var(--brand,#1fae8c)!important;color:var(--on-brand,#04110d)!important;}
@media(max-width:768px){
 body .workspace-heading h2>span{display:block!important;margin-top:3px!important;}
 body .workspace-overlay [style*="grid-template-columns"]:has(input,select,textarea){grid-template-columns:minmax(0,1fr)!important;gap:16px!important;}
 body #contract-configurator-modal>div{padding:0!important;}
 body #contract-configurator-modal>div>div{padding:18px 16px!important;}
 body #contract-configurator-modal div:has(>label>input[name="cv-payment-terms"]){flex-direction:column!important;}
 body #contract-configurator-modal span:has(>#cv-wartung-preis){flex-wrap:wrap!important;}
 body #cv-wartung-preis{width:80px!important;}
}
/* The cockpit owns a single page gutter; its iframe grows with its content. */
body #main-content #view-cockpit.view{padding:0!important}
body #cockpit-frame{border:0;border-radius:0;width:100%;display:block}
body[data-crm-view=cockpit] .topbar .search-wrap{display:none}
@media(max-width:768px){body #cockpit-frame{border-radius:0!important}}

/* App confirmations stay centered and readable, including long push messages. */
body #toast.toast{left:50%;right:auto;bottom:max(24px,env(safe-area-inset-bottom));width:max-content;max-width:min(620px,calc(100vw - 32px));box-sizing:border-box;transform:translate(-50%,16px);padding:14px 20px;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--card);color:var(--text);font:400 13px/1.6 var(--app-font);text-align:center;white-space:normal;overflow-wrap:anywhere;box-shadow:0 8px 36px #0003;z-index:1000002;pointer-events:none;transition:opacity var(--motion-panel) var(--ease-out),transform var(--motion-panel) var(--ease-out)}
body #toast.toast.show{transform:translate(-50%,0)}
body #toast.toast.success{border-color:var(--primary)}
body #toast.toast.error{border-color:var(--danger,#b42318)}
body #toast.toast.toast-warning{border-color:var(--warning,#b46c00)}
@media(max-width:768px){body #toast.toast{left:50%!important;right:auto!important;bottom:calc(16px + env(safe-area-inset-bottom))!important;width:max-content!important;max-width:calc(100vw - 24px)!important;padding:12px 16px!important;font-size:12px!important;text-align:center!important;transform:translate(-50%,16px)!important}body #toast.toast.show{transform:translate(-50%,0)!important}}
@media(prefers-reduced-motion:reduce){body #toast.toast{transition:none!important}}

/* Role descriptions share the compact workspace rhythm. */
.crm-role-guide { margin:20px 0; border-block:1px solid var(--border); padding:16px 0; }
.crm-role-guide summary { cursor:pointer; font-weight:550; }
.crm-role-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; padding-top:20px; }
.crm-role-grid h3 { font-size:14px; margin:0 0 8px; }
.crm-role-grid p,.crm-role-grid li,.crm-role-help { font-size:12px; line-height:1.6; }
.crm-role-grid ul,.crm-role-help ul { padding-left:18px; margin:8px 0 0; color:var(--muted); }
.crm-role-help { padding:14px 0; margin-bottom:16px; border-block:1px solid var(--border); }
#user-modal > div { max-height:calc(100dvh - 32px); overflow-y:auto; }
@media(max-width:600px) {
 .crm-role-grid { grid-template-columns:1fr !important; gap:20px !important; }
 #user-modal { padding:12px !important; }
 #user-modal > div { padding:20px !important; max-height:calc(100dvh - 24px) !important; }
 #user-modal input,#user-modal select { min-height:44px !important; font-size:16px !important; }
}

/* Invoice editing: intrinsic date/select widths must not widen the dialog. */
body #invoice-modal-overlay { overflow-x:hidden; }
body #invoice-modal-overlay .invoice-editor { min-width:0; box-sizing:border-box; }
body #invoice-modal-overlay .iv-field-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
body #invoice-modal-overlay :is(.iv-field-grid>div,.iv-item-row) { min-width:0; }
body #invoice-modal-overlay :is(input,select,textarea) { width:100%; min-width:0; max-width:100%; box-sizing:border-box; }
body #invoice-modal-overlay input[type=date] { display:block; appearance:none; -webkit-appearance:none; }
body #invoice-modal-overlay input[type=date]::-webkit-date-and-time-value { min-width:0; text-align:left; }
body #invoice-modal-overlay .iv-item-row { grid-template-columns:minmax(0,2fr) minmax(0,2fr) 100px 38px!important; }
.iv-number-panel { margin:0 0 20px; padding:14px 0; border-block:1px solid var(--border); }
.iv-number-panel>span { display:block; color:var(--muted); font-size:12px; }
.iv-number-panel>strong { display:block; margin:4px 0; font-size:21px; font-weight:500; font-variant-numeric:tabular-nums; }
.iv-number-panel>p { margin:0; color:var(--muted); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
@media(max-width:768px){
 body #invoice-modal-overlay { padding:8px!important; }
 body #invoice-modal-overlay .invoice-editor { width:100%!important; padding:16px!important; }
 body #invoice-modal-overlay .iv-field-grid { grid-template-columns:minmax(0,1fr)!important; gap:14px!important; }
 body #invoice-modal-overlay :is(input,select,textarea) { min-width:0!important; width:100%!important; max-width:100%!important; box-sizing:border-box!important; }
 body #invoice-modal-overlay .iv-item-row { grid-template-columns:minmax(0,1fr) 44px!important; gap:8px!important; padding:12px 0!important; border-bottom:1px solid var(--border)!important; }
 body #invoice-modal-overlay :is(.iv-item-desc,.iv-item-sub) { grid-column:1 / -1!important; }
 body #invoice-modal-overlay .iv-item-amount { grid-column:1!important; }
 body #invoice-modal-overlay .iv-item-remove { grid-column:2!important; }
 body #invoice-modal-overlay .iv-actions { flex-wrap:wrap!important; }
 body #invoice-modal-overlay .iv-actions>button { flex:1 1 140px!important; min-width:0!important; }
}
body #invoice-modal-overlay #iv-close { min-width:44px; min-height:44px; flex-shrink:0; }
body #invoice-modal-overlay #iv-heading { min-width:0; }
@media(max-width:768px){body #invoice-modal-overlay #iv-close { min-width:44px!important; min-height:44px!important; }}

/* Customer components embedded in the staff CRM follow the CRM accent.
   This file is only loaded by the CRM, so customer pages keep the website colour.
   !important only where portal.css sets the customer button with !important. */
body .portal-admin,body .pw-task-mail-dialog,body .ob-admin{--customer-accent:var(--primary);--customer-soft:var(--primary-light);--customer-soft-line:color-mix(in srgb,var(--brand) 35%,transparent);--ob-accent:var(--primary)}
body .portal-admin .portal-primary,body .pw-task-mail-dialog .portal-primary,body .ob-admin .ob-primary{background:var(--brand)!important;border-color:var(--brand)!important;color:var(--on-brand)!important}
body .ob-admin .ob-badge{background:color-mix(in srgb,var(--brand) 12%,transparent);color:var(--primary)}
body .ob-admin .ob-facts li.is-done{border-color:color-mix(in srgb,var(--brand) 35%,transparent);background:color-mix(in srgb,var(--brand) 10%,transparent);color:var(--primary)}
/* Scrolling past the end of the customer sheet or a dialog in it (answers, files, task mail) must not scroll the page
   behind the blur; that moving background looked like flashing. Measured 09.10.2026: 1204 px page jump without, 0 with. */
body .modal-overlay :is(.modal,dialog){overscroll-behavior:contain}
/* New release available while the CRM was open */
.crm-update-bar{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:10000;display:flex;align-items:center;gap:14px;max-width:calc(100vw - 24px);padding:10px 10px 10px 18px;border-radius:var(--radius);background:#1a2130;color:#fff;font:500 13px/1.4 var(--app-font,Poppins,system-ui,sans-serif);box-shadow:0 12px 40px #0004}
.crm-update-bar button{min-height:40px;padding:0 14px;border:0;border-radius:var(--radius);background:var(--brand,#195ebf);color:#fff;font:600 13px/1 var(--app-font,Poppins,system-ui,sans-serif);cursor:pointer;white-space:nowrap}
@media (max-width:480px){.crm-update-bar{left:12px;right:12px;transform:none;flex-wrap:wrap}.crm-update-bar button{flex:1 1 100%}}
