:root{
  --bg:#f3f5f8; --card:#fff; --ink:#1b2430; --muted:#64748b; --line:#e2e8f0;
  --brand:#0C927B; --brand-rgb:12,146,123; --brand-ink:#fff; --brand-ink-soft:rgba(255,255,255,.82); --brand-hover:rgba(255,255,255,.14); --brand-tint:#E7F4F2; --brand-tint2:#CFE9E5; --brand-dark:#096D5C; --accent:#2563eb; --accent-ink:#fff; --ok:#15803d; --warn:#b45309; --bad:#b91c1c;
  --radius:10px; --shadow:0 1px 2px rgba(16,24,40,.06),0 1px 3px rgba(16,24,40,.08);
}
*{box-sizing:border-box}
html,body{margin:0}
body{font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink)}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
h1{font-size:1.45rem;margin:0 0 .2rem}
h2{font-size:1.1rem;margin:0 0 .75rem}
h3{font-size:1rem;margin:1rem 0 .5rem}
small,.muted{color:var(--muted)}

/* ---------- Kopfzeile ---------- */
.top{display:flex;align-items:center;gap:.75rem;background:var(--brand);color:var(--brand-ink);padding:.5rem 1rem;position:sticky;top:0;z-index:20;flex-wrap:wrap}
.top a{color:var(--brand-ink-soft)}
.brand{font-weight:700;color:var(--brand-ink)!important;font-size:1.05rem;margin-right:.5rem;white-space:nowrap}
.top nav{display:flex;gap:.15rem;flex-wrap:wrap;flex:1}
.top nav a{padding:.35rem .6rem;border-radius:7px;white-space:nowrap}
.top nav a:hover,.top nav a.on{background:var(--brand-hover);color:var(--brand-ink);text-decoration:none}
.badge{display:inline-block;min-width:1.25rem;padding:0 .35rem;border-radius:99px;background:#ef4444;color:#fff;font-size:.72rem;font-weight:700;text-align:center;line-height:1.25rem;margin-left:.2rem}
.badge.gray{background:#94a3b8}
.timer{display:flex;align-items:center;gap:.5rem;background:var(--brand-hover);padding:.25rem .5rem;border-radius:8px}
.timer .live{font-variant-numeric:tabular-nums;font-weight:700;font-size:1.05rem;color:var(--brand-ink)}
.timer small{color:var(--brand-ink-soft);max-width:16rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dot{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 0 rgba(34,197,94,.7);animation:pulse 1.6s infinite}
@keyframes pulse{70%{box-shadow:0 0 0 8px rgba(34,197,94,0)}100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}}
.user{display:flex;gap:.5rem;align-items:center;white-space:nowrap}
.menu-btn{display:none;background:none;border:0;color:var(--brand-ink);font-size:1.5rem;cursor:pointer;margin-left:auto}
@media (max-width:980px){
  .menu-btn{display:block}
  .top nav,.top .user{display:none;width:100%}
  body.nav-open .top nav{display:flex;flex-direction:column}
  body.nav-open .top .user{display:flex;padding:.4rem .6rem}
  .timer{order:3;width:100%;justify-content:space-between}
}

/* ---------- Layout ---------- */
main{max-width:1280px;margin:0 auto;padding:1.25rem 1rem 3rem}
.head{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:1rem 1.1rem;margin-bottom:1rem}
.grid{display:grid;gap:1rem}
.g2{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
.g3{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.g4{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.row{display:flex;gap:.6rem;flex-wrap:wrap;align-items:flex-end}
.row>*{flex:1 1 140px}
.row>.shrink{flex:0 0 auto}
.stat{font-size:1.9rem;font-weight:700;font-variant-numeric:tabular-nums}
.right{text-align:right}
.nowrap{white-space:nowrap}
.pre{white-space:pre-wrap}

/* ---------- Formulare ---------- */
label{display:block;font-size:.82rem;font-weight:600;color:#334155;margin-bottom:.2rem}
input,select,textarea{width:100%;font:inherit;padding:.5rem .6rem;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:var(--ink)}
input:focus,select:focus,textarea:focus{outline:2px solid #93c5fd;border-color:var(--accent)}
input[type=checkbox]{width:auto;margin-right:.35rem}
input[type=color]{padding:2px;height:2.3rem}
textarea{min-height:90px;resize:vertical}
.field{margin-bottom:.7rem}
.checks{display:flex;flex-wrap:wrap;gap:.4rem .9rem}
.checks label{font-weight:400;display:flex;align-items:center;margin:0}
.btn,button{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;font:inherit;font-weight:600;padding:.5rem .95rem;border-radius:8px;border:1px solid var(--accent);background:var(--accent);color:var(--accent-ink);cursor:pointer;white-space:nowrap;text-decoration:none!important}
.btn:hover,button:hover{filter:brightness(1.08)}
.btn.sec,button.sec{background:#fff;color:var(--ink);border-color:#cbd5e1}
.btn.ok,button.ok{background:var(--ok);border-color:var(--ok)}
.btn.bad,button.bad{background:var(--bad);border-color:var(--bad)}
.btn.sm,button.sm{padding:.25rem .55rem;font-size:.85rem}
.btn.big,button.big{padding:.8rem 1.4rem;font-size:1.05rem}
.link,button.link{background:none!important;border:0!important;color:var(--accent);padding:0;font-weight:400}
.link.bad{color:var(--bad)}
form.inline{display:inline}
details>summary{cursor:pointer;font-weight:600;list-style:none}
details>summary::before{content:"＋ ";color:var(--accent)}
details[open]>summary::before{content:"－ "}

/* ---------- Tabellen ---------- */
.tbl-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:.5rem .55rem;border-bottom:1px solid var(--line);vertical-align:top}
th{font-size:.78rem;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);background:#f8fafc}
tr.hl td{background:#fef9c3}
tr.sum td{font-weight:700;border-top:2px solid #94a3b8}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}

/* ---------- Hinweise / Status ---------- */
.flash{padding:.65rem .9rem;border-radius:8px;margin-bottom:.6rem;background:#dcfce7;border:1px solid #86efac}
.flash.error{background:#fee2e2;border-color:#fca5a5}
.pill{display:inline-block;padding:.08rem .55rem;border-radius:99px;font-size:.78rem;font-weight:600;background:#e2e8f0;color:#334155;white-space:nowrap}
.s-offen{background:#fee2e2;color:#991b1b}
.s-zugewiesen{background:#dbeafe;color:#1e40af}
.s-in-Arbeit{background:#fef3c7;color:#92400e}
.s-erledigt{background:#dcfce7;color:#166534}
.s-abgerechnet{background:#e2e8f0;color:#475569}
.p-dringend{background:#b91c1c;color:#fff}
.p-hoch{background:#fed7aa;color:#9a3412}
.p-niedrig{background:#f1f5f9;color:#64748b}
.tabs{display:flex;gap:.3rem;flex-wrap:wrap;margin-bottom:.8rem}
.tabs a{padding:.3rem .75rem;border-radius:99px;background:#fff;border:1px solid var(--line);color:var(--ink)}
.tabs a.on{background:var(--brand);color:var(--brand-ink);border-color:var(--brand)}
.warn{background:#fff7ed;border:1px solid #fdba74;padding:.6rem .8rem;border-radius:8px}
.list{list-style:none;margin:0;padding:0}
.list li{padding:.5rem 0;border-bottom:1px solid var(--line)}
.list li:last-child{border-bottom:0}

/* ---------- Kalender ---------- */
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border-left:1px solid var(--line);border-top:1px solid var(--line);background:#fff;border-radius:var(--radius);overflow:hidden}
.cal .dh{background:#f8fafc;font-size:.78rem;font-weight:700;color:var(--muted);text-align:center;padding:.35rem;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.cal .day{min-height:112px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:.25rem;font-size:.8rem;position:relative}
.cal .day.other{background:#f8fafc;color:#94a3b8}
.cal .day.today{background:#eff6ff}
.cal .day .n{font-weight:700;display:flex;justify-content:space-between}
.cal .day .n a{color:inherit}
.ev{display:block;border-radius:5px;padding:.1rem .3rem;margin:.15rem 0;color:#fff;font-size:.75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ev:hover{text-decoration:none;filter:brightness(1.1)}
.ev.due{background:#fff;color:#b91c1c;border:1px dashed #b91c1c}
@media (max-width:700px){.cal .day{min-height:70px}.ev{font-size:.68rem}.cal .dh{font-size:.7rem}}

/* ---------- Chat ---------- */
.chat{display:grid;grid-template-columns:260px 1fr;gap:1rem;height:calc(100vh - 150px);min-height:420px}
.chat .side{overflow:auto}
.chat .side a{display:flex;justify-content:space-between;padding:.45rem .6rem;border-radius:7px;color:var(--ink)}
.chat .side a.on{background:#e0e7ff}
.chat .main{display:flex;flex-direction:column;padding:0;overflow:hidden}
.msgs{flex:1;overflow-y:auto;padding:1rem;background:#f8fafc}
.msg{max-width:75%;margin:.35rem 0;padding:.45rem .7rem;border-radius:12px;background:#fff;border:1px solid var(--line);word-wrap:break-word;white-space:pre-wrap}
.msg.mine{margin-left:auto;background:#dbeafe;border-color:#bfdbfe}
.msg .who{font-size:.75rem;font-weight:700}
.msg .t{font-size:.7rem;color:var(--muted);margin-left:.4rem;font-weight:400}
.sendbar{display:flex;gap:.5rem;padding:.7rem;border-top:1px solid var(--line);background:#fff}
.sendbar textarea{min-height:42px;height:42px}
@media (max-width:800px){.chat{grid-template-columns:1fr;height:auto}.chat .side{max-height:180px}.chat .main{height:70vh}}

/* ---------- Etiketten ---------- */
.labels{display:grid;grid-template-columns:repeat(3,1fr);gap:4mm}
.label{border:1px dashed #94a3b8;border-radius:6px;padding:3mm;display:flex;gap:3mm;align-items:center;break-inside:avoid;background:#fff}
.label img{width:30mm;height:30mm}
.label .t{font-size:11pt;font-weight:700;line-height:1.2}
.label .s{font-size:9pt;color:#334155}

/* ---------- Druck ---------- */
.doc{background:#fff;max-width:210mm;margin:0 auto;padding:14mm;box-shadow:var(--shadow)}
.doc h1{font-size:18pt}
.doc table th{background:#eef2f7}
.sign{display:grid;grid-template-columns:1fr 1fr;gap:15mm;margin-top:18mm}
.sign div{border-top:1px solid #000;padding-top:2mm;font-size:9pt}
.doc-logo{display:block;height:16mm;width:auto;margin:0 0 2mm auto}
.login-logo{display:block;max-width:240px;width:80%;margin:0 auto .6rem}
.printonly{display:none}
.doc-printhead{justify-content:space-between;align-items:center;gap:1rem;border-bottom:2px solid var(--brand);padding-bottom:3mm;margin-bottom:5mm}
.doc-printhead .doc-logo{margin:0;height:14mm}
.pill.warn{background:#fef3c7;color:#92400e}
.assign-box{margin:.9rem 0;padding:.7rem .8rem;border:1px solid rgba(var(--brand-rgb),.33);background:rgba(var(--brand-rgb),.05);border-radius:10px}
.assign-box label{font-weight:600}
.assign-box small{display:block;margin-top:.3rem}
.assign-inline select{min-width:9.5rem;padding:.25rem .4rem;font-size:.9rem}
.assign-inline select.unassigned{border-color:#d97706;background:#fffbeb;color:#92400e;font-weight:600}

.card[id]{scroll-margin-top:150px}
.clock-card.running{border-color:#16a34a;background:#f0fdf4}
.clock-live{display:flex;align-items:center;gap:.5rem;font-size:2rem;font-weight:700;font-variant-numeric:tabular-nums}
.clock-live .dot{width:12px;height:12px;border-radius:50%;background:#16a34a;animation:blink 1.2s infinite}
@keyframes blink{50%{opacity:.3}}
.stamp-box{padding:.8rem;border:1px solid #cbd5e1;border-radius:10px;background:#f8fafc;margin-bottom:.8rem}
.stamp-times{display:flex;flex-wrap:wrap;gap:.4rem 1.1rem;font-size:1.1rem;margin-bottom:.4rem}
.stamp-hint{font-size:.9rem;color:var(--muted)}
.kcell-ro{display:block;text-align:center;padding:.3rem 0}
.leave-req{display:flex;gap:1rem;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:.8rem 0;border-bottom:1px solid var(--line)}
.leave-req:last-child{border-bottom:0}
.leave-info{flex:1 1 260px}.leave-span{font-size:1.15rem;font-weight:600;margin:.15rem 0}
.leave-overlap{margin-top:.3rem;font-size:.85rem;color:#b45309}
.leave-decide{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;flex:1 1 360px;justify-content:flex-end}
.leave-decide input{flex:1 1 200px}
.leave-pending{border-color:#f59e0b66}
.leave-mine{padding:.5rem 0;border-top:1px solid var(--line);margin-top:.5rem}
.sum-table th.c{text-align:center}
.sum-table th{vertical-align:bottom}
.tab-n{display:inline-block;min-width:1.5em;padding:0 .4em;margin-left:.15rem;border-radius:99px;background:#e2e8f0;color:#334155;font-size:.78rem;font-weight:700;text-align:center;line-height:1.5}
.tabs a.on .tab-n{background:rgba(255,255,255,.25);color:#fff}
.dist{white-space:nowrap;color:var(--brand);font-weight:600}
.vac-hint{font-size:.78rem;color:var(--muted);text-decoration:none}.vac-hint b{color:#15803d}.vac-hint.neg b{color:#b91c1c}
.filled-by{margin-top:.35rem;padding:.35rem .6rem;border-radius:8px;background:rgba(var(--brand-rgb),.07);border:1px solid rgba(var(--brand-rgb),.27);font-size:.9rem;display:inline-block}
.proto-log li{padding:.3rem 0;border-bottom:1px solid var(--line)}
/* ---------- Angebote / Aufmaß ---------- */
.s-Anfrage{background:#e0e7ff;color:#3730a3}.s-Aufmaß{background:#fef3c7;color:#92400e}
.s-in-Kalkulation{background:#fde68a;color:#78350f}.s-versendet{background:#dbeafe;color:#1e40af}
.s-angenommen{background:#dcfce7;color:#166534}.s-abgelehnt{background:#e2e8f0;color:#475569}
.offer-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem;margin-top:1rem}
.offer-steps a{display:flex;flex-direction:column;gap:.15rem;padding:.7rem;border:1px dashed #cbd5e1;border-radius:10px;color:var(--ink);text-decoration:none}
.offer-steps a b{font-size:1.4rem}.offer-steps a small{color:var(--muted)}
.offer-steps a.done{border-style:solid;border-color:var(--brand);background:rgba(var(--brand-rgb),.06)}
.measure-text{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.95rem;line-height:1.45;min-height:14rem}
.sketch-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1rem}
.sketch-tile{margin:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}
.sketch-tile img{display:block;width:100%;aspect-ratio:2400/1697;object-fit:contain;background:#fff;border-bottom:1px solid var(--line)}
.sketch-tile figcaption{padding:.5rem .6rem;display:flex;flex-direction:column}
.sketch-tile figcaption small{color:var(--muted)}
.tile-actions{display:flex;gap:.3rem;margin-top:.4rem;align-items:center}
.tile-actions .btn,.tile-actions form{flex:0 0 auto}
.photo-upload{padding:.7rem;border:1px dashed #cbd5e1;border-radius:10px;background:#f8fafc}
.file-btn{position:relative;overflow:hidden;flex:0 0 auto!important}
.file-btn input{position:absolute;inset:0;opacity:0;cursor:pointer;font-size:0}
.area-head{margin:1.1rem 0 .5rem;padding-bottom:.25rem;border-bottom:2px solid rgba(var(--brand-rgb),.2)}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:.8rem}
.photo{margin:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff;display:flex;flex-direction:column}
.photo img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:#f1f5f9}
.photo-edit{display:grid;grid-template-columns:1fr auto;gap:.25rem;padding:.4rem .4rem 0}
.photo-edit input{padding:.25rem .4rem;font-size:.85rem}
.photo-edit input[name=caption]{grid-column:1/3}
.photo-actions{display:flex;gap:.25rem;padding:.4rem;justify-content:flex-end}
/* Skizzen-Editor */
body.sketch-mode main{max-width:none;padding:.6rem}
.sk-head{display:flex;gap:.5rem;align-items:center;margin-bottom:.5rem}
.sk-head #sk-title{flex:1;font-size:1.05rem;font-weight:600}
.sk-state{font-size:.85rem;color:var(--muted);white-space:nowrap}.sk-state.dirty{color:#b45309}.sk-state.ok{color:#15803d}
.sk-toolbar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;padding:.4rem;background:#fff;border:1px solid var(--line);border-radius:12px;margin-bottom:.5rem;position:sticky;top:0;z-index:5}
.sk-group{display:flex;gap:.25rem;align-items:center;padding-right:.5rem;border-right:1px solid var(--line)}
.sk-group:last-child{border-right:0}
.sk-btn{min-width:48px;min-height:48px;padding:.2rem .45rem;background:#fff;color:var(--ink);border:1px solid #cbd5e1;border-radius:10px;flex-direction:column;gap:0;font-size:1.15rem;line-height:1}
.sk-btn span{font-size:.68rem;font-weight:600;margin-top:2px}
.sk-btn.on{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.sk-btn:disabled{opacity:.35}
.sk-w i{display:block;width:26px;height:var(--w);background:currentColor;border-radius:9px}
.sk-color{width:40px;height:40px;min-width:40px;padding:0;border-radius:50%;background:var(--c);border:3px solid #fff;box-shadow:0 0 0 1px #cbd5e1}
.sk-color.on{box-shadow:0 0 0 3px var(--brand)}
.sk-opts label{display:flex;align-items:center;gap:.3rem;font-size:.9rem;white-space:nowrap}
.sk-opts select{padding:.3rem}
.sk-stage{position:relative;width:100%;max-width:calc((100vh - 170px) * 1.4143);margin:0 auto;aspect-ratio:2400/1697;border:1px solid #94a3b8;border-radius:6px;overflow:hidden;box-shadow:var(--shadow);background:#fff}
.sk-stage canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;-webkit-user-select:none;user-select:none}
#sk-ink{cursor:crosshair}#sk-ink[data-tool=erase]{cursor:cell}#sk-ink[data-tool=text]{cursor:text}
.sk-textin{position:absolute;z-index:3;min-width:220px;font-size:1.05rem;font-weight:600;padding:.3rem .5rem;border:2px solid var(--brand);border-radius:6px;background:#fff}
.sk-hint{text-align:center;font-size:.85rem;margin-top:.4rem}
@media (max-width:700px){.sk-btn span{display:none}.sk-btn{min-width:42px;min-height:42px}}
.measure-print{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:9.5pt;border:1px solid #cbd5e1;padding:3mm;border-radius:2mm}
.doc-sketch{break-inside:avoid;margin-top:4mm}
.doc-sketch img{width:100%;border:1px solid #cbd5e1}
.doc-photos{display:grid;grid-template-columns:1fr 1fr;gap:4mm}
.doc-photos figure{margin:0;break-inside:avoid}
.doc-photos img{width:100%;max-height:80mm;object-fit:contain;border:1px solid #e2e8f0;background:#f8fafc}
.doc-photos figcaption{font-size:9pt;color:#334155;margin-top:1mm}


/* Kalender: Aufträge einplanen */
.acal-plan{background:#fff;color:var(--brand);border:1px solid var(--brand);border-radius:9px;padding:.35rem .75rem;font-weight:600}
.plan-list{display:flex;flex-direction:column;gap:.35rem;margin-top:1.2rem;font-size:.85rem;max-height:46vh;overflow:auto;padding-right:.2rem}
.plan-list>small{margin-bottom:.2rem}
.plan-item{display:flex;flex-direction:column;align-items:stretch;gap:.05rem;text-align:left;background:#fff;color:#1c1c1e;border:1px solid #e3e3e8;border-left:4px solid var(--brand);border-radius:8px;padding:.4rem .5rem;font-weight:400;cursor:grab;white-space:normal}
.plan-upcoming li{padding:.35rem 0;border-bottom:1px solid var(--line)}
.plan-item.project{border-left-color:#007aff}.plan-item.project .pi-num{color:#1d4ed8}
.plan-projects{max-height:34vh}
.plan-item.unassigned{border-left-color:#d97706;background:#fffbeb}
.plan-item.planned{opacity:.7}
.plan-item:hover{box-shadow:0 2px 8px rgba(0,0,0,.08);filter:none}
.pi-num{font-weight:700;font-size:.78rem;color:var(--brand)}.plan-item.unassigned .pi-num{color:#b45309}
.pi-title{font-weight:600;line-height:1.25}.pi-meta{font-size:.74rem;color:#6b7280}
.pi-prio{font-style:normal;font-size:.68rem;padding:0 .3rem;border-radius:5px;background:#fed7aa;color:#9a3412}.pi-prio.dringend{background:#b91c1c;color:#fff}
body.dragging-order .aw-col,body.dragging-order .am-cell,body.dragging-order .aw-adcell{outline:1px dashed rgba(var(--brand-rgb),.33);outline-offset:-1px}
.drop-hl{background:rgba(var(--brand-rgb),.13)!important;outline:2px solid var(--brand)!important}
.qa-mode{display:flex;margin:.6rem .8rem 0;background:#e9e9ee;border-radius:9px;padding:2px}
.qa-mode label{flex:1;margin:0}.qa-mode input{display:none}
.qa-mode span{display:block;text-align:center;padding:.4rem .3rem;white-space:nowrap;border-radius:7px;font-weight:600;font-size:.9rem;cursor:pointer}
.qa-mode input:checked+span{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.15)}
.qa-auftrag .sheet-row select,.qa-projekt .sheet-row select{max-width:70%;flex:1;min-width:0;text-overflow:ellipsis}
.qa-order-info{padding:.3rem .9rem .5rem;font-size:.82rem;color:#6b7280}
.qa-order-info:empty{display:none}
.sheet-group>input.qa-anote{border-top:1px solid var(--aline)}
.qa-hint{margin:.2rem 1.2rem .8rem;font-size:.8rem;color:#6b7280}
@media (max-width:760px){.acal-plan{font-size:.85rem;padding:.3rem .55rem}
  .sheet-row:has(input[type=date]){flex-wrap:wrap;row-gap:.35rem}
  .sheet-row:has(input[type=date])>span{flex:1 1 100%}
  .sheet-row input[type=date],.sheet-row input[type=time]{min-width:0;flex:1 1 0}}


/* Kundenunterschrift */
.sig-card.signed{border-color:#16a34a;background:#f0fdf4}
.sig-done{display:flex;gap:1rem;align-items:center;flex-wrap:wrap}
.sig-done img{height:90px;max-width:280px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:.3rem}
.sig-warn{margin-top:.3rem;color:#b45309;font-size:.85rem}
.sig-dlg{border:0;border-radius:16px;padding:0;width:min(720px,100vw - 16px);max-height:calc(100vh - 16px);box-shadow:0 20px 60px rgba(0,0,0,.35)}
.sig-dlg::backdrop{background:rgba(15,23,42,.55)}
.sig-head{display:flex;justify-content:space-between;align-items:center;padding:.8rem 1rem;border-bottom:1px solid var(--line);background:#f8fafc;position:sticky;top:0;z-index:2}
.sig-head span{width:5rem}
.sig-body{padding:1rem}
.sig-sum{border:1px solid var(--line);border-radius:10px;padding:.7rem .8rem;background:#f8fafc;font-size:.92rem}
.sig-sum table{margin:.5rem 0 .2rem}.sig-sum td{padding:.15rem .3rem;border:0}
.sig-sum details{margin-top:.3rem}.sig-sum ul{margin:.3rem 0 0 1.1rem;padding:0}
.sig-text{margin:.9rem 0 .5rem;font-weight:600}
.sig-pad-wrap{position:relative;border:2px dashed #94a3b8;border-radius:12px;background:#fff;height:min(240px,34vh);margin-bottom:.8rem}
.sig-pad-wrap canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair;border-radius:12px}
.sig-line{position:absolute;left:1rem;right:1rem;bottom:28%;border-bottom:1px solid #cbd5e1;color:#94a3b8;font-size:.8rem;pointer-events:none}
.sig-clear{position:absolute;right:.5rem;top:.5rem;z-index:1}
.sig-err{color:#b91c1c;font-weight:600;margin:.5rem 0 0}
.signed-doc{display:grid;grid-template-columns:1fr 1fr;gap:15mm;margin-top:10mm}
.sd-space{height:24mm;display:flex;align-items:flex-end}
.sd-space img{max-height:24mm;max-width:85mm}
.sd-label{border-top:1px solid #000;padding-top:2mm;font-size:9pt}


/* Wissensdatenbank */
.kb-search{display:flex;gap:.5rem;margin-bottom:.7rem}
.kb-search input{flex:1;font-size:1.1rem;padding:.7rem .9rem;border-radius:12px}
.kb-search button{border-radius:12px}
.kb-cats{display:flex;flex-wrap:wrap;gap:.35rem;margin-bottom:1rem}
.kb-cats a{padding:.3rem .7rem;border-radius:99px;background:#fff;border:1px solid var(--line);color:var(--ink);text-decoration:none;font-size:.9rem}
.kb-cats a.on{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.kb-cats a.on .tab-n{background:rgba(255,255,255,.25);color:#fff}
.kb-list{display:flex;flex-direction:column;gap:.5rem}
.kb-item{display:flex;gap:.9rem;align-items:flex-start;color:var(--ink);text-decoration:none;margin:0;transition:box-shadow .15s}
.kb-item:hover{box-shadow:0 4px 14px rgba(0,0,0,.08);text-decoration:none}
.kb-icon{font-size:1.8rem;line-height:1}
.kb-main{flex:1;min-width:0}
.kb-title{font-weight:700;font-size:1.05rem;color:#0f172a}
.kb-meta{font-size:.82rem;color:var(--muted);margin-top:.1rem}
.kb-desc{font-size:.9rem;margin-top:.3rem;color:#334155}
.kb-hit{font-size:.84rem;margin-top:.35rem;padding:.35rem .5rem;background:#f8fafc;border-left:3px solid var(--brand);border-radius:4px;color:#334155;overflow-wrap:anywhere}
mark{background:#fde68a;color:inherit;padding:0 .1em;border-radius:2px}
.kb-file{display:flex;gap:.8rem;align-items:center;padding:.6rem 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
.kb-file:last-child{border-bottom:0}
.kb-ficon{font-size:2rem}.kb-thumb{width:70px;height:52px;object-fit:cover;border-radius:6px;border:1px solid var(--line)}
.kb-fmain{flex:1;min-width:200px;display:flex;flex-direction:column}
.kb-drop{position:relative;display:block;border:2px dashed #94a3b8;border-radius:12px;padding:1.4rem;text-align:center;background:#f8fafc;cursor:pointer;font-weight:600}
.kb-drop input{position:absolute;inset:0;opacity:0;cursor:pointer}
.kb-drop small{font-weight:400;color:var(--muted)}
.kb-sel{list-style:none;padding:0;margin:.5rem 0;font-size:.9rem}

@media print{
  .printonly{display:block}.doc-printhead{display:flex}
  .top,.noprint,.flash{display:none!important}
  body{background:#fff;font-size:10.5pt}
  main{padding:0;max-width:none}
  .doc{box-shadow:none;padding:0;max-width:none}
  .card{box-shadow:none;border:0;padding:0}
  .labels{gap:2mm}
  a{color:inherit}
}
.head .row>*{flex:0 0 auto}
.msg{width:fit-content;min-width:8rem}

/* ---------- Untermenü Lagerverwaltung ---------- */
.dd{position:relative;display:flex}
.dd .caret{font-size:.7rem;opacity:.8}
.dd-menu{display:none;position:absolute;top:100%;left:0;min-width:210px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(16,24,40,.18);padding:.35rem;z-index:30;flex-direction:column}
.dd::after{content:"";position:absolute;left:0;right:0;top:100%;height:6px}
.dd:hover .dd-menu,.dd:focus-within .dd-menu{display:flex}
.top .dd-menu a{color:var(--ink);padding:.45rem .65rem;border-radius:7px}
.top .dd-menu a:hover{background:var(--brand-tint);color:var(--ink)}
.top .dd-menu a.on{background:var(--brand-tint2);color:var(--ink);font-weight:600}
@media (max-width:980px){
  .dd{flex-direction:column}
  .dd .caret{display:none}
  .dd-menu,.dd:hover .dd-menu{display:flex;position:static;background:none;border:0;box-shadow:none;padding:0 0 0 1rem;min-width:0}
  .top .dd-menu a{color:var(--brand-ink-soft)}
  .top .dd-menu a:hover,.top .dd-menu a.on{background:var(--brand-hover);color:var(--brand-ink)}
}

/* ---------- Projektordner ---------- */
.folders{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:.6rem}
.folder{display:flex;flex-direction:column;gap:.1rem;padding:.75rem .85rem;border:1px solid var(--line);border-radius:10px;background:#f8fafc;color:var(--ink)}
.folder:hover{background:var(--brand-tint);border-color:rgba(var(--brand-rgb),.4);text-decoration:none}
.folder .ico{font-size:1.6rem;line-height:1}
.folder small{color:var(--muted)}
.crumbs{display:flex;flex-wrap:wrap;gap:.3rem;align-items:center;font-size:.95rem;margin-bottom:.2rem}
.crumbs span{color:var(--muted)}
.drop{border:2px dashed #94a3b8;border-radius:10px;padding:1rem;text-align:center;background:#f8fafc;transition:.15s}
.drop.over{border-color:var(--brand);background:var(--brand-tint)}
.ficon{font-size:1.15rem;margin-right:.3rem}

/* ---------- Protokolle ---------- */
.pdfpage{position:relative;border:1px solid var(--line);box-shadow:var(--shadow);background:#fff;user-select:none;touch-action:none;cursor:crosshair;margin-bottom:.3rem}
.pdfpage img{display:block;width:100%;height:auto;pointer-events:none}
.pdfpage .acro{position:absolute;background:rgba(59,130,246,.15);border:1px solid #3b82f6;pointer-events:none}
.pdfpage .ov{position:absolute;background:rgba(250,204,21,.35);border:1.5px solid #ca8a04;font-size:.7rem;line-height:1.1;color:#713f12;overflow:hidden;padding:1px 3px;cursor:pointer;white-space:nowrap}
.pdfpage .ov.sig{background:rgba(34,197,94,.22);border-color:#15803d;color:#14532d}
.pdfpage .ov.sel{outline:3px solid #dc2626;z-index:2}
.pdfpage .ov.ghost{border-style:dashed;pointer-events:none}
.sigpad{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.sigpad canvas{width:100%;max-width:560px;aspect-ratio:7/2;border:1px solid #94a3b8;border-radius:8px;background:#fff repeating-linear-gradient(transparent 0 79%,#e2e8f0 79% 80%,transparent 80% 100%);touch-action:none;cursor:crosshair}
.sig-hint{font-size:.8rem}
@media (max-width:900px){#editor-grid{grid-template-columns:1fr!important}}
.ftable th{font-size:.7rem;padding:.3rem .25rem;white-space:nowrap;text-transform:none;letter-spacing:0}
.ftable td{padding:.15rem .15rem;border-bottom:1px solid var(--line)}
.ftable input{padding:.3rem .35rem;font-size:.85rem;min-width:3.6rem;width:100%}
.ftable input.wide{min-width:11rem}
.ftable input[type=checkbox]{width:1.2rem;height:1.2rem;min-width:0}
.checklist td,.checklist th{vertical-align:middle}
.checklist th.c,.checklist td.c{text-align:center;width:3.6rem}
.checklist input[type=radio]{width:1.25rem;height:1.25rem;margin:0;accent-color:var(--brand)}
.checklist td:first-child{font-size:.9rem;min-width:16rem}
.checklist tr:hover td{background:#f8fafc}

/* ---------- Wartungsverträge ---------- */
.w-ueberfaellig{background:#fee2e2;color:#991b1b}
.w-bald{background:#ffedd5;color:#9a3412}
.w-ok{background:#dcfce7;color:#166534}
.w-inaktiv{background:#e2e8f0;color:#475569}
.ev.maint{color:var(--brand);border-color:var(--brand)}
.kpi{display:flex;flex-direction:column;gap:.15rem;color:var(--ink)}
.kpi:hover{text-decoration:none;border-color:#99e1d0}
.kpi .ico{font-size:1.5rem}
.kpi.on{outline:2px solid var(--brand)}
#cat-pick label{white-space:nowrap;font-weight:400}
#cat-pick label:has(input:checked){outline:2px solid var(--brand);background:var(--brand-tint)}

/* ======================================================= Zeiterfassung im Kimai-Stil */
.kimai{display:grid;grid-template-columns:220px minmax(0,1fr);gap:1.2rem;align-items:start}
.ksidebar{position:sticky;top:5.5rem;background:#1f2d3a;border-radius:12px;padding:.6rem;display:flex;flex-direction:column;gap:.1rem;box-shadow:var(--shadow)}
.ksidebar a{color:#cbd5e1;padding:.45rem .7rem;border-radius:7px;font-size:.92rem;text-decoration:none!important}
.ksidebar a:hover{background:rgba(255,255,255,.08);color:#fff}
.ksidebar a.on{background:var(--brand);color:#fff;font-weight:600}
.ksec{color:#7c8ea3;font-size:.68rem;text-transform:uppercase;letter-spacing:.08em;font-weight:700;padding:.8rem .7rem .3rem}
.ksec:first-child{padding-top:.3rem}
.khead{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:.9rem}
.khead h1{margin:0}
.ktools{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.ktools select{width:auto}
.kdrop{position:relative}
.kdrop>summary{list-style:none}
.kdrop>summary::-webkit-details-marker{display:none}
.kdrop>summary::before{content:none!important}
.kdrop-panel{position:absolute;right:0;top:calc(100% + 6px);z-index:25;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 32px rgba(16,24,40,.18);padding:.9rem;min-width:300px}
.krecent{border-bottom:1px solid var(--line);padding:.45rem 0}
.krecent:last-child{border-bottom:0}
.krecent button{color:var(--ink)!important}
.kfilter>summary{font-weight:600}
.kfilter>summary::before{content:""!important}
.kpresets{display:flex;flex-wrap:wrap;gap:.35rem}
.kpresets label{margin:0;font-weight:500}
.kpresets input{position:absolute;opacity:0;pointer-events:none}
.kpresets span{display:inline-block;padding:.3rem .75rem;border:1px solid var(--line);border-radius:99px;background:#fff;cursor:pointer;font-size:.85rem}
.kpresets input:checked+span{background:var(--brand);border-color:var(--brand);color:#fff}
.ksum{display:flex;flex-wrap:wrap;gap:.6rem;margin-bottom:1rem}
.ksum>div{background:#fff;border:1px solid var(--line);border-radius:10px;padding:.55rem .9rem;display:flex;flex-direction:column;min-width:120px;box-shadow:var(--shadow)}
.ksum small{color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.04em}
.ksum b{font-size:1.15rem;font-variant-numeric:tabular-nums}
.kbatch{display:flex;gap:.5rem;align-items:center;padding:.6rem .9rem;border-bottom:1px solid var(--line);background:#f8fafc;border-radius:10px 10px 0 0}
.ktable td,.ktable th{padding:.5rem .6rem}
.ktable tr.kday td{background:#eef6f4;font-weight:700;font-size:.85rem;color:#0f5f50;border-bottom:1px solid #cfe9e2}
.ktable tr.krun td{background:#fffbeb}
.kact a,.kact button{font-size:1rem;margin:0 .15rem;text-decoration:none}
.ktag{display:inline-block;background:#e0f2ef;color:#0f5f50;border-radius:5px;padding:0 .4rem;font-size:.72rem;margin:.15rem .2rem 0 0;font-weight:600}
.ktag.gray{background:#f1f5f9;color:#64748b}
.ktag.ok{background:#dcfce7;color:#166534}
.neg{color:#b91c1c}.pos{color:#15803d}
.kweek th.c,.kweek td.c,.kmatrix th.c,.kmatrix td.c{text-align:center}
.kweek .we,.kmatrix .we{background:#f8fafc}
.kcell{width:4.6rem;text-align:center;padding:.3rem;font-variant-numeric:tabular-nums}
.kcell-lock{color:var(--muted);font-size:.85rem}
.knew td{background:#fcfdfd}
.knew select{font-size:.85rem;padding:.3rem}
.kmatrix td,.kmatrix th{font-size:.8rem;padding:.35rem .3rem;white-space:nowrap}
.kwe td{background:#f8fafc;color:#64748b}
.kbar{height:8px;background:#e2e8f0;border-radius:99px;overflow:hidden;margin:.2rem 0}
.kbar span{display:block;height:100%;background:var(--brand)}
.kbar span.warn{background:#f59e0b}.kbar span.over{background:#dc2626}
/* Kalender */
.kcal-head{display:grid;grid-template-columns:52px repeat(7,minmax(0,1fr));border-bottom:1px solid var(--line);background:#f8fafc;border-radius:10px 10px 0 0}
.kcal-head>div{padding:.45rem;text-align:center;font-size:.82rem;border-left:1px solid var(--line)}
.kcal-head>div:first-child{border-left:0}
.kcal-head .today{background:var(--brand-tint)}
.kcal-body{display:grid;grid-template-columns:52px repeat(7,minmax(0,1fr));height:calc(var(--hours) * 46px);position:relative}
.kcal-hours>div{height:46px;font-size:.7rem;color:var(--muted);text-align:right;padding:2px 6px 0 0;border-top:1px solid #eef2f7}
.kcal-day{position:relative;border-left:1px solid var(--line);background:repeating-linear-gradient(#fff 0 45px,#eef2f7 45px 46px);cursor:copy}
.kcal-day.we{background:repeating-linear-gradient(#f8fafc 0 45px,#eef2f7 45px 46px)}
.kcal-ev{position:absolute;left:3px;right:3px;background:var(--brand-tint2);border-left:4px solid var(--brand);border-radius:6px;padding:2px 5px;font-size:.72rem;line-height:1.2;overflow:hidden;color:#0f3d34;text-decoration:none!important;cursor:pointer}
.kcal-ev:hover{background:#b9eadf;z-index:2}
.kcal-ev.run{background:#fef3c7;border-color:#f59e0b}
@media (max-width:980px){
  .kimai{grid-template-columns:1fr}
  .ksidebar{position:static;flex-direction:row;overflow-x:auto;flex-wrap:nowrap;padding:.4rem}
  .ksidebar a{white-space:nowrap}
  .ksec{display:none}
  .kdrop-panel{left:0;right:auto}
}
@media print{.ksidebar{display:none}.kimai{display:block}}

/* ---------- Bauträger ---------- */
.bchips{display:flex;gap:.4rem;flex-wrap:wrap;margin-bottom:.8rem}
.bchips a{padding:.3rem .75rem;border-radius:99px;background:#fff;border:1px solid var(--line);color:var(--ink);font-size:.88rem;text-decoration:none}
.bchips a.on{background:#fff7ed;border-color:#f59e0b;color:#92400e;font-weight:600}
tr.bgroup td{background:#fff7ed;color:#92400e;font-weight:700;border-top:2px solid #fde68a}

/* ======================================================= Kalender im Apple-Stil */
:root{--hh:52px;--apple-red:#ff3b30;--aline:#e5e5ea}
.acal{background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Arial,sans-serif}
.acal-top{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;padding:.8rem 1rem;border-bottom:1px solid var(--aline)}
.acal-nav{display:flex;align-items:center;gap:.35rem;flex:1;min-width:0}
.acal-nav h1{font-size:1.5rem;font-weight:700;margin:0 0 0 .5rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acal-kw{color:#8e8e93;font-size:.9rem;margin-left:.3rem}
.acal-arrow,.acal-today{display:inline-flex;align-items:center;justify-content:center;height:30px;border-radius:7px;border:1px solid var(--aline);color:#1c1c1e;text-decoration:none!important;background:#fff}
.acal-arrow{width:30px;font-size:1.3rem}
.acal-today{padding:0 .75rem;font-weight:500}
.acal-arrow:hover,.acal-today:hover{background:#f2f2f7}
.acal-seg{display:flex;background:#eeeef0;border-radius:9px;padding:2px}
.acal-seg a{padding:.3rem 1.05rem;border-radius:7px;color:#1c1c1e;font-weight:500;font-size:.92rem;text-decoration:none!important}
.acal-seg a.on{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.15)}
.acal-tools{display:flex;gap:.5rem;align-items:center}
.acal-tools select{width:auto;border-radius:8px;padding:.35rem .5rem}
.acal-plus{width:34px;height:34px;border-radius:50%;padding:0;font-size:1.3rem;background:var(--apple-red);border-color:var(--apple-red)}
.acal-body{display:grid;grid-template-columns:230px minmax(0,1fr)}
.acal-side{border-right:1px solid var(--aline);padding:1rem;background:#fbfbfd}
.mini-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:.4rem;font-size:.92rem}
.mini-head a{color:var(--apple-red);font-size:1.2rem;padding:0 .3rem;text-decoration:none}
.mini-grid{display:grid;grid-template-columns:repeat(7,1fr);text-align:center;font-size:.78rem;gap:2px 0}
.mini-wd{color:#8e8e93;font-weight:600;font-size:.7rem}
.mini-grid a{display:flex;align-items:center;justify-content:center;width:26px;height:26px;margin:auto;border-radius:50%;color:#1c1c1e;text-decoration:none}
.mini-grid a.other{color:#c7c7cc}
.mini-grid a:hover{background:#ececf1}
.mini-grid a.today{color:var(--apple-red);font-weight:700}
.mini-grid a.sel{background:#1c1c1e;color:#fff}
.mini-grid a.sel.today{background:var(--apple-red);color:#fff}
.legend{display:flex;flex-direction:column;gap:.25rem;margin-top:1.2rem;font-size:.85rem}
.legend a,.legend span{display:flex;align-items:center;gap:.45rem;color:#1c1c1e;text-decoration:none;padding:.1rem .2rem;border-radius:6px}
.legend a.on{background:#ececf1;font-weight:600}
.legend i{width:11px;height:11px;border-radius:50%;flex:0 0 auto}
/* Monat */
.am-head{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--aline)}
.am-head div{text-align:right;padding:.4rem .6rem;font-size:.8rem;color:#8e8e93;font-weight:600}
.am-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-auto-rows:minmax(118px,1fr)}
.am-cell{border-right:1px solid var(--aline);border-bottom:1px solid var(--aline);padding:.25rem .3rem;display:flex;flex-direction:column;gap:2px;cursor:pointer;min-width:0;overflow:hidden}
.am-cell:nth-child(7n){border-right:0}
.am-cell.we{background:#fafafa}
.am-cell.other .am-num{color:#c7c7cc}
.am-num{align-self:flex-end;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:50%;font-weight:500;color:#1c1c1e;text-decoration:none!important;font-size:.92rem}
.am-num.today{background:var(--apple-red);color:#fff;font-weight:700}
.am-chip,.am-line{all:unset;box-sizing:border-box;display:block;width:100%;font-size:.74rem;line-height:1.35;padding:1px 5px;border-radius:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.am-chip{background:color-mix(in srgb,var(--c) 22%,white);color:#1c1c1e;border-left:3px solid var(--c)}
.am-line i{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--c);margin-right:3px;vertical-align:1px}
.am-line .t{color:#8e8e93}
.am-chip:hover,.am-line:hover{filter:brightness(.95);background:color-mix(in srgb,var(--c) 30%,white)}
.am-more{font-size:.72rem;color:#8e8e93;padding-left:5px;text-decoration:none}
/* Woche / Tag */
.aw{display:flex;flex-direction:column;--g:56px}
.aw-head,.aw-allday{display:grid;grid-template-columns:var(--g) repeat(var(--days),minmax(0,1fr));border-bottom:1px solid var(--aline)}
.aw-dh{text-align:center;padding:.45rem 0;color:#1c1c1e;text-decoration:none!important;font-size:.9rem}
.aw-dh small{color:#8e8e93}
.aw-dh b{display:inline-flex;width:28px;height:28px;align-items:center;justify-content:center;border-radius:50%;font-weight:600}
.aw-dh.today b{background:var(--apple-red);color:#fff}
.aw-dh.today small{color:var(--apple-red)}
.aw-gutter{display:flex;align-items:center;justify-content:flex-end;padding-right:6px;color:#8e8e93;font-size:.68rem}
.aw-adcell{border-left:1px solid var(--aline);padding:3px;display:flex;flex-direction:column;gap:2px;min-height:28px;cursor:pointer;min-width:0}
.aw-scroll{height:calc(100vh - 290px);min-height:420px;overflow-y:auto;position:relative}
.aw-grid{display:grid;grid-template-columns:var(--g) repeat(var(--days),minmax(0,1fr));height:calc(24 * var(--hh));position:relative}
.aw-hours div{height:var(--hh);position:relative}
.aw-hours span{position:absolute;top:-.55em;right:6px;font-size:.68rem;color:#8e8e93}
.aw-hours div:first-child span{display:none}
.aw-col{position:relative;border-left:1px solid var(--aline);background:repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--hh) - 1px),var(--aline) calc(var(--hh) - 1px),var(--aline) var(--hh));cursor:cell}
.aw-col.we{background-color:#fafafa}
.aw-ev{all:unset;box-sizing:border-box;position:absolute;margin-left:2px;padding:3px 6px;border-radius:6px;background:color-mix(in srgb,var(--c) 20%,white);border-left:3px solid var(--c);font-size:.76rem;line-height:1.25;overflow:hidden;cursor:pointer;display:flex;flex-direction:column;color:#1c1c1e;z-index:1}
.aw-ev b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aw-ev span{color:#3a3a3c;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aw-ev:hover{background:color-mix(in srgb,var(--c) 32%,white);z-index:3}
.aw-now{position:absolute;left:-5px;right:0;height:2px;background:var(--apple-red);z-index:4;pointer-events:none}
.aw-now::before{content:"";position:absolute;left:-1px;top:-4px;width:10px;height:10px;border-radius:50%;background:var(--apple-red)}
.acal-tag .aw-ev{font-size:.85rem;padding:5px 9px}
/* Wochenleiste (Tag, wie iPhone) */
.strip{display:grid;grid-template-columns:repeat(7,1fr);padding:.4rem .5rem;border-bottom:1px solid var(--aline)}
.strip a{display:flex;flex-direction:column;align-items:center;gap:2px;color:#1c1c1e;text-decoration:none!important;padding:.15rem 0}
.strip small{font-size:.68rem;color:#8e8e93}
.strip b{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;font-weight:500}
.strip a.today b{color:var(--apple-red);font-weight:700}
.strip a.sel b{background:#1c1c1e;color:#fff}
.strip a.sel.today b{background:var(--apple-red);color:#fff}
/* Dialoge (Sheets) */
dialog.sheet{border:0;border-radius:14px;padding:0;width:min(440px,94vw);background:#f2f2f7;box-shadow:0 24px 60px rgba(0,0,0,.3)}
dialog.sheet::backdrop{background:rgba(0,0,0,.3)}
.sheet-head{display:flex;justify-content:space-between;align-items:center;padding:.85rem 1rem;background:#f9f9fb;border-bottom:1px solid var(--aline)}
.sheet-head .link{color:var(--apple-red)!important;font-size:.98rem;text-decoration:none;cursor:pointer}
.sheet-group{background:#fff;margin:.8rem;border-radius:11px;overflow:hidden}
.sheet-group>input,.sheet-row,.sw{display:flex;align-items:center;gap:.5rem;border:0;border-bottom:1px solid var(--aline);border-radius:0;padding:.7rem .9rem;width:100%;box-sizing:border-box;background:#fff}
.sheet-group>:last-child{border-bottom:0}
.sheet-row span,.sw span{flex:1;font-size:.95rem}
.sheet-row input,.sheet-row select{width:auto;border:0;background:#f2f2f7;border-radius:7px;padding:.3rem .5rem}
.big-in{font-size:1.05rem}
.sheet-group>input:focus{outline:none}
.sw input{width:42px;height:24px;appearance:none;background:#e5e5ea;border-radius:99px;position:relative;cursor:pointer;transition:.2s;margin:0}
.sw input::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:.2s}
.sw input:checked{background:#34c759}
.sw input:checked::after{left:20px}
.swatches{display:flex;gap:.35rem;flex-wrap:wrap}
.swatches input{display:none}
.swatches i{display:block;width:22px;height:22px;border-radius:50%;cursor:pointer;border:2px solid #fff;box-shadow:0 0 0 1px var(--aline)}
.swatches input:checked+i{box-shadow:0 0 0 2px #1c1c1e}
.ev-detail{padding:1rem 1.1rem;position:relative}
.ev-detail h2{margin:0 0 .3rem;padding-left:.8rem;font-size:1.2rem}
.ev-detail p{margin:.25rem 0 .25rem .8rem}
.ev-bar{position:absolute;left:1.1rem;top:1rem;bottom:1rem;width:4px;border-radius:4px}
.ev-detail .btn{margin:.6rem 0 0 .8rem}
@media (max-width:980px){.acal-body{grid-template-columns:1fr}.acal-side{display:none}}
@media (max-width:760px){
  main:has(.acal){padding:.4rem .3rem 2rem}
  .acal{border-radius:10px}
  .acal-top{gap:.5rem;padding:.6rem}
  .acal-nav h1{font-size:1.05rem}
  .acal-seg{order:3;width:100%;justify-content:stretch}.acal-seg a{flex:1;text-align:center}
  .am-grid{grid-auto-rows:minmax(64px,1fr)}
  .am-line .t,.am-line span{display:none}
  .am-chip,.am-line{font-size:.62rem;padding:0 3px}
  .aw{--g:44px}
  .aw-scroll{height:calc(100vh - 260px)}
}
.acal-tag .aw-head{display:none}
@media (max-width:760px){
  .acal-nav{flex-wrap:wrap}
  .acal-nav h1{order:-1;width:100%;margin:0 0 .4rem;font-size:1.25rem}
  .acal-tools{margin-left:auto}
}
@media (max-width:760px){.acal-nav{flex:1 1 100%}.acal-tools{flex:1 1 100%;justify-content:space-between}.acal-tools select{flex:1}}
@media (max-width:760px){.aw-gutter small{font-size:.55rem}}
/* Bautagebuch im Projekt */
.diary-new{padding:.7rem;border:1px dashed #cbd5e1;border-radius:10px;background:#f8fafc;margin-bottom:.4rem}
.diary-preview{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.5rem}
.diary-preview figure,.diary-imgs figure{position:relative;margin:0}
.diary-preview img{width:84px;height:84px;object-fit:cover;border-radius:8px;border:1px solid var(--line);display:block}
.diary-day{margin:1.2rem 0 .4rem;padding-bottom:.3rem;border-bottom:2px solid var(--line);font-size:1.02rem}
.diary-list{display:flex;flex-direction:column;gap:.5rem}
.diary-entry{border:1px solid var(--line);border-radius:10px;padding:.6rem .75rem;background:#fff}
.diary-meta{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:.25rem}
.diary-imgs{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:.4rem;margin-top:.45rem}
.diary-imgs img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:8px;display:block;background:#f1f5f9}
.img-del{position:absolute;top:4px;right:4px;width:26px;height:26px;padding:0;border-radius:50%;background:rgba(15,23,42,.65);color:#fff;font-size:.8rem;line-height:26px;border:0}
.diary-edit{margin-top:.5rem;padding-top:.5rem;border-top:1px dashed var(--line)}
.lightbox{position:fixed;inset:0;z-index:1000;background:rgba(2,6,23,.92);display:flex;align-items:center;justify-content:center}
.lightbox[hidden]{display:none}
.lightbox img{max-width:92vw;max-height:84vh;object-fit:contain;border-radius:6px}
.lightbox button{position:absolute;background:rgba(255,255,255,.12);color:#fff;border:0;font-size:1.6rem;width:48px;height:48px;border-radius:50%;padding:0}
.lb-x{top:14px;right:14px}.lb-prev{left:12px;top:50%;transform:translateY(-50%)}.lb-next{right:12px;top:50%;transform:translateY(-50%)}
.lb-open{position:absolute;bottom:16px;color:#cbd5e1;font-size:.9rem}
@media print{.diary-imgs{grid-template-columns:repeat(3,1fr)}}
.diary-act{display:flex;gap:.6rem;align-items:center;flex:0 0 auto}.diary-act form{margin:0}.diary-act button{font-size:1.05rem}
/* App / Zertifikat */
.cert-fp{background:#f1f5f9;border:1px solid var(--line);border-radius:10px;padding:.6rem .8rem;margin:.6rem 0 1rem}
.cert-fp small{display:block;color:var(--muted,#64748b)}
.cert-fp code{display:block;font-size:.92rem;word-break:break-all;margin-top:.2rem}
ol.steps{padding-left:1.3rem;line-height:1.6}ol.steps li{margin:.35rem 0}
.kbd{display:inline-block;border:1px solid var(--line);border-radius:6px;padding:0 .35rem;background:#fff}
.offline-card{max-width:520px;margin:12vh auto;text-align:center}
.login-links{display:flex;justify-content:center;gap:1rem;flex-wrap:wrap;margin-top:1rem;font-size:.9rem}
/* iPhone mit Notch: Inhalt nicht unter Statusleiste/Home-Balken */
.top{padding-top:calc(.5rem + env(safe-area-inset-top));padding-left:calc(1rem + env(safe-area-inset-left));padding-right:calc(1rem + env(safe-area-inset-right))}
main{padding-bottom:calc(1rem + env(safe-area-inset-bottom))}
/* Rubrik Protokolle */
.proto-cat{margin:.9rem 0 .4rem;font-size:1rem}
.proto-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:.5rem}
.proto-tile{display:flex;gap:.6rem;align-items:flex-start;border:1px solid var(--line);border-radius:10px;padding:.65rem .75rem;cursor:pointer;background:#fff;margin:0}
.proto-tile input{margin-top:.2rem;width:auto;flex:0 0 auto}
.proto-tile span{display:flex;flex-direction:column;gap:.15rem}
.proto-tile:has(input:checked){border-color:var(--brand);box-shadow:0 0 0 2px rgba(var(--brand-rgb),.25);background:var(--brand-tint)}
.proto-view iframe{width:100%;height:80vh;border:1px solid var(--line);border-radius:8px;background:#fff}
/* Datensicherung */
.grid.g3{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.bk-stat .stat{font-size:1.25rem;margin:.2rem 0}
.bk-ok{border-left:5px solid #16a34a}.bk-err{border-left:5px solid #dc2626}
label.chk{display:flex;gap:.35rem;align-items:center;font-weight:400;font-size:.85rem;margin-top:.3rem}
label.chk input{width:auto}
.home-warn{display:flex;gap:.8rem;align-items:center;justify-content:space-between;flex-wrap:wrap}
#restore-dlg form{padding:1.2rem 1.4rem}#restore-dlg input{margin-bottom:.6rem}
.flash.info{background:#e0f2fe;border-color:#7dd3fc}
/* Ausgezahlte Überstunden */
.payout{color:#7c3aed}
.ktag.payout-tag{background:#ede9fe;color:#5b21b6}
.payout-form{padding:.7rem;border:1px dashed #cbd5e1;border-radius:10px;background:#f8fafc}
.payout-note{display:flex;align-items:center;gap:.4rem}.payout-note span{white-space:nowrap;font-weight:600}
.small-link{font-size:.8rem;text-decoration:none}
/* Gruppen & Rechte */
.grp-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:.6rem}
.grp{border:1px solid var(--line);border-radius:10px;padding:.6rem .7rem;background:#fff;display:flex;flex-direction:column;gap:.25rem}
.grp-name{display:flex;gap:.3rem}.grp-name input{font-weight:600}
.perm-table th.c,.perm-table td.c{text-align:center;vertical-align:middle}
.perm-table td.c input[type=checkbox]{width:1.25rem;height:1.25rem}
.perm-table thead th{position:sticky;top:0;background:#f8fafc;z-index:2}
.perm-area td{background:#eef6f4;font-weight:700;color:var(--brand)}
.perm-ov td{background:#fffbeb}
.tri{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.tri label{margin:0;cursor:pointer}.tri input{position:absolute;opacity:0;pointer-events:none}
.tri span{display:block;padding:.3rem .55rem;font-size:.82rem;font-weight:500;white-space:nowrap}
.tri label+label span{border-left:1px solid var(--line)}
.tri input:checked+span{background:#e2e8f0;font-weight:700}
.tri .tri-yes input:checked+span{background:#dcfce7;color:#166534}
.tri .tri-no input:checked+span{background:#fee2e2;color:#991b1b}
/* Erscheinungsbild */
.color-pick{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.color-pick label{margin:0;cursor:pointer}.color-pick input[type=radio]{position:absolute;opacity:0;pointer-events:none}
.color-pick span{display:block;width:34px;height:34px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px var(--line)}
.color-pick input:checked+span{box-shadow:0 0 0 3px var(--ink)}
.color-pick input[type=color]{width:46px;height:38px;padding:2px;border-radius:8px;cursor:pointer}
.farbe-prev{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;margin-top:.3rem}
.farbe-prev .fp-bar{background:var(--p);color:#fff;padding:.4rem .8rem;border-radius:8px;font-weight:700}
.farbe-prev .fp-btn{border:2px solid var(--p);color:var(--p);padding:.3rem .7rem;border-radius:8px;font-weight:600}
.farbe-prev .fp-tab{background:color-mix(in srgb,var(--p) 14%,#fff);border-bottom:3px solid var(--p);padding:.3rem .7rem;border-radius:6px 6px 0 0}
.logo-box{border:1px dashed var(--line);border-radius:10px;padding:.8rem;background:#fff;display:flex;align-items:center;justify-content:center;min-height:90px}
.logo-box img{max-height:80px;max-width:100%}
/* Inventur */
.inv-progress{height:10px;border-radius:99px;background:#e2e8f0;overflow:hidden;margin:.4rem 0}
.inv-progress div{height:100%;background:var(--brand);transition:width .3s}
.inv-locs{display:flex;flex-wrap:wrap;gap:.3rem .9rem}.inv-locs label{font-weight:400;display:flex;gap:.3rem;align-items:center;margin:0}.inv-locs input{width:auto}
.inv-bar{position:sticky;top:var(--topbar-h,58px);z-index:6;background:var(--bg,#f4f6f9);padding:.5rem 0 .3rem;margin-bottom:.4rem}
.inv-bar-top{display:flex;gap:.6rem;align-items:center;justify-content:space-between}
.inv-tools{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}.inv-tools input[type=search]{flex:1 1 220px;font-size:1.05rem}
.inv-loc{margin:0 0 .4rem;font-size:1rem}
.inv-row{display:grid;grid-template-columns:1fr 9.5rem 7.5rem;gap:.6rem;align-items:center;padding:.5rem .3rem;border-top:1px solid var(--line)}
.inv-row:first-of-type{border-top:0}
.inv-info{display:flex;flex-direction:column;min-width:0}.inv-info small{color:var(--muted,#64748b)}
.inv-input{display:flex;align-items:center;gap:.3rem}.inv-input input{font-size:1.15rem;text-align:right;padding:.45rem .5rem}
.inv-unit{font-size:.8rem;color:var(--muted,#64748b);min-width:2rem}
.inv-state{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap;font-size:.85rem}
.inv-row.done{background:rgba(var(--brand-rgb),.05)}.inv-row.done .inv-input input{border-color:rgba(var(--brand-rgb),.5)}
.inv-row.saving{opacity:.6}.inv-row.error .inv-input input{border-color:#dc2626;background:#fef2f2}
.inv-row.focus{outline:3px solid var(--brand);outline-offset:2px;border-radius:8px}
.ok-mark{color:#16a34a;font-weight:700}
.inv-diff{font-weight:700;padding:0 .3rem;border-radius:5px}.inv-diff.neg{background:#fee2e2;color:#b91c1c}.inv-diff.pos{background:#dcfce7;color:#166534}
@media (max-width:640px){.inv-row{grid-template-columns:1fr 8rem}.inv-state{grid-column:1/-1}}
.inv-print td,.inv-print th{padding:1.6mm 2mm;font-size:9pt}
.inv-blank{display:inline-block;width:22mm;border-bottom:1px solid #334155;height:5mm}
.inv-sign{display:grid;grid-template-columns:1fr 1fr;gap:15mm;margin-top:14mm}.inv-sign div{border-top:1px solid #334155;padding-top:1mm;font-size:8pt;color:#64748b}
/* Auftrag mehreren Mitarbeitern zuweisen */
.team-pick{display:flex;flex-direction:column;gap:.35rem;margin-top:.35rem}
.team-grp{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.team-grp-h{font-size:.75rem;color:var(--muted,#64748b);text-transform:uppercase;letter-spacing:.04em;width:100%}
.team-chip{display:inline-flex;align-items:center;gap:.35rem;margin:0;padding:.3rem .65rem;border:1px solid var(--line,#d1d5db);border-radius:999px;background:#fff;cursor:pointer;font-weight:400;user-select:none}
.team-chip input{width:auto;margin:0;accent-color:var(--brand)}
.team-chip:has(input:checked){background:rgba(var(--brand-rgb),.12);border-color:var(--brand);font-weight:600}
.team-drop{position:relative;display:inline-block}
.team-drop summary{list-style:none;cursor:pointer;padding:.25rem .55rem;border:1px solid var(--line,#d1d5db);border-radius:6px;font-size:.9rem;background:#fff;min-width:9rem;max-width:16rem}
.team-drop summary::-webkit-details-marker{display:none}
.team-drop summary::after{content:" ▾";color:var(--muted,#64748b)}
.team-drop summary.unassigned{border-color:#d97706;background:#fffbeb;color:#92400e;font-weight:600}
.team-pop{margin-top:.35rem;width:min(20rem,75vw);background:#fff;border:1px solid var(--line,#d1d5db);border-radius:10px;padding:.6rem;box-shadow:0 10px 30px rgba(0,0,0,.15)}
.team-pop button{margin-top:.5rem}
.team-drop summary::before{content:none!important;display:none!important}
