:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;color:#17202a;background:#f4f6f8}*{box-sizing:border-box}body{margin:0}.top{position:sticky;top:0;z-index:5;background:#111827;color:#fff;padding:12px 16px;display:flex;gap:16px;align-items:center;justify-content:space-between}.brand{font-weight:800}.nav{display:flex;gap:8px;flex-wrap:wrap}.nav a{color:#fff;text-decoration:none;padding:7px 9px;border-radius:8px;background:#273449}.wrap{max-width:1050px;margin:22px auto;padding:0 14px}.card{background:#fff;border-radius:14px;padding:18px;margin-bottom:16px;box-shadow:0 2px 14px #0000000f}h1,h2,h3{margin-top:0}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}label{font-size:.86rem;font-weight:650;display:block;margin-bottom:5px}input,select,textarea,button{width:100%;padding:11px;border:1px solid #cfd6df;border-radius:9px;font-size:16px;background:#fff}button,.btn{background:#111827;color:#fff;border:0;text-decoration:none;display:inline-block;text-align:center;cursor:pointer}.btn.secondary{background:#e7ebf0;color:#111827}.btn.good{background:#0a7a45}.btn.warn{background:#a64000}.actions{display:flex;gap:8px;flex-wrap:wrap}.actions>*{width:auto}.muted{color:#687386;font-size:.9rem}.ok{padding:10px;background:#e7f7ed;border-radius:8px}.err{padding:10px;background:#ffe9e9;border-radius:8px;color:#8a1f1f}table{width:100%;border-collapse:collapse}th,td{padding:9px;border-bottom:1px solid #e5e9ef;text-align:left;vertical-align:top}th{font-size:.8rem;color:#526070}.amount{text-align:right;white-space:nowrap}.badge{display:inline-block;padding:4px 7px;border-radius:99px;background:#edf1f5;font-size:.78rem}.menu{display:none}.section-anchor{scroll-margin-top:75px}@media(max-width:720px){.grid,.grid3{grid-template-columns:1fr}.wrap{margin-top:12px}.top{align-items:flex-start;flex-direction:column}.nav{width:100%}.nav a{flex:1;text-align:center;font-size:.85rem}table.responsive thead{display:none}table.responsive,table.responsive tbody,table.responsive tr,table.responsive td{display:block;width:100%}table.responsive tr{border:1px solid #e5e9ef;border-radius:10px;margin:8px 0;padding:5px}table.responsive td{border:0;padding:5px}.actions>*{flex:1}}


/* v0.1.6 – robuster Beleg-Viewer ohne CSS-Scale */
.upload-card{padding:20px}.receipt-workspace{display:grid;grid-template-columns:minmax(300px,.82fr) minmax(420px,1.35fr);gap:22px;align-items:stretch}.receipt-fields{min-width:0}.receipt-fields>p{margin:0 0 14px}.receipt-preview-panel{min-width:0;display:flex;flex-direction:column;border-left:1px solid #e5e9ef;padding-left:22px}.preview-header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:10px}.preview-header h2,.receipt-fields h2{margin-bottom:4px}.preview-controls{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}.preview-controls[hidden]{display:none!important}.preview-controls button{width:auto}.preview-btn{width:38px!important;height:36px;padding:0;font-size:21px;line-height:36px}.preview-reset{padding:8px 10px}.preview-controls span{min-width:48px;text-align:center;font-variant-numeric:tabular-nums;font-size:.9rem}.dropzone{position:relative;min-height:142px;border:2px dashed #aeb8c5;border-radius:12px;background:#f8fafc;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center;padding:18px;cursor:pointer;transition:.15s ease;margin-top:5px}.dropzone:hover,.dropzone:focus,.dropzone.dragover{border-color:#111827;background:#edf2f7;outline:none}.dropzone.dragover{transform:scale(1.01)}.dropzone-icon{font-size:34px;line-height:1}.dropzone span,.dropzone small{color:#687386}.receipt-file-input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}.selected-file{font-size:.85rem;color:#526070;padding:7px 2px 12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.upload-submit{margin-top:2px}.preview-stage{position:relative;overflow:hidden;min-height:560px;height:calc(100vh - 245px);max-height:780px;border:1px solid #d8dee7;border-radius:12px;background:#fff}.preview-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;color:#7a8594;padding:30px}.preview-placeholder[hidden]{display:none!important}.preview-placeholder-icon{font-size:52px;color:#aab3c0}.image-canvas{position:absolute;inset:0;overflow:auto;cursor:grab;touch-action:none;-webkit-overflow-scrolling:touch}.image-canvas[hidden]{display:none!important}.image-canvas.dragging{cursor:grabbing}.image-scroll-content{position:relative;min-width:100%;min-height:100%}.image-scroll-content img{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;max-width:none!important;max-height:none!important;user-select:none;-webkit-user-drag:none;pointer-events:none}.preview-stage iframe{position:absolute;inset:0;width:100%;height:100%;min-height:560px;border:0;background:white}.preview-stage iframe[hidden]{display:none!important}
@media(max-width:900px){.receipt-workspace{grid-template-columns:1fr}.receipt-preview-panel{border-left:0;border-top:1px solid #e5e9ef;padding-left:0;padding-top:20px}.preview-stage{height:62vh;min-height:420px}.preview-stage iframe{min-height:420px}}
@media(max-width:520px){.upload-card{padding:14px}.preview-header{display:block}.preview-controls{justify-content:flex-start;margin-top:10px}.preview-stage{height:52vh;min-height:330px}.preview-stage iframe{min-height:330px}.dropzone{min-height:125px}}

/* v0.1.7 – Safari/Trackpad Zoom + stabiler Pixel-Zoom */
.image-scroll-content{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:100%;
  min-height:100%;
  position:relative;
}
.image-scroll-content img{
  position:static!important;
  left:auto!important;
  top:auto!important;
  transform:none!important;
  flex:0 0 auto;
  max-width:none!important;
  max-height:none!important;
  object-fit:contain;
  user-select:none;
  -webkit-user-select:none;
  -webkit-user-drag:none;
  pointer-events:none;
}
.image-canvas{
  overscroll-behavior:contain;
  touch-action:none;
}

/* v0.1.8 – Belegliste, Auswahl, Popup und SMTP-Debug */
.settle-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.select-all-row{display:flex;align-items:center;gap:10px;padding:12px 10px;border-bottom:1px solid #e5e7eb}.select-all-row input,.receipt-check{width:18px;height:18px;accent-color:#111827}.receipt-table-wrap{overflow-x:auto}.receipt-table{width:100%;border-collapse:collapse}.receipt-table th,.receipt-table td{padding:11px 10px;border-bottom:1px solid #edf0f3;text-align:left}.receipt-table th{font-size:.86rem;color:#64748b}.receipt-table .amount-col{text-align:right;white-space:nowrap}.receipt-table .view-col{width:44px;text-align:center}.eye-btn{border:0;background:transparent;color:#111827;font-size:20px;line-height:1;cursor:pointer;padding:6px;border-radius:8px}.eye-btn:hover{background:#eef2f7}.settle-actions{margin-top:14px}.preview-submit:disabled{opacity:.45;cursor:not-allowed}
.receipt-modal{position:fixed;inset:0;background:rgba(15,23,42,.70);display:none;align-items:center;justify-content:center;padding:24px;z-index:9999}.receipt-modal.open{display:flex}.receipt-modal-dialog{background:#fff;width:min(1100px,96vw);height:min(850px,92vh);border-radius:16px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 24px 70px rgba(0,0,0,.35)}.receipt-modal-head{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #e5e7eb}.modal-close{background:transparent;border:0;font-size:30px;line-height:1;cursor:pointer;color:#111827}.receipt-modal-body{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:#e9edf2;overflow:auto}.receipt-preview-frame{width:100%;height:100%;border:0}.receipt-preview-image{max-width:100%;max-height:100%;object-fit:contain}.preview-summary{padding:10px 0 16px}.pdf-preview-shell{height:70vh;border:1px solid #d8dee8;border-radius:12px;overflow:hidden;background:#e9edf2}.pdf-preview-frame{width:100%;height:100%;border:0}.preview-final-actions{justify-content:flex-end;margin-top:16px}.smtp-debug{width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.86rem;white-space:pre;background:#0b1220;color:#dbeafe;border:1px solid #334155}.smtp-debug.debug-ok{outline:2px solid rgba(22,163,74,.22)}.smtp-debug.debug-error{outline:2px solid rgba(220,38,38,.25)}
@media(max-width:720px){.receipt-table th:nth-child(2),.receipt-table td:nth-child(2){white-space:nowrap}.receipt-modal{padding:8px}.receipt-modal-dialog{width:100%;height:94vh;border-radius:12px}.pdf-preview-shell{height:64vh}}

/* v0.1.9 – einheitliche Belegaktionen: ansehen, bearbeiten, löschen */
.receipt-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;white-space:nowrap}.receipt-row-actions .inline-delete{display:inline;margin:0}.action-icon{display:inline-flex!important;align-items:center;justify-content:center;width:34px!important;height:34px!important;min-width:34px;padding:0!important;border:0;border-radius:8px;text-decoration:none;font-size:19px;line-height:1;background:transparent!important;color:#111827!important;cursor:pointer}.action-icon:hover{background:#eef2f7!important}.edit-icon{font-size:20px}.delete-icon{color:#c62828!important;font-size:18px}.delete-icon:hover{background:#ffebee!important;color:#a91515!important}.receipt-actions-table .actions-col{width:126px}.receipt-actions-table td.receipt-row-actions{width:126px}.settle-project .view-col{width:126px!important}.settle-project td.view-col{min-width:126px}.actions .action-icon{flex:0 0 34px}
@media(max-width:720px){table.responsive td.receipt-row-actions{display:flex;width:100%;justify-content:flex-end;border-top:1px solid #edf0f3;margin-top:4px;padding-top:8px}.settle-project .receipt-row-actions{min-width:118px}}

/* v0.2.1 – Accountname + hierarchische Admin-Auslagenübersicht */
.top-right{display:flex;align-items:center;gap:14px;min-width:0}.account-name{font-size:.78rem;color:#cbd5e1;white-space:nowrap;max-width:180px;overflow:hidden;text-overflow:ellipsis}.admin-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:end}.filter-actions{display:flex;gap:8px}.filter-actions>*{flex:1}.tree{border:1px solid #e5e9ef;border-radius:11px;background:#fff;margin:9px 0;overflow:hidden}.tree>summary{cursor:pointer;list-style:none;display:flex;justify-content:space-between;gap:14px;align-items:center;padding:13px 15px;background:#f8fafc}.tree>summary::-webkit-details-marker{display:none}.tree>summary:before{content:'›';display:inline-block;margin-right:8px;font-size:22px;transition:transform .15s}.tree[open]>summary:before{transform:rotate(90deg)}.tree>summary span:last-child{margin-left:auto}.tree-level{padding:6px 12px 12px 22px}.project-tree>summary{background:#eef2f7}.project-tree>summary strong{font-size:1.05rem}.driver-tree>summary{background:#f8fafc}.report-tree>summary{background:#fff}.report-details{padding:14px}.report-toolbar{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:12px}.inline-form{display:inline;margin:0}.inline-form button{width:auto}.paid-stamp{color:#087443;font-weight:700;margin-left:8px}.open-stamp{color:#a64000;font-weight:700;margin-left:8px}.payment-stamp-box{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#f7faf8;border:1px solid #dcebe2;border-radius:10px;padding:10px 12px;margin:10px 0 14px}.payment-stamp-text{font-weight:700;color:#087443}.payment-stamp-edit{display:flex;align-items:center;gap:6px;margin:0}.payment-stamp-edit input{width:185px;padding:7px;font-size:.88rem}.payment-stamp-edit select{width:125px;padding:7px;font-size:.88rem}.receipt-admin-table .action-icon{margin:auto}.customer-report-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid #e5e9ef}.customer-report-row form{margin:0}.customer-report-row button{width:auto}
@media(max-width:900px){.admin-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.top-right{width:100%;flex-direction:column;align-items:flex-end;gap:6px}.account-name{max-width:none}.report-toolbar,.payment-stamp-box{flex-direction:column;align-items:stretch}.payment-stamp-edit{flex-wrap:wrap}.tree-level{padding-left:10px}}
@media(max-width:520px){.admin-filter-grid{grid-template-columns:1fr}.top-right{align-items:flex-start}.filter-actions{flex-direction:column}.tree>summary{align-items:flex-start;flex-wrap:wrap}.tree>summary span:last-child{margin-left:30px}.payment-stamp-edit input,.payment-stamp-edit select{width:100%}.customer-report-row{align-items:stretch;flex-direction:column}.customer-report-row button{width:100%}}

/* v0.3.0 – Mobile-first, minimalistische iOS-artige Oberfläche */
:root{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Helvetica Neue",Arial,sans-serif;
  color:#1d1d1f;background:#f5f5f7;--surface:#fff;--line:#e5e5ea;--muted:#6e6e73;--accent:#007aff;--danger:#ff3b30;--success:#34c759;
}
html{-webkit-text-size-adjust:100%;background:#f5f5f7}body{background:#f5f5f7;color:#1d1d1f;font-weight:400;letter-spacing:-.01em}
.app-header{position:sticky;top:0;z-index:100;background:rgba(250,250,252,.86);backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:1px solid rgba(0,0,0,.08);padding-top:env(safe-area-inset-top)}
.header-inner{max-width:1180px;margin:auto;min-height:58px;padding:8px 18px;display:flex;align-items:center;gap:14px}.app-brand{display:flex;align-items:baseline;gap:7px;text-decoration:none;color:#1d1d1f;white-space:nowrap}.brand-title{font-size:1.02rem;font-weight:650;letter-spacing:-.025em}.brand-version{font-size:.69rem;color:#8e8e93;font-weight:500}.header-account{margin-left:auto;display:flex;align-items:center;gap:7px;color:#6e6e73;font-size:.76rem;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-dot{width:6px;height:6px;border-radius:50%;background:#34c759;flex:0 0 auto}.app-nav{display:flex;align-items:center;gap:6px}.nav-dropdown{position:relative}.nav-dropdown>summary{list-style:none;cursor:pointer;padding:8px 11px;border-radius:10px;font-size:.86rem;font-weight:560;color:#1d1d1f;user-select:none}.nav-dropdown>summary::-webkit-details-marker{display:none}.nav-dropdown>summary:hover,.nav-dropdown[open]>summary{background:#e9e9ed}.chevron{font-size:.76rem;color:#8e8e93;margin-left:3px}.nav-popover{position:absolute;right:0;top:42px;width:260px;background:rgba(255,255,255,.97);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);border:1px solid rgba(0,0,0,.09);border-radius:16px;padding:6px;box-shadow:0 12px 38px rgba(0,0,0,.14)}.nav-popover a{display:flex;flex-direction:column;gap:1px;padding:10px 11px;border-radius:11px;text-decoration:none;color:#1d1d1f}.nav-popover a:hover{background:#f2f2f7}.nav-popover a span{font-size:.88rem;font-weight:590}.nav-popover a small{font-size:.71rem;color:#8e8e93}.logout-link{font-size:.8rem;color:#8e8e93;text-decoration:none;padding:8px}.logout-link:hover{color:#ff3b30}
.wrap{max-width:1120px;margin:20px auto;padding:0 16px 40px}.card{background:rgba(255,255,255,.98);border:1px solid rgba(0,0,0,.055);border-radius:18px;padding:20px;margin-bottom:14px;box-shadow:0 1px 2px rgba(0,0,0,.025)}h1{font-size:1.55rem;letter-spacing:-.035em;font-weight:680;margin-bottom:16px}h2{font-size:1.12rem;letter-spacing:-.02em;font-weight:640}h3{font-weight:620}p{line-height:1.45}.muted,small{color:#8e8e93}.optional{font-weight:450;color:#8e8e93;font-size:.78rem}
label{font-size:.78rem;font-weight:590;color:#4a4a4f;margin-bottom:6px}input,select,textarea{min-height:44px;padding:10px 12px;border:1px solid #d1d1d6;border-radius:11px;font-size:16px;background:#fff;color:#1d1d1f;outline:none;transition:border-color .15s,box-shadow .15s}input:focus,select:focus,textarea:focus{border-color:#0a84ff;box-shadow:0 0 0 3px rgba(0,122,255,.12)}button,.btn{min-height:44px;padding:10px 15px;border-radius:11px;background:#007aff;color:#fff;font-size:.92rem;font-weight:600;border:0;box-shadow:none;transition:transform .06s,opacity .15s}button:active,.btn:active{transform:scale(.985)}.btn.secondary,button.secondary{background:#f2f2f7;color:#1d1d1f}.btn.good,button.good{background:#34c759}.btn.warn,button.warn{background:#ff9500}.ok{background:#effaf2;color:#176b35;border:1px solid #d5f2dd;border-radius:12px}.err{background:#fff1f0;color:#a31d17;border:1px solid #ffd8d5;border-radius:12px}.badge{background:#f2f2f7;color:#6e6e73}
.grid,.grid3{gap:12px}.grid p,.grid3 p{margin:0}.dropzone{border:1.5px dashed #c7c7cc;border-radius:16px;background:#fafafa;min-height:132px}.dropzone:hover,.dropzone:focus,.dropzone.dragover{border-color:#007aff;background:#f3f8ff}.dropzone-icon{color:#007aff}.upload-submit{background:#007aff}.receipt-preview-panel{border-left-color:#ececf0}.preview-stage{border-color:#e5e5ea;border-radius:16px;background:#f7f7f8}.preview-btn{background:#f2f2f7!important;color:#1d1d1f!important}.eye-btn,.action-icon{border-radius:10px!important}.delete-icon{color:#ff3b30!important}.delete-icon:hover{background:#fff0ef!important}
.tree{border-color:#e5e5ea;border-radius:14px}.tree>summary,.project-tree>summary,.driver-tree>summary,.report-tree>summary{background:#fafafa}.paid-stamp{color:#248a3d}.open-stamp{color:#ff9500}.payment-stamp-box{border-color:#d8efdD;background:#f6fbf7;border-radius:12px}.admin-filter-grid{gap:10px}.section-anchor{scroll-margin-top:78px}
@media(max-width:760px){
  .header-inner{padding:7px 12px;min-height:56px;flex-wrap:wrap;gap:7px}.app-brand{order:1}.header-account{order:2;max-width:48%;font-size:.72rem}.app-nav{order:3;width:100%;display:grid;grid-template-columns:1fr 1fr auto;gap:7px}.app-nav .nav-dropdown>summary{background:#fff;border:1px solid #e5e5ea;text-align:center;min-height:40px;display:flex;align-items:center;justify-content:center;padding:7px 9px}.nav-popover{position:fixed;left:10px;right:10px;top:auto;width:auto;margin-top:5px;border-radius:18px;padding:7px;box-shadow:0 18px 55px rgba(0,0,0,.18)}.logout-link{display:flex;align-items:center;justify-content:center;background:#fff;border:1px solid #e5e5ea;border-radius:10px;padding:7px 10px}.wrap{margin:12px auto;padding:0 10px 28px}.card{border-radius:16px;padding:15px;margin-bottom:10px}h1{font-size:1.34rem;margin-bottom:13px}h2{font-size:1.05rem}.grid,.grid3,.admin-filter-grid{grid-template-columns:1fr}.receipt-workspace{grid-template-columns:1fr;gap:16px}.receipt-preview-panel{border-left:0;border-top:1px solid #ededf0;padding:15px 0 0}.preview-header .muted{font-size:.74rem}.preview-stage{height:44vh;min-height:285px}.preview-stage iframe{min-height:285px}.dropzone{min-height:118px}.settle-head{display:block}.settle-actions{grid-template-columns:1fr}.receipt-table-wrap{margin:0 -5px}.receipt-table th,.receipt-table td{padding:10px 6px;font-size:.84rem}.receipt-table th:nth-child(3),.receipt-table td:nth-child(3){max-width:130px;overflow:hidden;text-overflow:ellipsis}.receipt-row-actions{gap:2px}.action-icon{width:38px!important;height:38px!important}.filter-actions{display:grid;grid-template-columns:1fr 1fr}.tree-level{padding:5px 7px 9px}.tree>summary{padding:12px 10px}.report-toolbar,.payment-stamp-box{gap:9px}.payment-stamp-edit{display:grid;grid-template-columns:1fr 1fr auto auto;width:100%}.payment-stamp-edit input,.payment-stamp-edit select{width:100%}.pdf-preview-shell{height:58vh}
}
@media(max-width:430px){.brand-title{font-size:.95rem}.brand-version{font-size:.63rem}.header-account{font-size:.69rem}.app-nav{grid-template-columns:1fr 1fr 42px}.logout-link{font-size:0}.logout-link:after{content:'↪';font-size:19px}.receipt-table th:nth-child(2),.receipt-table td:nth-child(2){white-space:nowrap}.preview-controls{display:grid;grid-template-columns:38px 52px 38px 1fr;width:100%}.preview-reset{width:100%}.customer-report-row .good{width:100%}}

.admin-open-alert{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff7e6;border:1px solid #ffd18a;border-radius:16px;padding:14px 16px;margin:0 0 16px}.admin-open-alert div{display:flex;flex-direction:column;gap:3px}.admin-open-alert span{font-size:13px;color:#6e5a31}.warning-list{margin-top:16px;background:#fff7e6;border:1px solid #ffd18a;border-radius:14px;padding:14px}.warning-row{display:flex;justify-content:space-between;gap:14px;padding:9px 0;border-top:1px solid rgba(120,90,20,.12)}.warning-row:first-of-type{margin-top:8px}.receipt-fields small{display:block;margin-top:6px}@media(max-width:700px){.admin-open-alert,.warning-row{align-items:flex-start;flex-direction:column}.admin-open-alert .btn{width:100%;text-align:center}}
/* v0.3.2 – kompakter, bedarfsgesteuerter Admin-Filter */
.admin-overview-head{padding-bottom:16px}.admin-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.smart-filter-form{margin-top:16px;border-top:1px solid #ececf0;padding-top:14px}.filter-builder{display:grid;grid-template-columns:minmax(220px,320px) minmax(240px,1fr);gap:10px;align-items:end}.filter-builder-select,.filter-editor{display:flex;flex-direction:column}.filter-editor[hidden]{display:none}.amount-filter{display:grid;grid-template-columns:1fr 1fr;gap:10px}.active-filter-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:11px}.filter-chip{min-height:32px;padding:6px 9px 6px 11px;border-radius:999px;background:#eef5ff;color:#125da5;border:1px solid #d8e8fb;font-size:.78rem;font-weight:570;display:inline-flex;align-items:center;gap:7px}.filter-chip b{font-size:1rem;line-height:1;color:#6e8fb0}.smart-filter-actions{display:flex;gap:8px;margin-top:10px}.smart-filter-actions button{min-height:38px;padding:8px 12px;font-size:.84rem}.smart-filter-actions #resetFiltersBtn{margin-left:auto}.smart-filter-actions #applyFilterBtn[hidden]{display:none}
@media(max-width:700px){.filter-builder{grid-template-columns:1fr}.amount-filter{grid-template-columns:1fr 1fr}.smart-filter-actions{display:grid;grid-template-columns:1fr 1fr}.smart-filter-actions #resetFiltersBtn{margin-left:0}.filter-chip{max-width:100%;overflow:hidden}.filter-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}

/* v0.4.0 – globaler UI/UX-Feinschliff, mobile first */
:root{
  --control-h:46px;
  --radius:12px;
  --radius-card:18px;
  --space-1:6px;
  --space-2:10px;
  --space-3:14px;
  --space-4:18px;
  --space-5:24px;
  --text:#1d1d1f;
  --muted:#73737a;
  --line:#e7e7eb;
  --surface:#ffffff;
  --surface-soft:#f7f7f9;
  --accent:#007aff;
}

/* Rhythm & typography */
body{line-height:1.42;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
h1,h2,h3{color:var(--text)}
h1{margin:0 0 var(--space-4)}
h2{margin:0 0 var(--space-3)}
h3{margin:0 0 var(--space-2)}
p{margin:0 0 var(--space-3)}
.card>p:last-child,.card>form:last-child,.card>table:last-child{margin-bottom:0}
hr{height:1px;border:0;background:var(--line);margin:var(--space-5) 0}

/* Every form control gets the same geometry */
label{display:block;margin:0 0 6px;line-height:1.2}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea,
button,
.btn{
  min-height:var(--control-h);
  border-radius:var(--radius);
  font-family:inherit;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea{
  width:100%;
  padding:0 13px;
  border:1px solid #d6d6dc;
  background:#fff;
  color:var(--text);
  font-size:16px;
  line-height:1.2;
}
textarea{padding:12px 13px;min-height:104px;resize:vertical}
select{appearance:auto}
button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 15px;line-height:1.15;white-space:nowrap}
button:focus-visible,.btn:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid rgba(0,122,255,.22);outline-offset:2px}
button:disabled,.btn[aria-disabled="true"],input:disabled,select:disabled{opacity:.48;cursor:not-allowed}

/* Consistent field spacing – also fixes old inline <p> layouts */
form>p,.receipt-fields>p,.grid>p,.grid3>p{margin:0}
form>p+ p,.receipt-fields>p+ p{margin-top:var(--space-3)}
.grid,.grid3{gap:var(--space-3)}
.grid>*,.grid3>*{min-width:0}
small,.muted{line-height:1.35}
label+input,label+select,label+textarea{margin-top:0}
input+small,select+small,textarea+small{margin-top:6px}

/* Cards and section separation */
.card{border:1px solid rgba(0,0,0,.055);box-shadow:0 1px 2px rgba(0,0,0,.025);overflow:visible}
.section-anchor{scroll-margin-top:84px}
.card details{border:1px solid var(--line);border-radius:14px;background:#fff;margin-top:10px;overflow:hidden}
.card details>summary{min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;cursor:pointer;background:#fafafa;list-style:none}
.card details>summary::-webkit-details-marker{display:none}
.card details>summary::after{content:'⌄';font-size:.9rem;color:#8e8e93;transition:transform .15s ease;margin-left:auto}
.card details[open]>summary::after{transform:rotate(180deg)}
.card details>form,.card details>.tree-level,.card details>.report-details{padding:14px}
.card details>form+form{padding-top:0}

/* Actions align exactly like controls */
.actions{align-items:center;gap:var(--space-2)}
.actions>button,.actions>.btn,.actions>a.btn{min-height:var(--control-h)}
.actions>select,.actions>input{min-height:var(--control-h)}
.actions>select{flex:1 1 220px;width:auto}
.actions>form{margin:0}
.inline-form,.inline-delete{margin:0}

/* Tables: calmer, more legible */
table{border-collapse:separate;border-spacing:0}
th,td{padding:12px 10px;border-bottom:1px solid #ededf1}
th{font-size:.76rem;font-weight:650;letter-spacing:.01em;color:#77777e;background:#fafafa}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:#fcfcfd}
.amount,.amount-col{font-variant-numeric:tabular-nums}

/* Alerts */
.ok,.err,.admin-open-alert,.warning-list{padding:13px 14px;border-radius:14px}

/* Upload page spacing */
.receipt-workspace{gap:24px}.receipt-fields{display:flex;flex-direction:column;gap:0}.receipt-fields>h2{margin-bottom:14px}
.receipt-fields>.proposal-box{margin:12px 0 2px}
.proposal-box{padding:14px;border-radius:14px;background:#f7f9fc;border:1px solid #e3e9f2}
.proposal-box strong{display:block;margin-bottom:5px}.proposal-box p.muted{font-size:.84rem;margin-bottom:12px}.proposal-box button{margin-top:2px}.proposal-box small{margin-top:8px}
.dropzone{margin-top:0}.selected-file{padding:8px 2px 12px}.upload-submit{margin-top:0}
.preview-header{margin-bottom:12px}.preview-controls button{min-height:38px}

/* Compact account/menu polish */
.header-inner{min-height:60px}.header-account{padding:5px 8px;border-radius:999px;background:rgba(118,118,128,.08)}
.nav-dropdown>summary{min-height:38px;display:flex;align-items:center}
.nav-popover a{min-height:52px;justify-content:center}

/* Filter builder */
.filter-builder{gap:12px}.filter-builder-select,.filter-editor{gap:0}.smart-filter-actions{align-items:center}.smart-filter-actions button{min-height:40px}
.filter-chip{min-height:34px}

/* Buttons with icons are intentionally square, not generic 46px */
.action-icon{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;border-radius:10px!important;padding:0!important}
.eye-btn.action-icon{width:38px!important}
.modal-close{width:42px!important;height:42px!important;min-height:42px!important;padding:0!important}
.preview-btn{width:40px!important;height:40px!important;min-height:40px!important;padding:0!important}

/* Mobile: one obvious column, generous touch targets, no accidental crowding */
@media(max-width:760px){
  :root{--control-h:48px;--space-3:13px;--space-4:16px}
  .wrap{padding-left:10px;padding-right:10px}
  .card{padding:15px;border-radius:16px}
  .header-inner{min-height:56px}
  .header-account{max-width:52%;padding:4px 7px}
  .app-nav{gap:6px}
  .app-nav .nav-dropdown>summary,.logout-link{min-height:42px}
  .nav-popover a{min-height:56px;padding:11px 12px}
  .grid,.grid3{gap:13px}
  .actions{display:grid;grid-template-columns:1fr;gap:9px;width:100%}
  .actions>*{width:100%!important}
  .actions>form{width:100%}.actions>form>button{width:100%}
  .receipt-fields label{margin-top:0}
  .receipt-fields>p+ p{margin-top:13px}
  .dropzone{min-height:126px;padding:16px 12px}
  .dropzone strong{font-size:.96rem}.dropzone span,.dropzone small{font-size:.79rem}
  .receipt-row-actions{display:flex!important;justify-content:flex-end!important;gap:4px!important}
  .receipt-row-actions .action-icon{width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important}
  table.responsive tr{border:1px solid var(--line);border-radius:14px;margin:9px 0;padding:8px;background:#fff}
  table.responsive td{padding:6px 4px}
  .card details>summary{min-height:52px;padding:12px}
  .card details>form,.card details>.tree-level,.card details>.report-details{padding:12px}
  .filter-builder,.amount-filter{grid-template-columns:1fr}
  .smart-filter-actions{grid-template-columns:1fr}.smart-filter-actions button{min-height:46px}
  .admin-open-alert .btn{min-height:44px}
}

@media(max-width:430px){
  h1{font-size:1.28rem}h2{font-size:1.03rem}
  .header-account{max-width:46%}
  .card{padding:14px}
  .preview-controls{gap:5px}
}

.receipt-status{display:inline-flex;align-items:center;margin-top:5px;padding:3px 7px;border-radius:999px;font-size:.72rem;font-weight:600;line-height:1.2}.receipt-status.open{background:#effaf2;color:#176b35;border:1px solid #d5f2dd}


/* v0.4.2 – mobile UI consistency and unambiguous receipt actions */
.field-help-link{display:inline-flex;align-items:center;gap:4px;margin-top:8px;color:#007aff;text-decoration:none;font-size:.84rem;font-weight:560;line-height:1.3}.field-help-link:hover{text-decoration:underline}.form-submit-row{margin-top:24px}.form-submit-row button{width:auto;min-width:132px}.receipt-view-button{width:auto!important;min-width:148px!important;padding:0 14px!important}.receipt-view-button span{font-size:17px;line-height:1}.actions .receipt-view-button{flex:0 0 auto}.eye-btn.action-icon{font-size:18px!important}
@media(max-width:760px){.form-submit-row{margin-top:22px}.form-submit-row button{width:100%;min-height:50px}.receipt-view-button{width:100%!important;min-height:48px!important}.field-help-link{min-height:36px;padding:5px 0;font-size:.85rem}}

/* v0.4.4 – PayPal-Hilfe, Zahlungsreferenz und sichere Datenverwaltung */
.label-with-info{display:flex;align-items:center;gap:7px;position:relative}.info-dot{width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;padding:0!important;border-radius:999px!important;background:#eef5ff!important;color:#0877df!important;border:1px solid #d6e8fb!important;font-size:15px!important;line-height:1!important}.info-popover{position:absolute;z-index:50;top:34px;right:0;width:min(340px,calc(100vw - 36px));padding:13px 14px;background:#fff;border:1px solid #dddfe5;border-radius:14px;box-shadow:0 12px 36px rgba(0,0,0,.12);display:flex;flex-direction:column;gap:8px;font-size:.84rem;line-height:1.4;font-weight:400}.info-popover[hidden]{display:none}.info-popover strong{font-size:.9rem}.info-popover a{color:#007aff;text-decoration:none;font-weight:600}.payment-reference{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 13px;margin:12px 0;background:#f7f7f9;border:1px solid #e6e6ea;border-radius:13px}.payment-reference span{display:flex;flex-direction:column;gap:2px;min-width:0}.payment-reference small{color:#777}.payment-reference strong{font-size:.9rem;overflow-wrap:anywhere}.payment-reference .copy-reference{min-height:38px;flex:0 0 auto}.paypal-pay-button{background:#0070ba!important;color:#fff!important;border-color:#0070ba!important}.data-manage-list{display:flex;flex-direction:column;gap:10px}.data-manage-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-bottom:1px solid #ededf1}.data-manage-row:last-child{border-bottom:0}.data-manage-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.data-manage-actions form{margin:0}.danger-confirm-form{display:flex;align-items:center;gap:7px;margin:0}.danger-confirm-form input{width:210px!important;min-height:40px!important;font-size:14px!important}.danger{background:#fff1f0!important;color:#b42318!important;border:1px solid #f3c5c0!important}.danger:hover:not(:disabled){background:#fee4e2!important}.danger-note{margin-top:14px;padding:12px 13px;border-radius:13px;background:#fff8e8;border:1px solid #f4dfad;color:#785b10;font-size:.84rem}.year-delete-form{max-width:440px}
@media(max-width:760px){.info-popover{position:fixed;left:12px;right:12px;top:auto;bottom:18px;width:auto;max-height:62vh;overflow:auto}.payment-reference{align-items:flex-start;flex-direction:column}.payment-reference .copy-reference{width:100%!important}.data-manage-row{align-items:stretch;flex-direction:column}.data-manage-actions{display:grid;grid-template-columns:1fr;justify-content:stretch}.data-manage-actions form,.danger-confirm-form{width:100%}.danger-confirm-form{display:grid;grid-template-columns:1fr}.danger-confirm-form input,.danger-confirm-form button{width:100%!important}.year-delete-form{max-width:none}.year-delete-row{padding-bottom:16px}}


/* v0.5.0 – mobile receipt analysis / OCR */
.receipt-analysis{margin-top:14px;padding:14px;border:1px solid var(--border,#e5e5e7);border-radius:16px;background:var(--surface-soft,#f8f8fa)}
.analysis-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.analysis-spinner{font-size:.82rem;color:var(--muted,#6e6e73)}
.quality-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.quality-item{display:flex;align-items:center;gap:9px;padding:10px;border-radius:12px;background:var(--card,#fff);border:1px solid var(--border,#e5e5e7)}.quality-item>span{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-weight:700;flex:0 0 auto}.quality-item.okq>span{background:#e9f8ee;color:#16753a}.quality-item.warnq>span{background:#fff3df;color:#9a5b00}.quality-item strong{display:block;font-size:.88rem}.quality-item small{display:block;color:var(--muted,#6e6e73);margin-top:2px}
.ocr-suggestions{margin-top:10px}.suggestion-list{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border-radius:12px;background:var(--card,#fff);border:1px solid var(--border,#e5e5e7);font-size:.9rem}.suggestion-list span{display:block}.analysis-message{padding:10px 12px;border-radius:12px;background:var(--card,#fff);font-size:.9rem}.analysis-message.warning{background:#fff3df}.analysis-note{margin:9px 2px 0!important}
html[data-theme="dark"] .quality-item.okq>span{background:#173d25;color:#8be4a9}html[data-theme="dark"] .quality-item.warnq>span{background:#493518;color:#ffd28a}html[data-theme="dark"] .analysis-message.warning{background:#493518}
@media(max-width:700px){.quality-grid{grid-template-columns:1fr}.receipt-analysis{padding:12px;margin-top:12px}.analysis-head{align-items:flex-start}.suggestion-list{font-size:.88rem}}

/* v0.5.1 – sichtbare Online-Fahrer-Karte + robuster Dark Mode */
.header-user-area{margin-left:auto;display:flex;align-items:center;gap:7px;min-width:0;flex:0 1 auto}
.header-user-area .header-account{margin-left:0;min-width:0;max-width:210px;overflow:visible}
.header-user-area .account-name{display:block;min-width:0;max-width:165px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:inherit}
.theme-toggle{display:inline-grid!important;place-items:center!important;flex:0 0 38px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;padding:0!important;border-radius:999px!important;border:1px solid #dedee3!important;background:#f2f2f7!important;color:#1d1d1f!important;cursor:pointer;position:relative;z-index:3;box-shadow:none!important}
.theme-toggle:hover{background:#e8e8ed!important}.theme-toggle:active{transform:scale(.95)}.theme-toggle-symbol{font-size:18px;line-height:1;pointer-events:none}
.online-drivers-card{padding:16px 18px;margin-bottom:14px}.online-drivers-head{display:flex;align-items:center;justify-content:space-between;gap:14px}.online-title{display:flex;align-items:center;gap:11px;min-width:0}.online-title h2{margin:0 0 2px;font-size:1.02rem}.online-title p{margin:0;font-size:.78rem}.online-pulse{width:10px;height:10px;border-radius:50%;background:#34c759;box-shadow:0 0 0 5px rgba(52,199,89,.12);flex:0 0 auto}.online-count{display:grid;place-items:center;min-width:32px;height:32px;padding:0 9px;border-radius:999px;background:#edf9f0;color:#207a36;font-weight:700;font-size:.86rem}.online-driver-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.online-driver-row{display:flex;align-items:center;gap:8px;min-width:220px;max-width:100%;padding:9px 10px;border:1px solid #e7e7eb;border-radius:13px;background:#fafafa}.online-dot{width:8px;height:8px;border-radius:50%;background:#34c759;flex:0 0 auto}.online-driver-name{display:flex;flex-direction:column;min-width:0;flex:1}.online-driver-name strong{font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.online-driver-name small{font-size:.7rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.online-now{font-size:.69rem;font-weight:650;color:#248a3d;background:#ebf8ee;border-radius:999px;padding:4px 7px}.online-empty{display:flex;align-items:center;gap:8px;padding:9px 2px;color:#8e8e93;font-size:.82rem}.online-empty-icon{font-size:18px;color:#aeaeb2}

html[data-theme="dark"]{color-scheme:dark;background:#0b0c0f;--surface:#15161a;--line:#2c2d33;--muted:#a1a1aa;--accent:#0a84ff;--danger:#ff453a;--success:#30d158}
html[data-theme="dark"] body{background:#0b0c0f;color:#f5f5f7}
html[data-theme="dark"] .app-header{background:rgba(18,19,22,.90);border-bottom-color:rgba(255,255,255,.09)}
html[data-theme="dark"] .app-brand,html[data-theme="dark"] .nav-dropdown>summary{color:#f5f5f7}
html[data-theme="dark"] .brand-version,html[data-theme="dark"] .header-account,html[data-theme="dark"] .muted,html[data-theme="dark"] small,html[data-theme="dark"] .optional{color:#a1a1aa}
html[data-theme="dark"] .header-account{background:rgba(255,255,255,.07)}
html[data-theme="dark"] .theme-toggle{background:#25262b!important;border-color:#36373d!important;color:#f5f5f7!important}
html[data-theme="dark"] .theme-toggle:hover{background:#303138!important}
html[data-theme="dark"] .nav-dropdown>summary:hover,html[data-theme="dark"] .nav-dropdown[open]>summary{background:#25262b}
html[data-theme="dark"] .nav-popover{background:rgba(28,29,33,.97);border-color:rgba(255,255,255,.10);box-shadow:0 16px 44px rgba(0,0,0,.45)}
html[data-theme="dark"] .nav-popover a{color:#f5f5f7}html[data-theme="dark"] .nav-popover a:hover{background:#292a30}
html[data-theme="dark"] .card,html[data-theme="dark"] .receipt-modal-dialog{background:#15161a;border-color:#292a30;box-shadow:none}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] label{color:#f5f5f7}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#1d1e23;color:#f5f5f7;border-color:#383940}
html[data-theme="dark"] input:focus,html[data-theme="dark"] select:focus,html[data-theme="dark"] textarea:focus{border-color:#0a84ff;box-shadow:0 0 0 3px rgba(10,132,255,.20)}
html[data-theme="dark"] .btn.secondary,html[data-theme="dark"] button.secondary,html[data-theme="dark"] .preview-btn{background:#292a30!important;color:#f5f5f7!important}
html[data-theme="dark"] .badge,html[data-theme="dark"] .filter-chip{background:#27282d;color:#c7c7cc;border-color:#3a3b42}
html[data-theme="dark"] table td,html[data-theme="dark"] table th{border-bottom-color:#292a30}html[data-theme="dark"] tbody tr:hover td{background:#1b1c20}
html[data-theme="dark"] .tree,html[data-theme="dark"] .tree>summary,html[data-theme="dark"] .project-tree>summary,html[data-theme="dark"] .driver-tree>summary,html[data-theme="dark"] .report-tree>summary{background:#18191d;border-color:#2c2d33;color:#f5f5f7}
html[data-theme="dark"] .dropzone,html[data-theme="dark"] .proposal-box,html[data-theme="dark"] .receipt-analysis,html[data-theme="dark"] .quality-item,html[data-theme="dark"] .suggestion-list,html[data-theme="dark"] .analysis-message{background:#191a1f;border-color:#35363d;color:#f5f5f7}
html[data-theme="dark"] .dropzone:hover,html[data-theme="dark"] .dropzone:focus,html[data-theme="dark"] .dropzone.dragover{background:#172333;border-color:#0a84ff}
html[data-theme="dark"] .preview-stage,html[data-theme="dark"] .receipt-modal-body,html[data-theme="dark"] .pdf-preview-shell{background:#101114;border-color:#303138}
html[data-theme="dark"] .payment-reference,html[data-theme="dark"] .payment-stamp-box{background:#1a1b1f;border-color:#33343a}
html[data-theme="dark"] .info-popover{background:#202126;color:#f5f5f7;border-color:#393a41;box-shadow:0 16px 44px rgba(0,0,0,.48)}
html[data-theme="dark"] .admin-open-alert,html[data-theme="dark"] .warning-list,html[data-theme="dark"] .danger-note{background:#302817;border-color:#5b4822;color:#f5f5f7}
html[data-theme="dark"] .warning-row{border-top-color:#4b3c22}
html[data-theme="dark"] .online-drivers-card{background:#15161a;border-color:#292a30}
html[data-theme="dark"] .online-count{background:#16341f;color:#78dc92}
html[data-theme="dark"] .online-driver-row{background:#1b1c20;border-color:#303138}
html[data-theme="dark"] .online-now{background:#17351f;color:#7ee39a}
html[data-theme="dark"] .receipt-status.open{background:#17351f;color:#7ee39a;border-color:#285c36}
html[data-theme="dark"] .action-icon{color:#f5f5f7!important}html[data-theme="dark"] .action-icon:hover{background:#292a30!important}
html[data-theme="dark"] .smtp-debug{background:#08090b;color:#dce7ff;border-color:#343640}
html[data-theme="dark"] hr{border-color:#2c2d33}

@media(max-width:760px){
  .header-user-area{order:2;margin-left:auto;max-width:55%;gap:5px}.header-user-area .header-account{max-width:calc(100% - 43px);padding:4px 7px}.header-user-area .account-name{max-width:120px}.theme-toggle{width:38px!important;height:38px!important;flex-basis:38px!important}
  .online-drivers-card{padding:14px}.online-driver-list{display:grid;grid-template-columns:1fr;width:100%}.online-driver-row{min-width:0;width:100%}.online-title p{font-size:.72rem}
  html[data-theme="dark"] .app-nav .nav-dropdown>summary,html[data-theme="dark"] .logout-link{background:#1d1e23;border-color:#34353b;color:#f5f5f7}
}
@media(max-width:430px){.header-user-area{max-width:58%}.header-user-area .account-name{max-width:92px}.online-title p{display:none}}
