/* =========================================================================
   POWERMIETER — Contract Management styles
   Cockpit · Model selector · Go-Live gate · Unit drawer · Wizard · WEG · SEPA
   ========================================================================= */

/* ---- Admin sub-nav ---- */
.pm-admin-subnav { display: flex; gap: 4px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 14; overflow-x: auto; }
@media (max-width: 640px) { .pm-admin-subnav { padding: 0 12px; } }
.pm-subtab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  border: 0; background: none; cursor: pointer; font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; color: var(--text-2); padding: 15px 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .16s var(--ease);
}
.pm-subtab svg { width: 16px; height: 16px; color: var(--text-3); }
.pm-subtab:hover { color: var(--text); }
.pm-subtab[data-on='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.pm-subtab[data-on='true'] svg { color: var(--accent); }

/* ---- Cockpit ---- */
.pm-cockpit { display: flex; flex-direction: column; gap: 18px; }
.pm-kpis-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .pm-kpis-4 { grid-template-columns: repeat(2, 1fr); } }

/* Model selector */
.pm-modelsel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.pm-modelsel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pm-modelsel-label { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.pm-modelsel-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 720px) { .pm-modelsel-row { grid-template-columns: repeat(2, 1fr); } }
.pm-modelsel-opt {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left;
  padding: 11px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface-2); cursor: pointer; transition: all .16s var(--ease);
}
.pm-modelsel-opt:hover { border-color: var(--border-strong); }
.pm-modelsel-opt[data-on='true'] { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 14%, transparent); }
.pm-modelsel-opt-k { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); }
.pm-modelsel-opt[data-on='true'] .pm-modelsel-opt-k { color: var(--accent); }
.pm-modelsel-opt-l { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.pm-modelsel-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: 12px 0 0; }
.pm-modelsel-desc em { color: var(--warn-700); font-style: normal; font-weight: 600; }
[data-theme='dark'] .pm-modelsel-desc em { color: var(--warn-500); }

/* Go-Live gate banner */
.pm-gate { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--radius-lg); background: var(--warn-50); border: 1px solid var(--warn-200); }
[data-theme='dark'] .pm-gate { background: #2A2113; border-color: #5A4520; }
.pm-gate-ic { width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--warn-500); color: #fff; }
.pm-gate-ok { background: var(--positive-tint); border-color: color-mix(in oklab, var(--positive) 30%, transparent); }
.pm-gate-ok .pm-gate-ic { background: var(--positive); }
.pm-gate-body { flex: 1; min-width: 0; }
.pm-gate-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text); }
.pm-gate-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.pm-gate-meter { text-align: center; flex: none; padding-left: 16px; border-left: 1px solid var(--border); }
.pm-gate-meter-v { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--text); line-height: 1; }
.pm-gate-meter-l { font-size: 11px; color: var(--text-3); font-weight: 600; margin-top: 4px; }
@media (max-width: 600px) { .pm-gate-meter { display: none; } }

.pm-prog-bar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-2); }

/* Status badge — extra tones */
.pm-sbadge-danger { background: color-mix(in oklab, #E0556B 12%, var(--surface)); color: #E0556B; border: 1px solid color-mix(in oklab, #E0556B 35%, transparent); }
.pm-sbadge-sm { font-size: 11.5px; padding: 4px 9px; }

/* Contract table */
.pm-ctr { display: grid; grid-template-columns: 110px 1.6fr 1.2fr .9fr 1fr 100px; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border); transition: background .14s var(--ease); }
.pm-ctr:last-child { border-bottom: 0; }
.pm-ctr:not(.pm-ctr-head):hover { background: var(--surface-2); }
.pm-ctr-head { background: var(--surface-2); }
.pm-ctr-head .pm-ctd { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pm-ctd { font-size: 13.5px; color: var(--text); min-width: 0; }
.pm-ctd-loc { font-size: 11.5px; color: var(--text-3); margin-left: 8px; }
.pm-ctd-name { display: flex; align-items: center; gap: 10px; }
.pm-ctd-nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-ctd-muted { color: var(--text-3); }
.pm-ctd-act { display: flex; justify-content: flex-end; }
.pm-docpill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pm-docpill svg { color: var(--text-3); }
.pm-docpill-ver { font-size: 11px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; }
.pm-readi { display: inline-flex; align-items: center; gap: 9px; width: 100%; }
.pm-readi-bar { flex: 1; height: 7px; min-width: 40px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pm-readi-fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s var(--ease); }
.pm-readi-fill[data-full='true'] { background: var(--positive); }
.pm-readi-v { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.pm-cockpit-foot { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--text-3); line-height: 1.5; padding: 4px 4px 0; }
.pm-cockpit-foot svg { color: var(--accent); flex: none; margin-top: 1px; }
.pm-cockpit-foot strong { color: var(--text-2); }

@media (max-width: 820px) {
  .pm-ctr-head { display: none; }
  .pm-ctr { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .pm-ctd-name { grid-column: 1 / -1; order: -1; }
}

/* ---- Unit drawer ---- */
.pm-drawer-scrim { position: fixed; inset: 0; z-index: 210; background: #050a12cc; backdrop-filter: blur(5px); display: flex; justify-content: flex-end; animation: pm-fade .2s var(--ease); }
@keyframes pm-fade { from { opacity: 0; } to { opacity: 1; } }
.pm-drawer { width: 460px; max-width: 100%; background: var(--surface); height: 100%; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow-pop); animation: pm-slidein .28s var(--ease); border-left: 1px solid var(--border); }
@keyframes pm-slidein { from { transform: translateX(40px); } to { transform: none; } }
.pm-drawer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pm-drawer-id { display: flex; align-items: center; gap: 12px; }
.pm-drawer-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); }
.pm-drawer-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.pm-drawer-statusbar { display: flex; align-items: center; gap: 14px; }
.pm-drawer-sec { display: flex; flex-direction: column; gap: 12px; }
.pm-drawer-h { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }
.pm-drawer-h svg { color: var(--accent); }
.pm-drawer-h-n { font-size: 12px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 8px; border-radius: 99px; }
.pm-drawer-h-tag { font-size: 11px; color: var(--text-3); font-weight: 500; margin-left: auto; }

.pm-glchecks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm-glcheck { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.pm-glcheck-ic { width: 20px; height: 20px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.pm-glcheck[data-ok='true'] { background: var(--positive-tint); border-color: color-mix(in oklab, var(--positive) 26%, transparent); color: var(--text); }
.pm-glcheck[data-ok='true'] .pm-glcheck-ic { background: var(--positive); color: #fff; }
.pm-glcheck[data-ok='false'] .pm-glcheck-ic { background: var(--warn-50); color: var(--warn-500); border: 1px solid var(--warn-200); }
[data-theme='dark'] .pm-glcheck[data-ok='false'] .pm-glcheck-ic { background: #2A2113; }

/* Document list */
.pm-doclist { display: flex; flex-direction: column; gap: 8px; }
.pm-docrow { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.pm-docrow-ic { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.pm-docrow-ic[data-tone='accent'] { background: var(--accent-tint); color: var(--accent); }
.pm-docrow-ic[data-tone='positive'] { background: var(--positive-tint); color: var(--positive); }
.pm-docrow-main { flex: 1; min-width: 0; }
.pm-docrow-name { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.pm-docrow-req { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: var(--accent-tint); border: 1px solid var(--accent-tint-border); padding: 2px 6px; border-radius: 5px; flex: none; }
.pm-docrow-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.pm-docstatus { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 99px; flex: none; background: var(--surface-3); color: var(--text-2); }
.pm-docstatus-accent { background: var(--accent-tint); color: var(--accent); }
.pm-docstatus-positive { background: var(--positive-tint); color: var(--positive); }

/* Audit log */
.pm-audit { display: flex; flex-direction: column; }
.pm-audit-row { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.pm-audit-row::before { content: ''; position: absolute; left: 13px; top: 26px; bottom: 0; width: 1.5px; background: var(--border); }
.pm-audit-row:last-child { padding-bottom: 0; }
.pm-audit-row:last-child::before { display: none; }
.pm-audit-ic { width: 27px; height: 27px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); z-index: 1; }
.pm-audit-ic.pm-audit-warn { background: var(--warn-50); border-color: var(--warn-200); color: var(--warn-500); }
.pm-audit-ic.pm-audit-good { background: var(--positive-tint); border-color: color-mix(in oklab, var(--positive) 30%, transparent); color: var(--positive); }
.pm-audit-t { font-size: 13px; font-weight: 600; color: var(--text); }
.pm-audit-m { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.pm-drawer-foot { display: flex; gap: 10px; margin-top: auto; padding-top: 8px; }
.pm-drawer-foot .btn { flex: 1; }

/* ---- Wizard overlay ---- */
.pm-wz-scrim { position: fixed; inset: 0; z-index: 220; background: #050a12cc; backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: pm-fade .2s var(--ease); }
.pm-wz { width: 820px; max-width: 100%; max-height: 92vh; background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden; }
.pm-wz-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.pm-wz-ey { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.pm-wz-title { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin: 4px 0 0; }
.pm-wz-steps { display: flex; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface-2); overflow-x: auto; }
.pm-wz-step { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: default; flex: none; font-family: var(--font-sans); }
.pm-wz-step[data-state='done'] { cursor: pointer; }
.pm-wz-step-dot { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-3); transition: all .2s var(--ease); }
.pm-wz-step[data-state='active'] .pm-wz-step-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 16%, transparent); }
.pm-wz-step[data-state='done'] .pm-wz-step-dot { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.pm-wz-step-l { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.pm-wz-step[data-state='active'] .pm-wz-step-l, .pm-wz-step[data-state='done'] .pm-wz-step-l { color: var(--text); }
.pm-wz-line { flex: 1; height: 2px; min-width: 12px; margin: 0 8px; background: var(--border); border-radius: 2px; }
.pm-wz-line[data-done='true'] { background: var(--accent); }
.pm-wz-body { flex: 1; overflow-y: auto; padding: 24px; min-height: 280px; }
.pm-wz-pane { display: flex; flex-direction: column; gap: 14px; animation: pm-rise .35s var(--ease) both; }
.pm-wz-h { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--text); margin: 0; }
.pm-wz-p { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin: 0; max-width: 52em; }
.pm-wz-p .mono { font-size: 12.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); }
.pm-wz-models { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .pm-wz-models { grid-template-columns: 1fr; } }
.pm-wz-model { position: relative; text-align: left; padding: 16px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer; transition: all .16s var(--ease); }
.pm-wz-model:hover { border-color: var(--border-strong); }
.pm-wz-model[data-on='true'] { border-color: var(--accent); background: var(--accent-tint); }
.pm-wz-model-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pm-wz-model-top b { font-family: var(--font-display); font-size: 15px; color: var(--text); }
.pm-wz-model p { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin: 8px 0 0; }
.pm-wz-model-check { position: absolute; top: 14px; right: 14px; color: var(--accent); }
.pm-wz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .pm-wz-grid { grid-template-columns: 1fr; } }
.pm-wz-party { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.pm-wz-party-h { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.pm-wz-party-h svg { color: var(--accent); }
.pm-wz-tariffs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .pm-wz-tariffs { grid-template-columns: 1fr; } }
.pm-wz-tariff { padding: 16px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.pm-wz-tariff[data-on='true'] { border-color: var(--accent); background: var(--accent-tint); }
.pm-wz-tariff-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pm-wz-tariff-h b { font-family: var(--font-display); font-size: 15px; color: var(--text); }
.pm-wz-tariff-price { font-size: 13px; color: var(--text-2); }
.pm-wz-tariff-price b { font-family: var(--font-display); font-size: 22px; color: var(--text); }
.pm-wz-send { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.pm-wz-send-ic { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.pm-wz-send-t { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); }
.pm-wz-send-s { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.pm-wz-track { display: flex; flex-direction: column; gap: 4px; }
.pm-wz-track-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.pm-wz-track-dot { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-3); font-size: 12px; font-weight: 700; }
.pm-wz-track-row[data-state='done'] { color: var(--text); }
.pm-wz-track-row[data-state='done'] .pm-wz-track-dot { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.pm-wz-track-row[data-state='active'] { border-color: var(--accent); background: var(--accent-tint); color: var(--text); }
.pm-wz-track-row[data-state='active'] .pm-wz-track-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pm-wz-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.pm-wz-foot-n { font-size: 12.5px; font-weight: 600; color: var(--text-3); }

/* ---- WEG / Eigentümer ---- */
.pm-weg { display: flex; flex-direction: column; gap: 18px; }
.pm-weg-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 30px; background: linear-gradient(150deg, var(--navy-700), var(--navy-900)); border: 1px solid var(--navy-600); color: #fff; }
.pm-weg-hero-glow { position: absolute; right: 20%; top: -90px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, color-mix(in oklab, var(--accent-400) 30%, transparent), transparent 65%); pointer-events: none; }
.pm-weg-hero-in { position: relative; max-width: 60%; }
.pm-weg-hero-t { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: #fff; margin: 10px 0 0; }
.pm-weg-hero-s { font-size: 14px; color: #C6D4E6; line-height: 1.55; margin: 10px 0 0; }
.pm-weg-hero-quote { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.pm-weg-ring { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent-400) calc(var(--p) * 1%), #ffffff22 0); }
.pm-weg-ring::before { content: ''; position: absolute; width: 80px; height: 80px; border-radius: 50%; background: var(--navy-800); }
.pm-weg-ring span { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 24px; color: #fff; }
.pm-weg-ring-l { font-size: 11.5px; color: #C6D4E6; text-align: center; font-weight: 600; line-height: 1.3; }
@media (max-width: 720px) { .pm-weg-hero { flex-direction: column; align-items: flex-start; } .pm-weg-hero-in { max-width: 100%; } }
.pm-weg-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .pm-weg-grid { grid-template-columns: 1fr; } }
.pm-weg-econ { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pm-weg-econ-i { padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.pm-weg-econ-v { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--text); letter-spacing: -.02em; }
.pm-weg-econ-l { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.pm-weg-go { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pm-weg-go-t { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); }
.pm-weg-go-s { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.45; max-width: 28em; }
.pm-weg-go[data-ok='true'] { border-color: color-mix(in oklab, var(--positive) 35%, transparent); background: var(--positive-tint); }

/* ---- Lifecycle ---- */
.pm-lc-tabs { display: inline-flex; gap: 4px; padding: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px; }
.pm-lc-tab { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; cursor: pointer; font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 8px 14px; border-radius: 8px; transition: all .14s var(--ease); }
.pm-lc-tab svg { color: var(--text-3); }
.pm-lc-tab:hover { color: var(--text); }
.pm-lc-tab[data-on='true'] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.pm-lc-tab[data-on='true'] svg { color: var(--accent); }
.pm-kpis-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .pm-kpis-3 { grid-template-columns: 1fr; } }

/* Fristen-Radar */
.pm-radar { display: flex; flex-direction: column; gap: 10px; }
.pm-radar-row { display: flex; align-items: center; gap: 16px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.pm-radar-urgent { background: var(--warn-50); border-color: var(--warn-200); }
[data-theme='dark'] .pm-radar-urgent { background: #2A2113; border-color: #5A4520; }
.pm-radar-when { text-align: center; flex: none; width: 50px; }
.pm-radar-days { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--text); line-height: 1; }
.pm-radar-urgent .pm-radar-days { color: var(--warn-700); }
[data-theme='dark'] .pm-radar-urgent .pm-radar-days { color: var(--warn-500); }
.pm-radar-days-l { font-size: 10.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.pm-radar-bar-wrap { flex: 1; min-width: 0; }
.pm-radar-line { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 7px; }
.pm-radar-fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.pm-radar-urgent .pm-radar-fill { background: var(--warn-500); }
.pm-radar-meta { font-size: 12.5px; color: var(--text-2); }
.pm-ctr-fr { grid-template-columns: 1.3fr .9fr .8fr 1fr 1fr 1.1fr 1fr; }
@media (max-width: 980px) { .pm-ctr-fr { grid-template-columns: 1fr 1fr; } .pm-ctr-fr.pm-ctr-head { display: none; } }
.pm-due-warn { color: var(--warn-700); font-weight: 700; }
[data-theme='dark'] .pm-due-warn { color: var(--warn-500); }

/* Mieterwechsel */
.pm-caselist { display: flex; flex-direction: column; gap: 8px; }
.pm-case { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer; text-align: left; transition: all .14s var(--ease); width: 100%; }
.pm-case:hover { border-color: var(--border-strong); }
.pm-case[data-on='true'] { border-color: var(--accent); background: var(--accent-tint); }
.pm-case-main { flex: 1; min-width: 0; }
.pm-case-t { font-size: 13.5px; font-weight: 600; color: var(--text); }
.pm-case-s { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.pm-case-prog { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--accent); flex: none; }
.pm-handover-parties { display: flex; align-items: center; gap: 14px; }
.pm-handover-p { flex: 1; min-width: 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.pm-handover-p-l { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pm-handover-p-n { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 3px; }

/* Automation rules */
.pm-rules { display: flex; flex-direction: column; gap: 10px; }
.pm-rule { display: flex; align-items: flex-start; gap: 13px; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-2); transition: all .14s var(--ease); }
.pm-rule[data-on='true'] { border-color: var(--accent-tint-border); background: var(--accent-tint); }
.pm-rule-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.pm-rule[data-on='true'] .pm-rule-ic { background: var(--surface); color: var(--accent); border: 1px solid var(--accent-tint-border); }
.pm-rule-main { flex: 1; min-width: 0; }
.pm-rule-name { font-size: 14px; font-weight: 700; color: var(--text); font-family: var(--font-display); }
.pm-rule-desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.pm-switch { flex: none; width: 44px; height: 26px; border-radius: 99px; border: 0; background: var(--surface-3); cursor: pointer; padding: 0; position: relative; transition: background .18s var(--ease); margin-top: 2px; }
.pm-switch-on { background: var(--accent); }
.pm-switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .18s var(--ease); }
.pm-switch-on .pm-switch-knob { transform: translateX(18px); }

/* ---- Digital abschließen: CTA card + Signatur-Screen ---- */
.pm-signcta { display: flex; align-items: center; gap: 15px; background: linear-gradient(135deg, var(--accent-tint), var(--surface)); border: 1px solid var(--accent-tint-border); }
.pm-signcta-ic { width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--accent-tint-border); color: var(--accent); }
.pm-signcta-h { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); margin: 0; }
.pm-signcta-s { font-size: 13px; color: var(--text-2); margin: 4px 0 0; line-height: 1.5; }

.pm-sg-scrim { position: fixed; inset: 0; z-index: 240; background: #050a12d9; backdrop-filter: blur(7px); display: flex; align-items: center; justify-content: center; padding: 22px; animation: pm-fade .2s var(--ease); }
.pm-sg { width: 1000px; max-width: 100%; max-height: 94vh; background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden; animation: pm-rise .3s var(--ease) both; }
.pm-sg-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.pm-sg-top-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pm-sg-logo { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.pm-sg-ey { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); line-height: 1.3; }
.pm-sg-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--text); margin-top: 2px; }
.pm-sg-legal { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 2px; }

.pm-sg-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; overflow-y: auto; }
@media (max-width: 800px) { .pm-sg-body { grid-template-columns: 1fr; } }

/* Document preview */
.pm-sg-doc { padding: 22px; background: var(--surface-2); border-right: 1px solid var(--border); }
@media (max-width: 800px) { .pm-sg-doc { border-right: 0; border-bottom: 1px solid var(--border); } }
.pm-sg-doc-page { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 26px 28px; box-shadow: var(--shadow-md); }
.pm-sg-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; border-bottom: 1.5px solid var(--border); }
.pm-sg-doc-brand { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text); }
.pm-sg-doc-brand svg { color: var(--accent); }
.pm-sg-doc-tag { font-size: 10.5px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; }
.pm-sg-doc-h { font-family: var(--font-display); font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 18px 0 8px; }
.pm-sg-doc-lead { font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin: 0 0 16px; }
.pm-sg-doc-fields { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }
.pm-sg-df { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.pm-sg-df span { color: var(--text-3); flex: none; }
.pm-sg-df b { color: var(--text); font-weight: 600; text-align: right; }
.pm-sg-doc-body { font-size: 11.5px; color: var(--text-3); line-height: 1.6; margin: 16px 0; }
.pm-sg-doc-incl { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-sg-doc-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 8px; border-radius: 7px; }
.pm-sg-doc-chip svg { color: var(--accent); }

/* Signing panel */
.pm-sg-panel { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.pm-sg-panel-h { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text); margin: 0; }
.pm-sg-hint { font-size: 12px; color: var(--text-3); margin: 8px 0 0; }
.pm-sg-pad-wrap { position: relative; height: 150px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface-2); overflow: hidden; }
.pm-sg-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.pm-sg-baseline { position: absolute; left: 24px; right: 24px; bottom: 38px; height: 1.5px; background: var(--border-strong); pointer-events: none; }
.pm-sg-clear { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; cursor: pointer; }
.pm-sg-clear:hover { color: var(--text); border-color: var(--border-strong); }
.pm-sg-meta { display: flex; gap: 12px; }
.pm-sg-meta-i { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pm-sg-meta-i span { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.pm-sg-meta-i b { font-size: 13.5px; color: var(--text); font-weight: 600; }
.pm-sg-place { font-family: var(--font-sans); font-size: 13.5px; color: var(--text); font-weight: 600; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; background: var(--surface); }
.pm-sg-place:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.pm-sg-confirm { display: block; }
.pm-sg-trust { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); justify-content: center; }
.pm-sg-trust svg { color: var(--positive); }

/* Done state */
.pm-sg-done { padding: 44px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0; animation: pm-rise .35s var(--ease) both; }
.pm-sg-done-ring { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--positive-tint); color: var(--positive); border: 2px solid color-mix(in oklab, var(--positive) 35%, transparent); margin-bottom: 22px; animation: pm-pop .45s var(--ease) both; }
@keyframes pm-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.pm-sg-done-h { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 10px; }
.pm-sg-done-s { font-size: 14px; color: var(--text-2); line-height: 1.6; max-width: 38em; margin: 0 0 24px; }
.pm-sg-receipt { width: 100%; max-width: 420px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 18px; margin-bottom: 24px; }
.pm-sg-rrow { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.pm-sg-rrow:last-child { border-bottom: 0; }
.pm-sg-rrow span { color: var(--text-3); }
.pm-sg-rrow b { color: var(--text); font-weight: 600; }
.pm-sg-rstatus { display: inline-flex; align-items: center; gap: 7px; color: var(--positive) !important; }
.pm-sg-done .btn { max-width: 420px; }

.pm-prepared { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--accent-tint); border: 1px solid var(--accent-tint-border); margin-bottom: 18px; }
.pm-prepared-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent-tint-border); color: var(--accent); display: grid; place-items: center; }
.pm-prepared-t { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; color: var(--text); }
.pm-prepared-s { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.pm-prepared-s strong { color: var(--text); }
.pm-narrow .pm-prepared { flex-wrap: wrap; }
