:root{--bg:#f6f7f8;--panel:#fff;--ink:#273238;--muted:#718087;--line:#e1e6e9;--accent:#e8924f;--good:#e8f3e8;--warn:#fff2cc;--bad:#fce8e6}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--ink)}.hidden{display:none!important}
.auth-screen{min-height:100vh;display:grid;place-items:center;padding:24px;background:#eef1f2}.auth-card{width:min(420px,100%);background:#fff;border:1px solid var(--line);border-radius:14px;padding:28px;box-shadow:0 14px 40px rgba(39,50,56,.08)}.app-link{font-weight:800;font-size:24px;color:var(--ink);text-decoration:none}.auth-card>p{color:var(--muted)}.auth-form{display:grid;gap:10px}.auth-form input,.dialog-card input,.dialog-card select{width:100%;border:1px solid var(--line);border-radius:8px;padding:10px;background:#fff}
.sidebar{position:fixed;inset:0 auto 0 0;width:216px;background:#f1f3f4;border-right:1px solid var(--line);padding:24px 16px;display:flex;flex-direction:column}.brand{font-weight:800;font-size:19px;margin:2px 10px 30px;color:var(--ink);text-decoration:none}.brand span{font-weight:600}nav{display:grid;gap:7px}.nav{border:0;background:transparent;text-align:left;padding:11px 12px;border-radius:10px;color:#4b5a61;font-size:14px;cursor:pointer}.nav.active{background:#fff;font-weight:650}.project-small{margin-top:auto;padding:12px;border-top:1px solid var(--line);display:grid;gap:5px}.project-small span{font-size:12px;color:var(--muted)}
main{margin-left:216px;padding:28px 30px 50px}.topbar{display:flex;justify-content:space-between;gap:20px;margin-bottom:22px}.topbar-main{min-width:0}.eyebrow{font-size:11px;letter-spacing:.13em;color:var(--muted);margin:0 0 6px;font-weight:700}.title-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.topbar h1{font-size:25px;margin:0}.gross-badge{display:flex;flex-direction:column;justify-content:center;min-width:255px;padding:10px 14px;background:#fff;border:2px solid #50636d;border-radius:12px;box-shadow:0 2px 10px rgba(39,50,56,.05)}.gross-badge span{font-size:11px;color:var(--muted);display:block;margin-bottom:5px;letter-spacing:.02em}.gross-badge span strong{font-weight:800;color:var(--ink)}.gross-badge>strong{font-size:20px;line-height:1.1;color:var(--ink);font-variant-numeric:tabular-nums}.scope{margin-top:7px;font-size:11px;color:var(--muted)}.top-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
button{font:inherit}.primary{border:0;background:var(--accent);color:#fff;padding:11px 16px;border-radius:9px;font-weight:700;cursor:pointer}.secondary{border:1px solid var(--line);background:#fff;color:var(--ink);padding:10px 15px;border-radius:9px;font-weight:650;cursor:pointer}.compact{padding-inline:11px}
.kpis{display:grid;grid-template-columns:repeat(5,minmax(145px,1fr));gap:10px;margin-bottom:16px}.kpi{background:#fff;border:1px solid var(--line);padding:15px 16px;border-radius:11px}.kpi span{font-size:11px;color:var(--muted);display:block;margin-bottom:7px}.kpi strong{font-size:19px}.kpi.warn{background:#fffaf0}.kpi.good{background:#f5faf5}
.panel{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}.panel-head{padding:17px 18px 14px;display:flex;justify-content:space-between;gap:20px;align-items:center;border-bottom:1px solid var(--line)}.panel-head h2{margin:0 0 4px;font-size:17px}.panel-head p{margin:0;color:var(--muted);font-size:12px}.filters{display:flex;gap:8px}.filters input,.filters select{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 10px}
.table-wrap{overflow:auto;max-height:calc(100vh - 270px)}.table-wrap.small{max-height:260px;border:1px solid var(--line);border-radius:8px}table{width:100%;border-collapse:collapse;font-size:12px;min-width:1050px}th{position:sticky;top:0;background:#50636d;color:white;text-align:left;padding:10px 9px;font-size:11px;z-index:2}td{padding:8px 9px;border-bottom:1px solid #edf0f1;white-space:nowrap}td.money{text-align:right;font-variant-numeric:tabular-nums}.status-chip{font-size:10px;font-weight:800;border-radius:10px;padding:3px 7px}.status-chip.ok{background:var(--good);color:#356538}.status-chip.open{background:var(--bad);color:#8b1a1a}.status-chip.check{background:var(--warn);color:#7a5a00}.status-chip.review{background:#e8eef2;color:#455a64}.allocation-note{background:var(--warn);color:#7a5a00;font-weight:650}
.source-list{padding:4px 18px 18px}.source{display:grid;grid-template-columns:1.4fr .6fr .9fr .7fr .7fr;gap:12px;padding:13px 3px;border-bottom:1px solid var(--line)}.source span{color:var(--muted);font-size:12px}
dialog{border:0;border-radius:14px;padding:0;width:min(690px,calc(100% - 30px));box-shadow:0 22px 70px rgba(0,0,0,.24)}dialog::backdrop{background:rgba(28,36,40,.45)}.dialog-card{padding:22px}.dialog-card.wide{width:min(1080px,94vw)}.dialog-card.small{width:100%;max-width:500px}.dialog-card label{display:grid;gap:5px;font-size:12px;color:#5d6b71;margin:10px 0}.dialog-head{display:flex;justify-content:space-between;align-items:flex-start}.dialog-head h2{margin:0 0 15px}.icon{border:0;background:transparent;font-size:28px;color:#6f7c82;cursor:pointer}.dropzone{border:1.5px dashed #b7c1c6;background:#fafbfb;border-radius:12px;min-height:155px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;cursor:pointer}.dropzone.drag{border-color:var(--accent);background:#fff8f1}.dropzone input{display:none}.dropzone span{font-size:12px;color:var(--muted)}
.file-queue{display:grid;gap:6px;margin:12px 0}.file-row{display:flex;justify-content:space-between;background:#f6f7f8;border-radius:8px;padding:8px 10px;font-size:12px}.privacy{display:grid;gap:5px;background:#f3f7f8;padding:11px 12px;border-radius:9px;font-size:12px}.privacy span{color:#5f6f76}.status{min-height:20px;font-size:12px;margin:10px 2px}.status.error{color:#a52a25}.status.ok{color:#356538}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.review-section{margin-top:16px}.review-section h3{font-size:13px;margin:0 0 7px}.scope-checks{display:flex;gap:10px;flex-wrap:wrap}.scope-checks label{display:flex!important;gap:4px!important;align-items:center;margin:0!important}.scope-checks input{width:auto!important}.check{grid-template-columns:auto 1fr!important;align-items:center}.check input{width:auto!important}.mini{border:1px solid var(--line);background:#fff;padding:5px 8px;border-radius:7px;cursor:pointer;font-size:11px}
@media(max-width:900px){.sidebar{width:72px;padding:22px 8px}.brand{font-size:0;margin:0 0 24px;text-align:center}.brand:before{content:"KBN";font-size:15px}.nav{font-size:0;text-align:center}.nav:before{content:"•";font-size:24px}.project-small{display:none}main{margin-left:72px;padding:20px 14px}.kpis{grid-template-columns:repeat(2,1fr)}.topbar{flex-direction:column}.top-actions{width:100%;justify-content:flex-start}.panel-head{align-items:flex-start;flex-direction:column}.filters{width:100%}.filters input{flex:1}.source{grid-template-columns:1fr}.table-wrap{max-height:65vh}}
.action-chip{display:inline-block;font-size:10px;font-weight:800;border-radius:10px;padding:3px 7px}
.action-chip.add{background:#e5f3e4;color:#2e6b2e}.action-chip.update{background:#e5eef3;color:#365765}
.warning-chip{display:inline-block;background:#fff2cc;color:#7a5a00;font-size:10px;font-weight:700;border-radius:9px;padding:3px 6px}
.review-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.review-title span{font-size:11px;color:var(--muted)}
.pick{width:17px;height:17px}.source-excerpt{max-width:320px;white-space:normal;color:#53636a}

.alloc-input{width:122px;min-width:110px;border:1px solid #cfd8dc;border-radius:7px;padding:7px 8px;background:#fff;font:inherit;text-align:right;font-variant-numeric:tabular-nums}
.alloc-input:focus{outline:2px solid rgba(232,146,79,.24);border-color:#d88746}
.alloc-input:disabled{background:#f3f5f6;color:#819097}
.alloc-save{border:1px solid #d88746;background:#fff8f1;color:#98531f;padding:6px 9px;border-radius:7px;font-weight:700;cursor:pointer;font-size:11px;white-space:nowrap}
.alloc-save:hover{background:#fff0e2}
.compact-status{margin:0;min-height:0;text-align:right;max-width:420px}
.row-saving{opacity:.68}


.cost-scope-toolbar{display:flex;align-items:center;gap:12px;padding:12px 18px 0;background:#fff;flex-wrap:wrap}.cost-scope-label{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.scope-toggle{display:inline-flex;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:#f7f8f9}.scope-option{border:0;border-right:1px solid var(--line);background:transparent;padding:8px 12px;font-size:12px;font-weight:700;color:#586870;cursor:pointer}.scope-option:last-child{border-right:0}.scope-option.active{background:#50636D;color:#fff}.cost-scope-hint{font-size:11px;color:var(--muted)}
.sum-strip{
  display:grid;
  grid-template-columns:repeat(5,minmax(145px,1fr));
  gap:1px;
  background:#dfe5e8;
  border-bottom:1px solid var(--line)
}
.sum-item{
  background:#f7f9fa;
  padding:10px 12px;
  min-height:58px;
  display:flex;
  flex-direction:column;
  justify-content:center
}
.sum-item span{
  display:block;
  color:var(--muted);
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.035em;
  margin-bottom:5px
}
.sum-item strong{
  font-size:15px;
  font-variant-numeric:tabular-nums;
  color:var(--ink)
}
.sum-item.delta-positive strong{color:#8b1a1a}
.sum-item.delta-negative strong{color:#356538}
@media(max-width:900px){
  .sum-strip{grid-template-columns:repeat(2,minmax(140px,1fr))}
  .title-row{align-items:flex-start}
  .gross-badge{width:100%;min-width:0}
  .kpis{grid-template-columns:repeat(2,minmax(145px,1fr))}
}

/* V5.5: direkte Tabellenbearbeitung und präzises Importprotokoll */
.cell-input,.cell-textarea{box-sizing:border-box;width:100%;min-width:92px;border:1px solid #ced8dd;border-radius:6px;background:#fff;padding:6px 7px;font:inherit;color:var(--ink)}
.cell-input.money-edit{min-width:118px;text-align:right;font-variant-numeric:tabular-nums}
.cell-input.text-wide{min-width:160px}.cell-input.text-xwide{min-width:230px}
.cell-textarea{min-width:220px;min-height:42px;resize:vertical;line-height:1.25}
.cell-input:focus,.cell-textarea:focus{outline:2px solid rgba(232,146,79,.22);border-color:#d88746}
.cell-input:disabled,.cell-textarea:disabled{background:#f3f5f6;color:#78868c}
.auto-cell{background:#f5f7f8;color:#5d6a70;font-variant-numeric:tabular-nums}
.row-save{border:1px solid #d88746;background:#fff8f1;color:#98531f;padding:6px 9px;border-radius:7px;font-weight:700;cursor:pointer;font-size:11px;white-space:nowrap}
.row-save:hover{background:#fff0e2}.row-save:disabled{opacity:.45;cursor:default}
.table-wrap table{min-width:max-content}.table-wrap th{white-space:nowrap}
.import-protocol{display:flex;flex-direction:column;gap:7px;margin-top:6px}
.import-protocol-title{font-weight:800;margin-bottom:2px}
.diag{display:grid;grid-template-columns:92px 135px minmax(180px,1fr) minmax(260px,2fr);gap:8px;align-items:start;border:1px solid #dbe3e7;border-radius:7px;padding:8px 9px;background:#fff;font-size:11px;line-height:1.3}
.diag.warning{border-color:#e6c49b;background:#fff9f1}.diag.error{border-color:#dfb1b1;background:#fff5f5}.diag.info{background:#f8fafb}
.diag-kind{font-weight:800;text-transform:uppercase;font-size:9px;letter-spacing:.04em;color:#63737b}.diag-loc{font-weight:700;color:#4f5f67}.diag-content{color:#3d4b51}.diag-message{color:#28363c}
.inline-map{display:flex;flex-direction:column;gap:3px}.inline-map small{color:#6e7b81}.action-chip.skip{background:#eef1f3;color:#67757c}.action-chip.ambiguous{background:#fff3e4;color:#9a5a22}
@media(max-width:900px){.diag{grid-template-columns:1fr}.cell-input,.cell-textarea{min-width:125px}}

.alloc-explanation{min-width:220px}

/* V5.9 – ruhigeres Tabellenlayout wie vor der Vollbearbeitung */
#costTable,#allocationTable{
  table-layout:fixed;
  width:max-content;
  min-width:100%;
  border-collapse:collapse;
}
#costTable th,#costTable td,#allocationTable th,#allocationTable td{
  vertical-align:top;
  white-space:normal;
  overflow-wrap:anywhere;
}
#costTable th,#allocationTable th{
  line-height:1.15;
  padding-top:8px;
  padding-bottom:8px;
}
#costTable td,#allocationTable td{
  padding-top:5px;
  padding-bottom:5px;
}
#costTable .cell-input,#costTable .cell-textarea,
#allocationTable .cell-input,#allocationTable .cell-textarea{
  min-width:0;
  width:100%;
}
.cell-textarea.autogrow{
  min-height:34px;
  height:auto;
  overflow:hidden;
  resize:vertical;
  line-height:1.3;
  white-space:pre-wrap;
}
.cell-textarea.text-wide,.cell-textarea.text-xwide{
  min-width:0;
}
.table-wrap{
  overflow-x:auto;
  overflow-y:visible;
}
#costTable thead th,#allocationTable thead th{
  position:sticky;
  top:0;
  z-index:2;
}

.review-workflow{
  display:flex;gap:10px;align-items:flex-start;margin:10px 0 8px;padding:10px 12px;
  border:1px solid #e1c7ae;border-radius:8px;background:#fff8f1;color:#61472f;font-size:12px
}
.review-workflow strong{white-space:nowrap;color:#9a581f}
.review-notes-top{margin:0 0 12px}
.review-summary{display:inline-block;margin-left:12px;padding:4px 8px;border-radius:6px;background:#eef3f6;color:#455a64}
.sticky-actions{position:sticky;bottom:0;background:white;padding-top:10px;border-top:1px solid #e3e8ea;z-index:5}
.import-apply-notice{
  position:fixed;right:24px;bottom:24px;z-index:9999;background:#263238;color:#fff;padding:12px 16px;border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.18);opacity:0;transform:translateY(10px);pointer-events:none;transition:.2s
}
.import-apply-notice.show{opacity:1;transform:translateY(0)}

/* V5.13 – Import-Prüffenster groß, vollständig und tablet-tauglich */
#reviewDialog{
  width:min(96vw,1500px)!important;
  max-width:min(96vw,1500px)!important;
  height:92vh!important;
  max-height:92vh!important;
  overflow:hidden!important;
  border-radius:12px!important;
}
#reviewDialog .dialog-card.wide{
  box-sizing:border-box;
  width:100%!important;
  max-width:none!important;
  height:100%;
  max-height:100%;
  padding:0!important;
  display:flex;
  flex-direction:column;
  overflow:auto;
}
#reviewDialog .dialog-head{
  position:sticky;
  top:0;
  z-index:30;
  background:#fff;
  padding:16px 20px 12px;
  border-bottom:1px solid #e3e8ea;
  flex:0 0 auto;
}
#reviewDialog #reviewMeta{
  margin:12px 18px 0;
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  align-items:center;
}
#reviewDialog .review-workflow{
  margin:10px 18px 8px;
  flex:0 0 auto;
}
#reviewDialog .review-notes-top{
  margin:0 18px 8px;
  max-height:190px;
  overflow:auto;
  flex:0 0 auto;
}
#reviewDialog .review-section{
  margin:12px 18px 0;
  flex:0 0 auto;
}
#reviewDialog .review-title{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-end;
  margin-bottom:6px;
}
#reviewDialog .review-title h3{
  margin:0;
}
#reviewDialog .table-wrap.small{
  max-height:28vh!important;
  min-height:150px;
  overflow:auto!important;
  border:1px solid var(--line);
  border-radius:8px;
}
#reviewDialog #reviewCost,
#reviewDialog #reviewAlloc{
  width:max-content;
  min-width:100%;
  table-layout:auto;
}
#reviewDialog #reviewCost th,
#reviewDialog #reviewAlloc th{
  position:sticky;
  top:0;
  z-index:4;
  white-space:nowrap;
}
#reviewDialog #reviewCost td,
#reviewDialog #reviewAlloc td{
  vertical-align:top;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.3;
}
#reviewDialog .sticky-actions{
  position:sticky!important;
  bottom:0;
  z-index:40;
  margin:14px 0 0!important;
  padding:12px 18px 14px!important;
  background:rgba(255,255,255,.98)!important;
  border-top:1px solid #e3e8ea;
  box-shadow:0 -5px 16px rgba(0,0,0,.08);
  flex:0 0 auto;
}
#reviewDialog .review-summary{
  margin-left:0!important;
}
@media(max-width:900px){
  #reviewDialog{
    width:98vw!important;
    max-width:98vw!important;
    height:94vh!important;
    max-height:94vh!important;
  }
  #reviewDialog .dialog-head{padding:12px 12px 9px}
  #reviewDialog #reviewMeta,
  #reviewDialog .review-workflow,
  #reviewDialog .review-notes-top,
  #reviewDialog .review-section{margin-left:10px;margin-right:10px}
  #reviewDialog .table-wrap.small{max-height:30vh!important}
  #reviewDialog .sticky-actions{padding-left:10px!important;padding-right:10px!important}
}

.combined-source{display:flex;flex-direction:column;gap:5px;min-width:150px}
.combined-source strong{font-size:12px;color:#263238}
.combined-source select{width:100%;min-width:145px;padding:5px 6px;border:1px solid #cfd8dc;border-radius:5px;background:#fff;font-size:11px}

.direct-excel-row{background:#fbfdfd}
.direct-chip{display:block;margin-top:4px;width:max-content;padding:2px 5px;border-radius:4px;background:#e7f3f5;color:#315c66;font-size:9px;font-weight:700}
.combined-pick.needs-choice{border:2px solid #d56b4f!important;background:#fff6f2!important}

.source-combined{background:#f3f8fa;font-weight:650;white-space:nowrap}.not-in-source-sum{background:#fffaf2}.source-excluded{margin-top:4px;font-size:9px;color:#8a5d23;font-weight:700}

.quick-assign{display:flex;gap:5px;flex-wrap:wrap;margin-top:6px}
.quick-assign button{border:1px solid #b8c7cd;background:#fff;border-radius:5px;padding:3px 6px;font-size:10px;cursor:pointer}
.quick-assign button:hover{background:#eef4f6}
.row-save.save-error{border-color:#b84b3a!important;color:#b84b3a!important}

.auto-rule-note{margin-top:4px;font-size:9px;line-height:1.25;color:#52656d;background:#edf4f6;border-radius:4px;padding:3px 5px}

.assignment-required{
  display:inline-block;
  margin:0 0 4px 0;
  padding:3px 6px;
  border-radius:4px;
  background:#fff1b8;
  border:1px solid #e1c766;
  color:#665000;
  font-weight:700;
  font-size:9px;
  letter-spacing:.02em;
}
.assignment-help{
  margin:0 0 5px 0;
  font-size:9px;
  line-height:1.25;
  color:#596b73;
}
.quick-assign.prominent{
  display:flex;
  gap:5px;
  margin-top:6px;
}
.quick-assign.prominent button{
  min-width:58px;
  padding:5px 7px;
  border:1px solid #9eb0b7;
  background:#ffffff;
  border-radius:5px;
  font-size:10px;
  font-weight:600;
  cursor:pointer;
}
.quick-assign.prominent button:hover{
  background:#edf4f6;
}
#allocationTable td.allocation-note{
  background:#fffdf2;
}

.allocation-open-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:8px 0 10px 0;
  padding:8px 10px;
  border:1px solid #dec76a;
  border-radius:6px;
  background:#fff8d9;
  color:#5f5100;
  font-size:11px;
}
.allocation-open-bar strong{font-size:12px}
.open-filter-btn{white-space:nowrap;padding:6px 9px!important}
#allocationTable tr.assignment-open-row td{
  background:#fffbea!important;
  border-top:1px solid #eadc9c;
  border-bottom:1px solid #eadc9c;
}
.ref-with-status{display:flex;flex-direction:column;gap:3px}
.open-left-chip{
  display:inline-block;
  align-self:flex-start;
  padding:2px 5px;
  border-radius:4px;
  background:#f6df78;
  border:1px solid #d3b849;
  color:#5a4800;
  font-size:8px;
  font-weight:800;
  letter-spacing:.03em;
}
.open-left-help{
  margin-top:3px;
  font-size:8px;
  line-height:1.2;
  color:#6a5a12;
  font-weight:600;
}
.assignment-target-cell{
  background:#fff3b8!important;
}
.cell-assign-btn{
  display:block;
  width:100%;
  margin-top:3px;
  padding:3px 4px;
  border:1px solid #c8ad3f;
  border-radius:4px;
  background:#fff;
  color:#5e4d00;
  font-size:8px;
  font-weight:700;
  cursor:pointer;
}
.cell-assign-btn:hover{background:#fff2a8}

.auto-update-row td{background:#f6fbf6!important}
.auto-update-chip{display:inline-block;padding:3px 6px;border-radius:999px;background:#e4f2e5;color:#315f37;font-size:9px;font-weight:800}
.ok-chip{display:inline-block;padding:3px 6px;border-radius:5px;background:#e7f3e8;color:#315f37;font-size:9px;font-weight:700;margin-bottom:3px}


/* V5.32 – aufklappbare Detailzeilen */
.value-with-toggle{display:flex;align-items:center;gap:6px;min-width:132px}.value-with-toggle .cell-input{flex:1;min-width:94px}.detail-toggle,.group-toggle{border:1px solid #bfcbd1;background:#fff;color:#3e5058;border-radius:7px;min-width:28px;height:30px;padding:0 7px;font-weight:800;cursor:pointer}.detail-toggle:hover,.group-toggle:hover{background:#eef3f5}.detail-toggle.has-details{border-color:#7f929b}.detail-toggle.no-details{opacity:.45}.cost-detail-row>td{padding:0!important;background:#f8fafb}.detail-box{padding:10px 16px 12px 40px;border-bottom:1px solid #dfe6e9}.detail-box h4{margin:0 0 7px;font-size:12px;color:#40525a}.detail-mini{width:100%;min-width:720px;border-collapse:collapse;font-size:11px}.detail-mini th{position:static;background:#eef2f4;color:#50636d;font-size:10px;padding:6px 8px}.detail-mini td{padding:6px 8px;background:#fff;border-bottom:1px solid #edf0f1;white-space:normal}.detail-mini tr.detail-open td{background:#fff2cc}.detail-empty{font-size:11px;color:var(--muted);padding:4px 0}.allocation-group-row td{background:#f8fafb;font-weight:650}.allocation-group-row.group-has-open td{background:#fff2cc}.allocation-group-row .group-summary{font-weight:800}.allocation-child-row td:first-child,.allocation-child-row td:nth-child(2){background:#fbfcfd}.allocation-child-row td:nth-child(2){padding-left:24px}.allocation-child-row.assignment-open-row td{background:#fff8df}.group-open-count{display:inline-block;margin-left:7px;background:#f2c94c;color:#5b4b00;border-radius:10px;padding:2px 6px;font-size:9px;font-weight:800}.group-count{color:var(--muted);font-size:10px;font-weight:700}.group-toggle-wrap{display:flex;align-items:center;gap:7px}.invoice-review-chip{display:inline-block;border:1px solid #cbd6da;border-radius:10px;padding:2px 6px;font-size:9px;font-weight:750;color:#52636a;background:#f8fafb}

/* V5.33 Benutzerzugriffe + rücksetzbare Import-Versionen */
.admin-table{max-height:42vh}
.admin-subsection{border-top:1px solid var(--line);padding:16px 18px 18px;background:#fbfcfc}
.admin-subsection .review-title{margin-bottom:10px}
.admin-access-table{max-height:31vh;border:1px solid var(--line);border-radius:8px;background:#fff}
.version-warning{margin:14px 18px;padding:12px 14px;border:1px solid #e6c76c;background:#fff8dc;border-radius:9px;display:flex;gap:8px;flex-direction:column;font-size:12px;line-height:1.4}
.version-warning strong{font-size:13px}
.version-restore{border:1px solid #d88746;background:#fff8f1;color:#98531f;padding:7px 10px;border-radius:7px;font-weight:750;cursor:pointer;white-space:nowrap}
.version-chip{display:inline-block;padding:3px 7px;border-radius:10px;background:#eef2f4;color:#50636d;font-size:10px;font-weight:800}
.access-active{display:inline-block;padding:3px 7px;border-radius:10px;background:var(--good);color:#356538;font-size:10px;font-weight:800}

/* V6.4.6 – ausgeschlossene Doppelzuordnungen */
.ignored-allocation-value{margin-top:4px;padding:4px 6px;border:1px dashed #c8cfd2;border-radius:5px;background:#f2f4f5;color:#8a969b;font-size:10px;line-height:1.15;font-variant-numeric:tabular-nums}
.ignored-allocation-value span{text-decoration:line-through;font-weight:700}
.ignored-allocation-value small{display:block;margin-top:2px;color:#8a969b;font-size:8px;font-weight:700;text-transform:uppercase;letter-spacing:.03em}


/* V5.34 - dezente Verantwortungsfarben und Rechnungsabgleich */
#allocationTable th.allocation-ag-head{background:#E7A9B4!important;color:#4C3336!important}
#allocationTable th.allocation-nk-head{background:#F0C4CD!important;color:#4C373B!important}
#allocationTable th.allocation-nonag-head{background:#B9DDB4!important;color:#304A34!important}
#allocationTable tr:not(.group-has-open):not(.assignment-open-row) td.allocation-ag{background:#F3CCD3!important}
#allocationTable tr:not(.group-has-open):not(.assignment-open-row) td.allocation-nk{background:#F8E0E5!important}
#allocationTable tr:not(.group-has-open):not(.assignment-open-row) td.allocation-nonag{background:#DCEFD8!important}
#allocationTable tr.group-has-open td,#allocationTable tr.assignment-open-row td{background:#FFF2CC!important}
.detail-mini tr.invoice-synthetic td{background:#F7F9FA;color:#59696F}

/* V6.4.6 - Verantwortungsfarben wirklich ueber die komplette Tabellenspalte */
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(7),
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(7) .cell-input,
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(7) .cell-textarea{background:#F3CCD3!important}
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(8),
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(8) .cell-input,
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(8) .cell-textarea{background:#F8E0E5!important}
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(9),
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(9) .cell-input,
#allocationTable tbody tr:not(.group-has-open):not(.assignment-open-row) td:nth-child(9) .cell-textarea{background:#DCEFD8!important}
/* Offene/unklare Vorgänge bleiben als komplette Zeile gelb und haben Vorrang vor den Spaltenfarben. */
#allocationTable tbody tr.group-has-open td,
#allocationTable tbody tr.group-has-open td .cell-input,
#allocationTable tbody tr.group-has-open td .cell-textarea,
#allocationTable tbody tr.assignment-open-row td,
#allocationTable tbody tr.assignment-open-row td .cell-input,
#allocationTable tbody tr.assignment-open-row td .cell-textarea{background:#FFF2CC!important}

/* V6.4.6 – Nachtragswerte exakt unter Auftragsstand ausrichten */
.cost-order-detail-head td{background:#eef2f4;color:#50636d;font-size:10px;font-weight:800;padding:6px 8px;border-bottom:1px solid #dfe6e9;white-space:normal}
.cost-order-detail-item td{background:#fff;font-size:11px;padding:6px 8px;border-bottom:1px solid #edf0f1;white-space:normal;vertical-align:middle}
.cost-order-detail-item td:first-child,.cost-order-detail-head td:first-child{background:#f8fafb}
.cost-order-detail-item .order-amount-cell,.cost-order-detail-head td:nth-last-child(2){font-variant-numeric:tabular-nums;text-align:right}
.cost-order-detail-item .order-amount-cell{background:#f8fafb}
.cost-order-detail-item.detail-open td{background:#fff2cc!important}
.cost-order-detail-empty td{background:#f8fafb;font-size:11px;padding:8px;border-bottom:1px solid #dfe6e9;white-space:normal}
.cost-order-detail-empty span{display:block;color:var(--muted);font-weight:400;margin-top:2px}


/* V6.4.6: Tabellen-Suche mit Treffer-Markierung */
.table-search{display:flex;align-items:center;gap:6px;position:relative;min-width:350px;flex-wrap:wrap}
.table-search input[type="search"]{min-width:210px;flex:1 1 210px;border:1px solid #cfd8dc;border-radius:8px;padding:8px 34px 8px 10px;background:#fff;color:var(--ink)}
.search-btn{padding:8px 11px;white-space:nowrap}
.search-clear{position:absolute;right:88px;top:6px;width:25px;height:25px;border:0;background:transparent;color:#68777e;font-size:18px;line-height:1;cursor:pointer;border-radius:50%}
.search-clear:hover{background:#eef1f2;color:#273238}
.search-count{flex:0 0 100%;font-size:10px;line-height:1.2;color:var(--muted);min-height:12px;text-align:right;padding-right:2px}
.search-count.has-hits{color:#9f2f2f;font-weight:700}
.search-count.no-hits{color:#8b1a1a;font-weight:700}
.allocation-head-tools{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;justify-content:flex-end}
/* Ganze Trefferzeile klar rot umranden – auch bei farbigen Zuordnungsspalten. */
tr.search-hit > td{border-top:2px solid #c43b3b!important;border-bottom:2px solid #c43b3b!important}
tr.search-hit > td:first-child{border-left:2px solid #c43b3b!important}
tr.search-hit > td:last-child{border-right:2px solid #c43b3b!important}
tr.search-hit-first > td{box-shadow:inset 0 0 0 1px rgba(196,59,59,.28)}
.detail-mini tr.search-hit > td{border-top:2px solid #c43b3b!important;border-bottom:2px solid #c43b3b!important}
@media(max-width:1100px){.table-search{min-width:280px}.allocation-head-tools{width:100%;justify-content:stretch}.allocation-head-tools .table-search{flex:1}}

.project-select{min-width:180px;border:1px solid var(--line);background:#fff;color:var(--ink);padding:10px 12px;border-radius:9px;font-weight:650}.kgr-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:6px}.kgr-grid label{display:flex;align-items:center;gap:5px;border:1px solid var(--line);border-radius:7px;padding:7px;background:#f8fafb;font-weight:600}.kgr-grid input{width:auto}.pay-locked{border-color:#d88746!important;background:#fff8f1!important}.project-unlocked{font-size:10px;font-weight:800;color:#356538}.project-locked{font-size:10px;font-weight:800;color:#98531f}

/* V6.4.6 AGB + owner administration */
.owner-grid{display:grid;grid-template-columns:1fr;gap:16px;padding:16px}.admin-box{border:1px solid var(--line);border-radius:11px;padding:16px;background:#fff}.admin-box h3{margin:0 0 12px}.terms-details{margin-top:14px}.terms-details summary{cursor:pointer;font-weight:700}.terms-text{white-space:pre-wrap;font-family:Inter,Arial,sans-serif;font-size:12px;line-height:1.5;background:#f7f9fa;border:1px solid var(--line);border-radius:9px;padding:14px;color:var(--ink)}.terms-scroll{max-height:48vh;overflow:auto}.terms-lead{font-size:13px;color:var(--muted)}.terms-check{align-items:flex-start!important;gap:9px;margin-top:12px;font-size:12px;line-height:1.4}.mandatory-dialog::backdrop{background:rgba(20,30,35,.55)}.inline-settings{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:12px 0}.inline-settings label{display:grid;gap:5px;font-size:11px;font-weight:700}.inline-settings input,.inline-settings select{border:1px solid var(--line);border-radius:8px;padding:9px;background:#fff}.link-button{text-decoration:none;display:inline-flex;align-items:center}.small-note{font-size:11px;color:var(--muted)}.terms-ok{color:#356538;font-weight:700}.terms-missing{color:#8b1a1a;font-weight:700}

/* V6.4.6: AGB-Dialog immer vollständig bedienbar */
#termsDialog{
  width:min(760px,calc(100vw - 28px));
  max-height:calc(100vh - 28px);
  overflow:hidden;
}
#termsDialog .dialog-card{
  width:100%;
  max-height:calc(100vh - 28px);
  display:flex;
  flex-direction:column;
  padding:20px;
  overflow:hidden;
}
#termsDialog .dialog-head,
#termsDialog .terms-lead,
#termsDialog .terms-check,
#termsDialog #termsStatus,
#termsDialog .terms-actions{
  flex:0 0 auto;
}
#termsDialog .terms-scroll{
  flex:1 1 auto;
  min-height:180px;
  max-height:none;
  overflow:auto;
  margin:0;
}
#termsDialog .terms-actions{
  position:sticky;
  bottom:0;
  z-index:5;
  margin:8px -20px -20px;
  padding:12px 20px 16px;
  background:#fff;
  border-top:1px solid var(--line);
  box-shadow:0 -5px 14px rgba(39,50,56,.06);
}
#termsDialog .terms-submit{
  min-width:220px;
}
@media(max-height:700px){
  #termsDialog .dialog-card{padding:14px}
  #termsDialog .terms-scroll{min-height:120px}
  #termsDialog .terms-actions{margin:6px -14px -14px;padding:10px 14px 12px}
}

/* V6.4.6: AGB ohne horizontales Scrollen, Button sofort sichtbar */
#termsDialog{
  width:min(760px,calc(100vw - 24px))!important;
  max-width:calc(100vw - 24px)!important;
  overflow:hidden!important;
}
#termsDialog .dialog-card,
#termsDialog .dialog-card.wide{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
#termsDialog .terms-text{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:hidden!important;
  white-space:pre-wrap!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
}
#termsDialog .terms-check{
  width:100%!important;
  min-width:0!important;
}
#termsDialog .terms-actions{
  width:auto!important;
  justify-content:stretch!important;
  overflow:hidden!important;
}
#termsDialog .terms-submit{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  text-align:center!important;
}

/* V6.2 – Registrierung, Projekttransfer und gemeinsame Projektarbeit */
.share-project-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.share-project-form input{min-width:280px;flex:1;border:1px solid var(--line);border-radius:8px;padding:10px;background:#fff}
.project-transfer-box{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#f7f9fa;display:grid;gap:6px}.project-transfer-box>span{font-size:12px;color:var(--muted)}.project-transfer-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}

/* V6.4.6 – Projektmenü und KGR-Auswahl */
.project-page-actions{display:flex;gap:8px;flex-wrap:wrap}.projects-table-wrap{max-height:none}.projects-active{background:#f3f7f8}.projects-active td:first-child{border-left:4px solid #50636d}.project-actions{display:flex;gap:6px;flex-wrap:wrap}.project-actions .mini{white-space:nowrap}.kgr-selection-btn{display:inline-flex;align-items:center;gap:8px;border:1px solid #cbd5da;background:#fff;border-radius:8px;padding:7px 10px;cursor:pointer;color:var(--ink)}.kgr-selection-btn strong{font-size:12px}.kgr-selection-btn span{font-size:10px;color:var(--muted);font-weight:700}.kgr-selection-btn:hover{border-color:#50636d}.kgr-dialog-section{display:grid;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}.kgr-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.kgr-all-check{margin:0!important;font-weight:700}.brand{font-weight:800}.topbar h1{max-width:680px;overflow-wrap:anywhere}

/* V6.4.6 Registrierung / Infos */
.registration-honeypot{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.nav-info{margin-top:18px;border-top:1px solid var(--line);padding-top:12px}
.info-tabs{display:flex;gap:8px;flex-wrap:wrap;padding:14px 18px;border-bottom:1px solid var(--line);background:#fafbfb}.info-tab{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 13px;cursor:pointer;font-weight:650}.info-tab.active{background:#50636d;color:#fff;border-color:#50636d}.info-body{padding:20px}.info-pane{max-width:920px}.info-pane h3{margin:0 0 10px}.contact-form{display:grid;gap:12px;max-width:720px}.contact-form label{display:grid;gap:6px;font-weight:650}.contact-form input,.contact-form textarea{width:100%;border:1px solid #ced8dd;border-radius:8px;padding:10px;font:inherit;background:#fff}.contact-form textarea{min-height:180px;resize:vertical}.info-terms{max-height:55vh;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}.imprint-card,.placeholder-card,.avatar-placeholder{border:1px solid var(--line);border-radius:12px;background:#fafbfb;padding:18px}.imprint-card{max-width:520px}.imprint-card span{display:block;color:var(--muted);font-size:12px;margin:3px 0 14px}.avatar-placeholder{display:flex;gap:18px;align-items:center}.avatar-orb{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;background:#50636d;color:#fff;font-weight:800;font-size:21px;flex:0 0 auto}.owner-mail-status{margin:14px 18px 0}

/* V6.4.6 Mailtest / vorbereitete Infofunktionen */
.info-tab-disabled,
.info-tab:disabled{
  opacity:.42;
  cursor:not-allowed;
  background:#eef1f2;
  color:#829096;
  border-color:#dfe5e8;
}
.info-tab-disabled:hover{background:#eef1f2}
.mail-test-box{
  max-width:720px;
  border:1px solid #d7dee2;
  border-radius:10px;
  background:#f8fafb;
  padding:14px;
  margin:12px 0 16px;
  display:grid;
  gap:8px;
}
.mail-test-box>span{font-size:12px;color:var(--muted)}
.mail-test-row{display:flex;gap:8px;align-items:center}
.mail-test-row input{
  flex:1 1 auto;
  min-width:0;
  border:1px solid #ced8dd;
  border-radius:8px;
  padding:10px;
  font:inherit;
  background:#fff;
}
@media(max-width:700px){.mail-test-row{flex-direction:column;align-items:stretch}}

/* V6.4.6 Weiterempfehlen */
.recommend-btn{
  width:calc(100% - 24px);
  margin:14px 12px 10px;
  padding:11px 12px;
  border:1px solid #d67f38;
  border-radius:8px;
  background:#e9954e;
  color:#111;
  font-weight:800;
  cursor:pointer;
  text-align:center;
}
.recommend-btn:hover{filter:brightness(.97)}

/* V6.4.6 Projektfreischaltung direkt aus der Projektliste */
.project-unlock-btn{
  border:1px solid #d67f38;
  background:#fff3e8;
  color:#9a4f16;
  border-radius:7px;
  padding:6px 9px;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.project-unlock-btn:hover{background:#ffe8d4}
.project-unlocked{
  display:inline-flex;
  align-items:center;
  gap:5px;
}

/* V6.4.6: Weiter empfehlen deutlich vom Hauptmenü absetzen */
.recommend-btn{
  margin-top:34px !important;
  box-shadow:0 3px 10px rgba(39,50,56,.10);
  border-width:2px !important;
}
.recommend-btn::before{
  content:"";
}

/* V6.4.6 Projektrollen */
#shareRole{
  border:1px solid #ced8dd;
  border-radius:8px;
  padding:9px 10px;
  background:#fff;
  color:var(--ink);
  min-width:130px;
}
.role-chip{font-size:10px;font-weight:800;border-radius:10px;padding:3px 7px;display:inline-block}
.role-chip.view{background:#eef1f2;color:#516168}
.role-chip.edit{background:#e8f3e8;color:#356538}

/* V6.4.6 Projekt-Einladung / Deep-Link */
.project-invite-box{
  margin-top:12px;
  padding:14px;
  border:1px solid #e0e5e7;
  border-radius:10px;
  background:#f8fafb;
  display:grid;
  gap:7px;
}
.project-invite-box>span{font-size:12px;color:var(--muted)}
.project-invite-row{display:flex;gap:8px;align-items:center}
.project-invite-row input{
  flex:1 1 auto;
  min-width:0;
  border:1px solid #ced8dd;
  border-radius:8px;
  padding:10px;
  font:inherit;
  background:#fff;
}
.invite-registration-hint{
  padding:10px 11px;
  border:1px solid #e7c59e;
  background:#fff7ed;
  border-radius:8px;
  font-size:12px;
  line-height:1.4;
}
.invite-registration-hint strong{display:block;font-size:13px;margin-bottom:3px}
@media(max-width:700px){
  .project-invite-row{flex-direction:column;align-items:stretch}
}

/* V6.4.6 Projekteinladungen */
.invite-status{font-size:10px;font-weight:800;border-radius:10px;padding:3px 7px;display:inline-block}
.invite-status.sent{background:#fff1d6;color:#8a5a00}
.invite-status.accepted{background:#e7f4e8;color:#356538}
.invite-status.expired{background:#eef1f2;color:#637177}

/* V6.4.6 ProjektView-Logo oben links */
.projektview-brand{
  display:flex !important;
  align-items:flex-start;
  justify-content:flex-start;
  width:100%;
  min-height:104px;
  box-sizing:border-box;
  padding:15px 10px 12px !important;
  margin:0 0 18px 0 !important;
  background:#fff;
  text-decoration:none;
}
.projektview-brand img{
  display:block;
  width:100%;
  max-width:146px;
  height:auto;
  object-fit:contain;
}
.sidebar nav{
  margin-top:0 !important;
}
@media(max-width:900px){
  .projektview-brand{
    min-height:92px;
    padding:12px 9px 10px !important;
    margin-bottom:14px !important;
  }
  .projektview-brand img{max-width:135px}
}
