/* ==========================================================================
   Kundenbereich & Verwaltung – baut auf css/main.css auf (Variablen, Karten, Formulare)
   ========================================================================== */
.no-scroll { overflow: hidden; }
.muted { color: var(--muted); }
.muted.sm, .sm.muted { font-size: .9rem; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600; color: var(--primary); }
.link-btn .icon { width: 16px; height: 16px; }
.icon-only { padding: 10px; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill .icon { width: 14px; height: 14px; }
.st-active, .st-step-active { background: var(--primary-50); color: var(--primary); border-color: transparent; }
.st-active i { animation: pulse 2s ease-in-out infinite; }
.st-planning { background: color-mix(in srgb, var(--warm) 16%, transparent); color: #a8650a; border-color: transparent; }
.st-paused { background: var(--bg-soft); color: var(--muted); }
.st-done, .st-step-done { background: var(--accent-50); color: var(--accent-ink); border-color: transparent; }
.st-step-open { background: var(--bg-soft); }
.pill-internal { background: color-mix(in srgb, var(--warm) 18%, transparent); color: #9a5b06; border-color: transparent; font-size: .72rem; padding: 3px 9px; }
.pill-preview { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
:root[data-theme="dark"] .st-planning { color: #ffc56b; }
:root[data-theme="dark"] .pill-internal { color: #ffc56b; }
.pv-num { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: .82rem; font-weight: 600; color: var(--muted); }
.pv-num .icon { width: 14px; height: 14px; }

/* ---------- Fortschrittsbalken ---------- */
.pbar { position: relative; height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; flex: 1; box-shadow: inset 0 0 0 1px var(--line); }
.pbar i { position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: inherit; background: var(--grad); transition: width 1.2s var(--ease); }
.pv-pline { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; }
.pv-pline b { font-family: var(--font-display); color: var(--ink); font-size: .95rem; min-width: 40px; text-align: right; }

/* ---------- Login-Seite ---------- */
.portal-teaser { margin-top: 22px; padding: 22px 26px; border-radius: var(--radius); border: 1px dashed var(--line-strong); }
.pt-row { display: flex; align-items: center; }
.pt-dot { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); }
.pt-dot .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.pt-dot.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.pt-dot.active { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 6px var(--primary-50); }
.pt-line { flex: 1; height: 3px; background: var(--line); }
.pt-line.done { background: var(--accent); }
.pt-line.half { background: linear-gradient(90deg, var(--accent), var(--primary) 50%, var(--line) 50%); }
.pt-labels { display: flex; justify-content: space-between; margin-top: 10px; font-size: .8rem; color: var(--muted); font-weight: 600; }

/* ---------- Projekt-Kopf ---------- */
.portal-app { animation: fadeUp .6s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pv-hero {
  position: relative; padding: 56px 0 0; color: #fff; isolation: isolate;
  background: radial-gradient(900px 480px at 85% -10%, rgba(59,108,255,.55), transparent 60%),
              radial-gradient(700px 400px at 10% 120%, rgba(15,179,155,.35), transparent 60%), var(--navy);
}
.pv-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(180deg, #000, transparent 85%); }
.pv-hero-in { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.pv-tags { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.pv-hero .pv-num { color: #b9c4e4; background: rgba(255,255,255,.08); padding: 4px 10px; border-radius: 8px; }
.pv-hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.2rem); letter-spacing: -.035em; }
.pv-sub { color: #c6d0ea; font-size: 1.12rem; margin-top: 10px; max-width: 640px; }
.pv-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 20px; color: #aab6d6; font-size: .92rem; }
.pv-meta span { display: inline-flex; align-items: center; gap: 7px; }
.pv-meta .icon { width: 17px; height: 17px; color: #7f9bff; }
.pv-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.pv-ring { position: relative; width: 196px; height: 196px; }
.pv-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pv-ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.pv-ring-bg { stroke: rgba(255,255,255,.1); }
.pv-ring-fg { stroke: url(#pvg); transition: stroke-dashoffset 1.8s var(--ease); filter: drop-shadow(0 0 10px rgba(59,108,255,.5)); }
.pv-ring-val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pv-ring-val strong { font-family: var(--font-display); font-size: 3rem; line-height: 1; letter-spacing: -.04em; }
.pv-ring-val small { font-size: 1.2rem; color: #aab6d6; margin-left: 2px; }
.pv-ring-val span { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: #aab6d6; margin-top: 6px; }
.pv-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; transform: translateY(50%); position: relative; z-index: 2; }
.pv-kpi { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); }
.pv-kpi > .icon { width: 40px; height: 40px; padding: 9px; border-radius: 11px; background: var(--primary-50); color: var(--primary); }
.pv-kpi b { display: block; font-family: var(--font-display); font-size: 1.32rem; color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
.pv-kpi small { color: var(--muted); font-size: .82rem; }
.pv-kpi:nth-child(2) > .icon { background: var(--accent-50); color: var(--accent-ink); }
.pv-kpi:nth-child(3) > .icon { background: color-mix(in srgb, var(--warm) 18%, transparent); color: #b36b00; }
:root[data-theme="dark"] .pv-kpi:nth-child(3) > .icon { color: #ffc56b; }
.pv-main { padding-top: 110px; padding-bottom: 90px; }

/* ---------- Roadmap ---------- */
.roadmap { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; padding: 30px 26px 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin-bottom: 30px; overflow-x: auto; }
.rm-track { position: absolute; top: 52px; left: calc(26px + (100% - 52px) / var(--n) / 2); right: calc(26px + (100% - 52px) / var(--n) / 2); height: 4px; border-radius: 4px; background: var(--line); }
.rm-fill { height: 100%; width: calc(var(--f) * 100%); border-radius: inherit; background: var(--grad); transition: width 1.4s var(--ease); }
.rm-node { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 4px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--text); min-width: 96px; }
.rm-dot { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--line-strong); color: var(--muted); font-family: var(--font-display); font-size: 1.05rem; transition: transform .3s var(--ease), box-shadow .3s; margin-bottom: 6px; z-index: 1; }
.rm-node:hover .rm-dot { transform: scale(1.08); }
.rm-node.done .rm-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.rm-node.done .rm-dot .icon { width: 22px; height: 22px; stroke-width: 2.8; }
.rm-node.active .rm-dot { border-color: var(--primary); color: var(--primary); background: conic-gradient(var(--primary-50) calc(var(--sp) * 1%), var(--surface) 0); box-shadow: 0 0 0 7px var(--primary-50); animation: ringPulse 2.4s ease-in-out infinite; }
@keyframes ringPulse { 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--primary) 8%, transparent); } }
.rm-title { font-weight: 700; color: var(--ink); font-size: .92rem; line-height: 1.3; }
.rm-sub { font-size: .78rem; color: var(--muted); }
.rm-node.open .rm-title { color: var(--muted); }

/* ---------- Tabs ---------- */
.pv-tabs { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; scrollbar-width: none; }
.pv-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 0; background: none; cursor: pointer; font: inherit; font-size: .92rem; font-weight: 600; color: var(--muted); white-space: nowrap; transition: all .2s; }
.pv-tab .icon { width: 17px; height: 17px; }
.pv-tab small { font-size: .74rem; padding: 1px 7px; border-radius: 99px; background: var(--line); color: var(--muted); }
.pv-tab:hover { color: var(--ink); }
.pv-tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pv-tab.on .icon { color: var(--primary); }
.pv-panel { animation: fadeUp .45s var(--ease); }

/* ---------- Überblick ---------- */
.pv-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; align-items: start; }
.pv-col { display: grid; gap: 22px; }
.pv-card { padding: 26px 28px; }
.pv-card > .eyebrow { margin-bottom: 14px; }
.pv-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.pv-card-head .eyebrow { margin: 0; }
.pv-card h3 { font-size: 1.4rem; margin-bottom: 8px; }
.pv-current { border-top: 3px solid var(--primary); }
.pv-text { color: var(--text); font-size: .98rem; }
.pv-text p + p, .pv-text p + ul, .pv-text ul + p { margin-top: 10px; }
.pv-text ul { margin: 6px 0 0; padding-left: 20px; }
.pv-text li { margin: 3px 0; }
.pv-text a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.pv-text.sm { font-size: .9rem; color: var(--muted); }
.checklist { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: .95rem; color: var(--ink); }
.checklist li:nth-child(odd) { background: var(--bg-soft); }
.checklist li.done span:not(.cb) { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.checklist small { margin-left: auto; color: var(--muted); font-size: .8rem; }
.cb { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--line-strong); display: grid; place-items: center; background: var(--surface); }
.cb .icon { width: 14px; height: 14px; stroke-width: 3; }
.done > .cb, li.done .cb, .done > .sub-line .cb { background: var(--accent); border-color: var(--accent); color: #fff; }
.active > .cb, li.active .cb { border-color: var(--primary); }
.cb i { width: 8px; height: 8px; border-radius: 3px; background: var(--primary); }
li.active .cb::after { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--primary); }
li.active .cb:has(i)::after { display: none; }
.pv-next { list-style: none; margin: 0; padding: 0; counter-reset: n; display: grid; gap: 12px; }
.pv-next li { counter-increment: n; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; }
.pv-next li::before { content: counter(n); grid-row: span 2; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: .85rem; }
.pv-next b { color: var(--ink); font-size: .95rem; }
.pv-next small { color: var(--muted); font-size: .82rem; }
.pv-dates { list-style: none; margin: 0; padding: 0; position: relative; }
.pv-dates li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 10px 22px; border-bottom: 1px dashed var(--line); font-size: .92rem; position: relative; }
.pv-dates li:last-child { border: 0; }
.pv-dates li::before { content: ""; position: absolute; left: 2px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.pv-dates li.past::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-50); }
.pv-dates li.past span { color: var(--muted); }
.pv-dates b { color: var(--ink); white-space: nowrap; }
.pv-contact { display: grid; gap: 10px; }
.pv-contact > a { display: inline-flex; align-items: center; gap: 9px; color: var(--primary); font-size: .92rem; font-weight: 500; word-break: break-all; }
.pv-contact > a .icon { width: 17px; height: 17px; }
.pv-person { display: flex; align-items: center; gap: 14px; }
.pv-person img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: var(--bg-tint); }
.pv-person b { display: block; color: var(--ink); }
.pv-person small { color: var(--muted); font-size: .85rem; }

/* ---------- Updates ---------- */
.pv-feed { display: grid; gap: 14px; }
.pv-update { display: grid; grid-template-columns: 42px 1fr; gap: 14px; }
.pv-u-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.pv-u-icon .icon { width: 20px; height: 20px; }
.k-milestone .pv-u-icon, .pv-u-icon.k-milestone { background: var(--accent-50); color: var(--accent-ink); }
.k-feedback .pv-u-icon, .pv-u-icon.k-feedback { background: color-mix(in srgb, var(--warm) 20%, transparent); color: #b36b00; }
.k-delivery .pv-u-icon, .pv-u-icon.k-delivery { background: color-mix(in srgb, #8b5cf6 14%, transparent); color: #7c3aed; }
.k-note .pv-u-icon, .pv-u-icon.k-note { background: var(--bg-soft); color: var(--muted); }
.pv-u-body { min-width: 0; }
.pv-u-body header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pv-kind { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); }
.k-milestone .pv-kind { color: var(--accent-ink); }
.k-feedback .pv-kind { color: #b36b00; }
.k-delivery .pv-kind { color: #7c3aed; }
.k-note .pv-kind { color: var(--muted); }
.pv-u-body time { margin-left: auto; font-size: .82rem; color: var(--dim); }
.pv-u-body h4 { font-size: 1.08rem; color: var(--ink); margin: 4px 0 2px; font-family: var(--font-display); letter-spacing: -.01em; }
.pv-where { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.pv-where .icon { width: 14px; height: 14px; }
.pv-u-body .pv-text { margin-top: 6px; }
.pv-update.compact { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pv-update.compact:last-child { border: 0; padding-bottom: 0; }
.pv-update.compact .pv-u-icon { width: 36px; height: 36px; border-radius: 10px; }
.pv-update.compact { grid-template-columns: 36px 1fr; }
.pv-update.compact .pv-text { font-size: .92rem; }
.pv-update.internal { opacity: .85; }
.timeline-feed { position: relative; gap: 0; }
.timeline-feed .pv-update { padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-left: 34px; position: relative; margin-bottom: 16px; }
.timeline-feed::before { content: ""; position: absolute; left: 11px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(var(--line-strong), transparent); }
.timeline-feed .pv-update::before { content: ""; position: absolute; left: -29px; top: 30px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline-feed .k-milestone::before { border-color: var(--accent); }
.timeline-feed .k-feedback::before { border-color: var(--warm); }
.pv-month { margin: 8px 0 14px 34px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.pv-feed.nested { margin-top: 12px; padding: 16px; border-radius: 12px; background: var(--bg-soft); }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.fchip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); transition: all .2s; }
.fchip small { font-size: .74rem; padding: 0 7px; border-radius: 99px; background: var(--bg-soft); }
.fchip:hover { border-color: var(--line-hover); color: var(--ink); }
.fchip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.fchip.on small { background: rgba(255,255,255,.18); color: inherit; }

/* Medien in Updates */
.pv-media { display: grid; gap: 8px; margin-top: 14px; grid-template-columns: repeat(var(--c, 2), 1fr); max-width: 640px; }
.pv-media.n1 { --c: 1; max-width: 520px; }
.pv-media.n2 { --c: 2; }
.pv-media.n3 { --c: 3; }
.pv-media.n4 { --c: 4; }
.pv-thumb { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--bg-soft); aspect-ratio: 4 / 3; }
.pv-media.n1 .pv-thumb { aspect-ratio: 16 / 10; }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.pv-thumb:hover img { transform: scale(1.04); }
.pv-thumb .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(11,23,54,.6); color: #fff; font-size: 1.4rem; font-weight: 700; }
.pv-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pv-file { display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; text-align: left; color: var(--text); max-width: 100%; transition: border-color .2s, transform .2s; }
.pv-file:hover { border-color: var(--primary); transform: translateY(-1px); }
.pv-file > .icon { width: 30px; height: 30px; padding: 6px; border-radius: 8px; background: var(--primary-50); color: var(--primary); }
.pv-file b { display: block; font-size: .88rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.pv-file small { color: var(--muted); font-size: .76rem; }
.pv-file .go { width: 16px; height: 16px; color: var(--dim); }

/* ---------- Ablauf ---------- */
.pv-plan { display: grid; gap: 14px; }
.pv-step { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: box-shadow .3s, border-color .3s; }
.pv-step[open] { box-shadow: var(--shadow); }
.pv-step.active { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.pv-step.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 35%, transparent); } }
.pv-step summary { display: grid; grid-template-columns: auto 1fr minmax(140px, 220px) auto; gap: 18px; align-items: center; padding: 20px 24px; cursor: pointer; list-style: none; }
.pv-step summary::-webkit-details-marker { display: none; }
.ps-num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; background: var(--bg-soft); color: var(--muted); border: 2px solid var(--line); }
.ps-num .icon { width: 18px; height: 18px; stroke-width: 2.8; }
.ps-num.sm { width: 26px; height: 26px; border-radius: 8px; font-size: .78rem; border-width: 1.5px; }
.ps-num.sm .icon { width: 13px; height: 13px; }
.done > summary .ps-num, .ps-num.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.active > summary .ps-num, .ps-num.active { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }
.ps-head b { display: block; color: var(--ink); font-size: 1.08rem; font-family: var(--font-display); letter-spacing: -.01em; }
.ps-head small { color: var(--muted); font-size: .84rem; }
.ps-prog { display: flex; align-items: center; gap: 10px; }
.ps-prog b { font-size: .86rem; color: var(--ink); min-width: 38px; text-align: right; }
.ps-chev { width: 20px; height: 20px; color: var(--dim); transition: transform .3s var(--ease); }
.pv-step[open] .ps-chev { transform: rotate(180deg); }
.ps-body { padding: 0 24px 24px 82px; }
.ps-body > .pv-text { margin-bottom: 14px; color: var(--muted); }
.ps-subs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--line); }
.ps-subs > li { padding: 10px 0 10px 18px; position: relative; }
.sub-line { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: start; }
.sub-line b { color: var(--ink); font-weight: 600; font-size: .96rem; }
.ps-subs li.done .sub-line b { color: var(--muted); }
.sub-meta { text-align: right; font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sub-meta small { display: block; font-weight: 400; color: var(--dim); }
.ps-subs li.active .sub-meta { color: var(--primary); }
.ps-subs li.done .sub-meta { color: var(--accent-ink); }
.ps-subs > li::before { content: ""; position: absolute; left: -2px; top: 0; bottom: 0; width: 2px; }
.ps-subs > li.done::before { background: var(--accent); }
.ps-subs > li.active::before { background: var(--primary); }

/* ---------- Zeitplan (Gantt) ---------- */
.pv-gantt { padding: 24px; }
.g-scroll { overflow-x: auto; }
.g-inner { min-width: 760px; position: relative; }
.g-head, .g-row, .g-grid { display: grid; grid-template-columns: 230px 1fr; }
.g-head { height: 34px; border-bottom: 1px solid var(--line); }
.g-lane { position: relative; }
.g-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.g-month span { position: absolute; left: 8px; top: 7px; font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.g-body { position: relative; }
.g-grid { position: absolute; inset: 0; pointer-events: none; }
.g-grid .g-month:nth-child(even) { background: color-mix(in srgb, var(--bg-soft) 70%, transparent); }
.g-row { position: relative; min-height: 54px; border-bottom: 1px dashed var(--line); }
.g-row:last-child { border: 0; }
.g-label { display: flex; align-items: center; gap: 10px; padding-right: 14px; font-size: .9rem; font-weight: 600; color: var(--ink); line-height: 1.25; }
.g-bar { position: absolute; top: 15px; height: 24px; border-radius: 8px; background: var(--primary-100); overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }
.g-bar i { position: absolute; inset: 0 auto 0 0; background: var(--primary); border-radius: 8px 0 0 8px; }
.g-bar.done { background: var(--accent); box-shadow: none; }
.g-bar.done i { background: var(--accent); }
.g-bar.open { background: var(--bg-soft); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.g-bar.open i { background: transparent; }
.g-bar.active i { background: var(--grad); }
.g-mark { position: absolute; top: 21px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); border-radius: 2px; background: var(--surface); border: 2px solid var(--primary); z-index: 1; }
.g-mark.done { background: var(--accent); border-color: var(--surface); }
.g-today { position: absolute; top: -34px; bottom: 0; width: 2px; margin-left: -1px; background: #ef4444; z-index: 2; }
.g-today span { position: absolute; top: 4px; left: 6px; font-size: .7rem; font-weight: 700; color: #fff; background: #ef4444; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.g-goal { position: absolute; top: -34px; bottom: 0; border-left: 2px dashed var(--accent); z-index: 1; }
.g-goal span { position: absolute; bottom: 4px; left: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-50); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.g-goal .icon { width: 12px; height: 12px; }
.g-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-size: .82rem; color: var(--muted); }
.g-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { width: 18px; height: 10px; border-radius: 4px; display: inline-block; }
.lg.done { background: var(--accent); }
.lg.active { background: var(--grad); }
.lg.open { background: var(--bg-soft); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.lg.mark { width: 10px; height: 10px; transform: rotate(45deg); border: 2px solid var(--primary); border-radius: 2px; }

/* ---------- Dateien ---------- */
.pv-h { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; margin: 6px 0 16px; }
.pv-h .icon { color: var(--primary); }
.pv-h small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.pv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 34px; }
.pv-g-item { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--surface); text-align: left; font: inherit; transition: transform .3s var(--ease), box-shadow .3s; }
.pv-g-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pv-g-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--bg-soft); }
.pv-g-item span { display: block; padding: 10px 12px; }
.pv-g-item b { display: block; font-size: .86rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-g-item small { font-size: .76rem; color: var(--muted); }
.pv-doclist { padding: 8px; }
.pv-doc { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; }
.pv-doc:hover { background: var(--bg-soft); }
.pv-doc .fi { width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--primary-50); color: var(--primary); }
.pv-doc > div { flex: 1; min-width: 0; }
.pv-doc b { display: block; color: var(--ink); font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-doc small { color: var(--muted); font-size: .8rem; }

/* ---------- Vertrag ---------- */
.pv-facts { display: grid; gap: 4px; padding: 14px; }
.pv-dl { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; }
.pv-dl:nth-child(odd) { background: var(--bg-soft); }
.pv-dl > .icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--surface); color: var(--primary); border: 1px solid var(--line); }
.pv-dl small { display: block; font-size: .78rem; color: var(--muted); }
.pv-dl b { color: var(--ink); font-size: .98rem; }

.pv-empty { display: grid; place-items: center; gap: 12px; text-align: center; padding: 56px 24px; border-radius: var(--radius); border: 1px dashed var(--line-strong); color: var(--muted); }
.pv-empty .icon { width: 34px; height: 34px; color: var(--primary); }
.pv-empty p { max-width: 420px; }

/* ---------- Betrachter ---------- */
.viewer { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr; background: rgba(6,10,22,.94); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s, visibility 0s .25s; color: #fff; }
.viewer.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s; }
.v-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; }
.v-bar > div { flex: 1; min-width: 0; }
.v-bar b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-bar small { color: #9aa6c4; font-size: .82rem; }
.v-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: inherit; cursor: pointer; transition: background .2s; flex: none; }
.v-btn:hover { background: rgba(255,255,255,.14); }
.v-btn .icon { width: 19px; height: 19px; }
.v-stage { display: grid; place-items: center; padding: 0 70px 30px; min-height: 0; }
.v-stage img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); animation: zoomIn .3s var(--ease); }
@keyframes zoomIn { from { transform: scale(.96); opacity: 0; } }
.v-stage iframe { width: min(1000px, 100%); height: calc(100vh - 110px); border: 0; border-radius: 8px; background: #fff; }
.v-stage video { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; }
.v-other { display: grid; place-items: center; gap: 12px; text-align: center; max-width: 380px; color: #c6d0ea; }
.v-other .icon { width: 48px; height: 48px; color: #7f9bff; }
.v-nav { position: absolute; top: 50%; width: 50px; height: 50px; margin-top: -25px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.v-nav:hover { background: rgba(255,255,255,.18); }
.v-prev { left: 14px; } .v-next { right: 14px; }

/* ==========================================================================
   Verwaltung
   ========================================================================== */
.admin-page { background: var(--bg-soft); }
.adm-nav { position: sticky; }
.admin-app { min-height: calc(100vh - 72px); }
.adm-center { display: grid; place-items: center; min-height: 60vh; text-align: center; gap: 10px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.adm-auth { display: grid; place-items: center; padding: 80px 20px; }
.adm-auth-card { width: min(520px, 100%); }
.adm-auth-card code { font-size: .85em; background: var(--bg-soft); padding: 1px 6px; border-radius: 5px; }
.adm-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.adm-top-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 0; flex-wrap: wrap; }
.adm-top .eyebrow { margin-bottom: 6px; }
.adm-h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.03em; }
.adm-top-r { display: flex; gap: 8px; }
.adm-crumb { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.adm-body { padding: 30px 0 90px; }
.adm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 34px; }
.adm-stats .card { padding: 20px 22px; }
.adm-stats b { display: block; font-family: var(--font-display); font-size: 2rem; color: var(--ink); line-height: 1.1; }
.adm-stats small { color: var(--muted); }
.adm-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.adm-list-head h2 { font-size: 1.4rem; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.adm-pcard { text-align: left; font: inherit; cursor: pointer; padding: 24px; display: grid; gap: 6px; color: inherit; }
.adm-pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-hover); }
.adm-pc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.adm-pcard h3 { font-size: 1.18rem; }
.adm-pcard p { font-size: .92rem; }
.adm-pc-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.adm-pc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.adm-pc-meta .icon { width: 14px; height: 14px; }
.warn { color: #b36b00 !important; }
:root[data-theme="dark"] .warn { color: #ffc56b !important; }
.adm-pc-date { color: var(--dim); font-size: .78rem; }

.adm-bar { position: sticky; top: 72px; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.adm-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; flex-wrap: wrap; }
.adm-tabs { display: flex; gap: 4px; overflow-x: auto; }
.adm-actions { display: flex; align-items: center; gap: 10px; }
.adm-pct { font-family: var(--font-display); font-weight: 700; color: var(--primary); }
.adm-savestate { font-size: .82rem; color: var(--muted); }
.adm-savestate.dirty { color: #b36b00; font-weight: 600; }
.btn.pulse { animation: btnPulse 1.8s ease-in-out infinite; }
@keyframes btnPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent); } }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.adm-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.adm-cols.upd { grid-template-columns: 1fr 1fr; }
.adm-sec { padding: 26px; }
.adm-sec-head { margin-bottom: 18px; }
.adm-sec-head h3 { font-size: 1.15rem; }
.adm-sec-head h3 small { font-size: .8rem; color: var(--muted); }
.adm-sec-head p { font-size: .9rem; margin-top: 4px; }
.adm-sec-head a { color: var(--primary); }
.hint { display: block; font-size: .78rem; color: var(--dim); margin-top: 5px; }
.field textarea { min-height: 0; }
.field.sel select, .field.date input { width: 100%; padding: 24px 14px 9px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; outline: none; }
.field.sel select:focus { border-color: var(--primary); }
.field label.up { top: 7px; font-size: .74rem; color: var(--muted); font-weight: 600; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.adm-check { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text); cursor: pointer; margin-top: 12px; }
.adm-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.adm-danger { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }

/* Ablauf-Editor */
.adm-plan-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.adm-plan-head h2 { font-size: 1.4rem; }
.adm-plan-head p { font-size: .9rem; max-width: 640px; }
.adm-step { padding: 0; margin-bottom: 14px; overflow: hidden; }
.adm-step.active { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.adm-step-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.adm-step-title { flex: 1; min-width: 120px; font: inherit; font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; color: var(--ink); border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px 10px; }
.adm-step-title:hover { border-color: var(--line); }
.adm-step-title:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.adm-step-pct { font-size: .85rem; font-weight: 700; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 7px; font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on.open { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button.on.active { background: var(--primary); color: #fff; }
.seg button.on.done { background: var(--accent); color: #fff; }
.adm-mini { display: flex; gap: 4px; }
.admin-page .v-btn, .adm-modal .v-btn { border-color: var(--line); background: var(--surface); color: var(--muted); }
.admin-page .v-btn:hover { color: var(--ink); border-color: var(--line-hover); background: var(--surface); }
.v-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.v-btn.sm .icon { width: 16px; height: 16px; }
.v-btn[disabled] { opacity: .35; cursor: default; }
.adm-step:not(.expanded) [data-toggle] .icon { transform: rotate(-90deg); }
.adm-step-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-soft) 50%, var(--surface)); }
.adm-step-body .form-grid { margin: 14px 0; }
.adm-subs { display: grid; gap: 6px; }
.adm-sub { display: grid; grid-template-columns: 30px minmax(160px, 1.3fr) 162px minmax(140px, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.adm-sub input { font: inherit; font-size: .92rem; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink); min-width: 0; }
.adm-sub input:hover { border-color: var(--line); }
.adm-sub input:focus { outline: none; border-color: var(--primary); }
.adm-sub .adm-sub-desc { color: var(--muted); font-size: .85rem; }
.adm-sub .adm-sub-date { color: var(--muted); font-size: .85rem; }
.adm-sub.done .adm-sub-title { text-decoration: line-through; color: var(--muted); }
.cbx { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; }
.cbx .icon { width: 15px; height: 15px; stroke-width: 3; }
.cbx.active { border-color: var(--primary); }
.cbx.active i { width: 9px; height: 9px; border-radius: 3px; background: var(--primary); }
.cbx.done { background: var(--accent); border-color: var(--accent); }
.adm-sub-add { display: flex; gap: 8px; margin-top: 8px; }
.adm-sub-add input { flex: 1; font: inherit; font-size: .92rem; padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--line-strong); background: var(--surface); color: var(--ink); }
.adm-sub-add input:focus { outline: none; border-style: solid; border-color: var(--primary); }
.adm-step-foot { margin-top: 14px; }

/* Dateien & Upload */
.dropzone { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 18px; border-radius: 14px; border: 2px dashed var(--line-strong); background: var(--bg-soft); cursor: pointer; transition: all .2s; margin-top: 14px; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-50); }
.dropzone > .icon { width: 28px; height: 28px; color: var(--primary); }
.dropzone span { font-size: .92rem; color: var(--text); }
.dropzone small { font-size: .78rem; color: var(--dim); }
.adm-files { display: grid; gap: 6px; }
.adm-file { display: grid; grid-template-columns: 44px 1fr auto auto auto; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.adm-file img, .adm-file .fi { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.adm-file input { font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--ink); min-width: 0; }
.adm-file input:hover { border-color: var(--line); }
.adm-file small { color: var(--muted); font-size: .78rem; }
.compose-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.cf { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 5px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; }
.cf img, .cf > .icon { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; }
.cf > .icon { padding: 9px; background: var(--primary-50); color: var(--primary); }
.cf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.compose-foot .adm-check { margin: 0; }
.compose-foot .btn { margin-left: auto; }
.adm-upd-list { display: grid; gap: 12px; align-content: start; }
.adm-upd-list .adm-sec-head { margin: 0; }
.adm-upd-card { padding: 18px 20px; }
.adm-upd-card header { display: flex; align-items: center; gap: 12px; }
.adm-upd-card header > div { flex: 1; min-width: 0; }
.adm-upd-card header b { display: block; color: var(--ink); }
.adm-upd-card header small { color: var(--muted); font-size: .8rem; }
.adm-upd-card .pv-u-icon { width: 36px; height: 36px; border-radius: 10px; }
.adm-upd-card.internal { border-style: dashed; }
.adm-upd-card.editing { border-color: var(--primary); box-shadow: var(--shadow); }
.adm-upd-card .pv-text { margin-top: 10px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.adm-upd-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.adm-upd-thumbs button { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--bg-soft); height: 56px; }
.adm-upd-thumbs img { width: 72px; height: 56px; object-fit: cover; }
.adm-upd-thumbs .doc { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font: inherit; font-size: .8rem; color: var(--text); max-width: 200px; }
.adm-upd-thumbs .doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Zugang */
.adm-access { display: grid; gap: 10px; }
.adm-access > div { padding: 12px 14px; border-radius: 10px; background: var(--bg-soft); }
.adm-access small { display: block; font-size: .76rem; color: var(--muted); }
.adm-access b { color: var(--ink); word-break: break-all; font-weight: 600; }
.adm-access-btns { display: grid; gap: 12px; margin-top: 18px; }
.adm-ownpw { display: flex; gap: 8px; }
.adm-ownpw input { flex: 1; font: inherit; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.adm-pw-out { margin-top: 16px; padding: 18px; border-radius: 14px; background: var(--accent-50); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); display: grid; gap: 10px; }
.adm-pw-out code { font-size: 1.1rem; font-weight: 700; color: var(--ink); background: var(--surface); padding: 3px 10px; border-radius: 6px; }
.adm-pw-out textarea { font: inherit; font-size: .88rem; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); resize: none; }
.adm-pw-out small { color: var(--muted); }
.adm-tips { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: .92rem; color: var(--muted); }

/* Modal, Toast, Vorschau */
.adm-modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(6,10,22,.5); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.adm-modal.open { opacity: 1; }
.adm-modal-card { width: min(560px, 100%); padding: 26px; box-shadow: var(--shadow-lg); }
.adm-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.adm-modal-foot { display: flex; justify-content: flex-end; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 300; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 12px; background: var(--navy); color: #fff; font-size: .92rem; font-weight: 500; box-shadow: var(--shadow-lg); transition: all .3s var(--ease); max-width: calc(100vw - 40px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.ok { background: var(--accent-ink); }
.toast.err { background: var(--danger); }
.adm-preview { position: fixed; inset: 0; z-index: 120; background: var(--bg); overflow-y: auto; }
.adm-preview-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: #0f172a; color: #fff; font-size: .9rem; font-weight: 600; }
.adm-preview-bar > span { flex: 1; display: inline-flex; align-items: center; gap: 8px; }
.adm-preview-bar .lang { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); }
.adm-preview-bar .lang button { color: #aab6d6; }
.adm-preview-bar .lang button[aria-pressed="true"] { background: #fff; color: #0f172a; }

/* ---------- Dunkles Design ---------- */
:root[data-theme="dark"] .pv-hero { background: radial-gradient(900px 480px at 85% -10%, rgba(59,108,255,.4), transparent 60%), radial-gradient(700px 400px at 10% 120%, rgba(15,179,155,.25), transparent 60%), #070b17; }
:root[data-theme="dark"] .k-delivery .pv-u-icon, :root[data-theme="dark"] .pv-u-icon.k-delivery { color: #b69cff; }
:root[data-theme="dark"] .k-delivery .pv-kind { color: #b69cff; }
:root[data-theme="dark"] .fchip.on small { background: rgba(0,0,0,.15); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .pv-grid, .adm-cols, .adm-cols.upd { grid-template-columns: 1fr; }
  .pv-kpis { grid-template-columns: repeat(2, 1fr); transform: translateY(30%); }
  .pv-main { padding-top: 90px; }
  .adm-stats { grid-template-columns: repeat(2, 1fr); }
  .adm-sub { grid-template-columns: 30px minmax(0, 1fr) 140px auto; }
  .adm-sub .adm-sub-desc { grid-column: 2 / -1; }
}
@media (max-width: 760px) {
  .pv-hero { padding-top: 36px; }
  .pv-hero-in { grid-template-columns: 1fr; gap: 24px; }
  .pv-ring { width: 150px; height: 150px; order: -1; }
  .pv-ring-val strong { font-size: 2.3rem; }
  .pv-kpis { transform: none; margin-top: 28px; padding-bottom: 28px; }
  .pv-kpi { padding: 14px; gap: 10px; }
  .pv-kpi > .icon { width: 34px; height: 34px; padding: 7px; }
  .pv-kpi b { font-size: 1.1rem; }
  .pv-main { padding-top: 28px; }
  .roadmap { grid-template-columns: repeat(var(--n), 110px); padding: 24px 16px 18px; }
  .rm-track { top: 46px; left: 71px; right: auto; width: calc((var(--n) - 1) * 118px); }
  .pv-step summary { grid-template-columns: auto 1fr auto; padding: 16px; gap: 12px; }
  .ps-prog { grid-column: 1 / -1; }
  .ps-body { padding: 0 16px 18px; }
  .pv-media.n3, .pv-media.n4 { --c: 2; }
  .timeline-feed .pv-update { margin-left: 26px; padding: 16px; }
  .timeline-feed .pv-update::before { left: -21px; }
  .timeline-feed::before { left: 7px; }
  .pv-month { margin-left: 26px; }
  .pv-update { grid-template-columns: 1fr; }
  .pv-update .pv-u-icon { display: none; }
  .pv-update.compact { grid-template-columns: 1fr; }
  .v-stage { padding: 0 10px 20px; }
  .v-nav { top: auto; bottom: 18px; }
  .adm-step-head { flex-wrap: wrap; }
  .adm-step-title { flex-basis: 100%; order: -1; }
  .adm-sub { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .adm-sub .adm-sub-date, .adm-sub .adm-sub-desc { grid-column: 2 / -1; }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
  .adm-top-r .btn { padding: 8px 10px; font-size: .82rem; }
  .adm-bar { top: 64px; }
  .adm-actions .adm-savestate { display: none; }
  .adm-file { grid-template-columns: 44px 1fr auto auto; }
  .adm-file small { display: none; }
}

/* Eingabefelder dürfen in schmalen Rastern schrumpfen */
.admin-page .form-grid > *, .adm-sub > *, .adm-step-body { min-width: 0; }
.admin-page .field input, .admin-page .field textarea, .admin-page .field select { min-width: 0; max-width: 100%; }
@media (max-width: 760px) {
  .adm-plan-head { flex-direction: column; align-items: flex-start; }
  .adm-step-body { padding: 4px 12px 14px; }
  .adm-step-body .form-grid.three { grid-template-columns: 1fr 1fr; }
  .adm-step-body .form-grid.three > div:empty { display: none; }
  .admin-page .form-grid { grid-template-columns: 1fr; }
  .admin-page .form-grid.three { grid-template-columns: 1fr 1fr; }
}
.adm-subs { grid-template-columns: minmax(0, 1fr); }
.adm-sub-add input { min-width: 0; }
@media (max-width: 760px) {
  .adm-upd-card header { flex-wrap: wrap; }
  .adm-upd-card header > div { flex: 1 1 calc(100% - 50px); }
  .adm-upd-card header .pill { margin-left: 48px; }
  .adm-upd-card header .v-btn:first-of-type { margin-left: auto; }
  .adm-nav .btn-ghost { padding: 8px 10px; font-size: .82rem; }
}

/* ==========================================================================
   Updates direkt im Ablauf – aufklappbare Zeilen im Stil eines Teilschritts
   ========================================================================== */
.ur-list { display: grid; gap: 6px; margin-top: 8px; }
.ur-list.phase { margin-top: 6px; }
.ps-subs .ur-list { margin: 8px 0 2px 34px; }
.ur-head { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.ur-head .icon { width: 14px; height: 14px; }
.upd-row { border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, box-shadow .2s; position: relative; }
.upd-row::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); opacity: .8; }
.upd-row.k-milestone::before { background: var(--accent); }
.upd-row.k-feedback::before { background: var(--warm); }
.upd-row.k-delivery::before { background: #8b5cf6; }
.upd-row.k-note::before { background: var(--line-strong); }
.upd-row.internal { border-style: dashed; background: color-mix(in srgb, var(--warm) 5%, var(--surface)); }
.upd-row:hover { border-color: var(--line-hover); }
.upd-row[open] { box-shadow: var(--shadow-sm); border-color: var(--line-hover); }
.upd-row > summary { list-style: none; display: grid; grid-template-columns: 30px 1fr auto 18px; gap: 12px; align-items: center; padding: 8px 12px; cursor: pointer; border-radius: 12px; }
.upd-row > summary::-webkit-details-marker { display: none; }
.upd-row > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ur-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.ur-icon .icon { width: 15px; height: 15px; }
.k-milestone .ur-icon { background: var(--accent-50); color: var(--accent-ink); }
.k-feedback .ur-icon { background: color-mix(in srgb, var(--warm) 20%, transparent); color: #b36b00; }
.k-delivery .ur-icon { background: color-mix(in srgb, #8b5cf6 14%, transparent); color: #7c3aed; }
.k-note .ur-icon { background: var(--bg-soft); color: var(--muted); }
.ur-main { min-width: 0; }
.ur-main b { display: block; color: var(--ink); font-weight: 600; font-size: .94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ur-main small { display: block; font-size: .78rem; color: var(--dim); margin-top: 1px; }
.ur-kind { font-weight: 700; color: var(--primary); }
.k-milestone .ur-kind { color: var(--accent-ink); }
.k-feedback .ur-kind { color: #b36b00; }
.k-delivery .ur-kind { color: #7c3aed; }
.k-note .ur-kind { color: var(--muted); }
.ur-int { display: inline-flex; align-items: center; gap: 3px; color: #b36b00; font-weight: 600; }
.ur-int .icon { width: 11px; height: 11px; }
.ur-meta { display: flex; gap: 10px; color: var(--dim); font-size: .8rem; }
.ur-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ur-meta .icon { width: 14px; height: 14px; }
.ur-chev { width: 18px; height: 18px; color: var(--dim); transition: transform .3s var(--ease); }
.upd-row[open] .ur-chev { transform: rotate(180deg); }
.ur-body { padding: 4px 16px 16px 54px; animation: fadeUp .3s var(--ease); }
.ur-body .pv-media, .ur-body .pv-files { margin-top: 12px; }
.ur-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pv-general { margin-top: 18px; }
.pv-general .ur-list { margin-top: 12px; }
:root[data-theme="dark"] .k-feedback .ur-icon, :root[data-theme="dark"] .k-feedback .ur-kind, :root[data-theme="dark"] .ur-int { color: #ffc56b; }
:root[data-theme="dark"] .k-delivery .ur-icon, :root[data-theme="dark"] .k-delivery .ur-kind { color: #b69cff; }

/* Admin-Ablauf: Updates je Teilschritt / Phase */
.adm-sub-wrap { display: grid; }
.adm-sub-upds { display: grid; gap: 6px; margin: 6px 0 6px 38px; padding-left: 12px; border-left: 2px solid var(--primary-100); }
.adm-phase-upds { margin-top: 14px; display: grid; gap: 6px; justify-items: start; }
.adm-phase-upds > .ur-list, .adm-phase-upds > .adm-compose { width: 100%; }
.adm-phase-upds .ur-head { margin-top: 4px; }
.adm-general { margin-top: 18px; display: grid; gap: 12px; justify-items: start; }
.adm-general > * { width: 100%; }
.adm-general > .link-btn { width: auto; }
.adm-general .adm-sec-head { margin: 0; }
.adm-general h3 { display: flex; align-items: center; gap: 8px; }
.adm-general h3 .icon { width: 18px; height: 18px; color: var(--primary); }
.adm-step-upd { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--primary); background: var(--primary-50); padding: 3px 8px; border-radius: 999px; }
.adm-step-upd .icon { width: 13px; height: 13px; }
.adm-plan-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.v-btn.upd-add { position: relative; color: var(--primary); }
.v-btn.upd-add.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.v-btn.upd-add em { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--primary); color: #fff; font-style: normal; font-size: .66rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.adm-compose.inline { padding: 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line)); background: var(--surface); box-shadow: 0 0 0 4px var(--primary-50); animation: fadeUp .3s var(--ease); }
.adm-compose.inline .dropzone { padding: 14px; }
.compose-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.compose-head > .icon { width: 18px; height: 18px; color: var(--primary); }
.compose-head b { color: var(--ink); }
.compose-head span { font-size: .85rem; color: var(--muted); padding: 2px 9px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--line); }
.compose-head .v-btn { margin-left: auto; }
.adm-sub-upds .adm-upd-card.editing, .adm-phase-upds .adm-upd-card.editing, .adm-general .adm-upd-card.editing { margin: 0; }

/* ==========================================================================
   Datumswähler (eigener Kalender statt Browser-Standard)
   ========================================================================== */
.dp { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.dp-btn { display: inline-flex; align-items: center; gap: 9px; width: 100%; min-width: 0; font: inherit; font-size: .94rem; color: var(--ink); text-align: left; cursor: pointer;
  padding: 10px 36px 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.dp-btn > .icon { width: 17px; height: 17px; flex: none; color: var(--primary); }
.dp-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-btn:hover { border-color: var(--line-hover); }
.dp-btn:focus-visible, .dp-btn.open { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.dp.empty .dp-btn { color: var(--dim); border-style: dashed; padding-right: 12px; }
.dp.empty .dp-btn > .icon { color: var(--dim); }
.dp-x { position: absolute; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--dim); display: grid; place-items: center; cursor: pointer; }
.dp-x:hover { background: var(--bg-soft); color: var(--danger, #d4334a); }
.dp-x .icon { width: 14px; height: 14px; }
.dp.sm .dp-btn { font-size: .84rem; padding: 6px 30px 6px 9px; border-radius: 9px; border-color: transparent; background: none; gap: 7px; color: var(--muted); }
.dp.sm .dp-btn > .icon { width: 15px; height: 15px; }
.dp.sm .dp-btn:hover { border-color: var(--line); }
.dp.sm.empty .dp-btn { border-style: solid; border-color: transparent; color: var(--line-hover); padding-right: 9px; }
.dp.sm.empty .dp-btn:hover { border-color: var(--line); color: var(--dim); }
.dp.sm .dp-btn.open { border-color: var(--primary); }
.dp.sm .dp-x { right: 3px; width: 22px; height: 22px; opacity: 0; }
.dp.sm:hover .dp-x, .dp.sm .dp-x:focus-visible { opacity: 1; }
.field.dpf { display: grid; gap: 6px; align-content: start; }
.dpf-label { font-size: .74rem; font-weight: 600; color: var(--muted); padding-left: 2px; }
.field.dpf .dp { width: 100%; }
.field.dpf .dp-btn { padding-top: 13px; padding-bottom: 13px; }

.dp-pop { position: fixed; z-index: 400; width: 304px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(11, 23, 54, .06), 0 28px 60px -20px rgba(11, 23, 54, .35); opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left; transition: opacity .18s, transform .22s var(--ease); }
.dp-pop.in { opacity: 1; transform: none; }
.dp-head { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 2px; margin-bottom: 10px; }
.dp-head b { text-align: center; font-family: var(--font-display); font-size: 1rem; color: var(--ink); letter-spacing: -.01em; }
.dp-head b span { color: var(--primary); }
.dp-nav { width: 30px; height: 30px; border-radius: 9px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.dp-nav:hover { background: var(--bg-soft); color: var(--ink); }
.dp-nav .icon { width: 16px; height: 16px; grid-area: 1 / 1; }
.dp-nav.dbl .icon:first-child { transform: translateX(-3px); }
.dp-nav.dbl .icon:last-child { transform: translateX(3px); }
.dp-wd, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd span { text-align: center; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); padding: 4px 0 6px; }
.dp-wd span.we { color: color-mix(in srgb, var(--primary) 55%, var(--dim)); }
.dp-day { position: relative; height: 36px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: .88rem; font-weight: 500; color: var(--ink); cursor: pointer; transition: background .15s, color .15s, transform .15s; }
.dp-day:hover { background: var(--primary-50); color: var(--primary); }
.dp-day.we { color: var(--muted); }
.dp-day.out { color: var(--line-hover); }
.dp-day.today { font-weight: 700; color: var(--primary); }
.dp-day.today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.dp-day.sel { background: var(--grad); color: #fff; font-weight: 700; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
.dp-day.sel::after { background: #fff; }
.dp-day:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.dp-day:active { transform: scale(.94); }
.dp-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft); font: inherit; font-size: .78rem; font-weight: 600; color: var(--text); cursor: pointer; }
.dp-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.dp-chip.clear { margin-left: auto; color: var(--muted); background: none; }
.dp-chip.clear:hover { color: var(--danger, #d4334a); border-color: var(--danger, #d4334a); background: none; }
.dp-chip .icon { width: 12px; height: 12px; }
:root[data-theme="dark"] .dp-pop { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7); }

/* ==========================================================================
   Vorlagen
   ========================================================================== */
.adm-modal.wide .adm-modal-card { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.tpl-pick-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; }
.tpl-pick-head b { color: var(--ink); font-size: .95rem; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tpl-opt { position: relative; cursor: pointer; }
.tpl-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-card { position: relative; display: grid; gap: 4px; align-content: start; height: 100%; padding: 14px 14px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.tpl-card b { color: var(--ink); font-size: .95rem; }
.tpl-card small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.tpl-card em { font-style: normal; font-size: .74rem; font-weight: 700; color: var(--primary); margin-top: 4px; }
.tpl-opt:hover .tpl-card { border-color: var(--line-hover); transform: translateY(-1px); }
.tpl-opt input:checked + .tpl-card { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.tpl-opt input:focus-visible + .tpl-card { outline: 2px solid var(--primary); outline-offset: 2px; }
.tpl-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); margin-bottom: 4px; }
.tpl-ic .icon { width: 16px; height: 16px; }
.tpl-tick { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--primary); color: #fff; stroke-width: 3; opacity: 0; transform: scale(.6); transition: all .2s var(--ease); }
.tpl-opt input:checked + .tpl-card .tpl-tick { opacity: 1; transform: none; }
.tpl-card-l { display: grid; gap: 12px; align-content: start; }
.tpl-l-head { display: flex; gap: 12px; align-items: center; }
.tpl-l-head .tpl-ic { margin: 0; width: 40px; height: 40px; }
.tpl-l-head h3 { font-size: 1.12rem; }
.tpl-l-head small { color: var(--muted); font-size: .8rem; }
.tpl-card-l > p { font-size: .9rem; }
.tpl-phases { list-style: none; counter-reset: tp; margin: 0; padding: 0; display: grid; gap: 4px; }
.tpl-phases li { counter-increment: tp; display: flex; align-items: center; gap: 10px; font-size: .86rem; padding: 6px 10px; border-radius: 9px; background: var(--bg-soft); }
.tpl-phases li::before { content: counter(tp); width: 20px; height: 20px; flex: none; border-radius: 6px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--surface); color: var(--primary); border: 1px solid var(--line); }
.tpl-phases b { flex: 1; font-weight: 600; color: var(--ink); }
.tpl-phases small { color: var(--dim); font-size: .76rem; }
.tpl-l-foot { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.tpl-l-foot .btn { margin-right: auto; }
.adm-sub.tpl-sub { grid-template-columns: 30px minmax(160px, 1.2fr) minmax(140px, 1fr) auto; }
.adm-sub.tpl-sub .cbx { cursor: default; }
.muted.sm { font-size: .85rem; }
