:root{
  --bg:#f5f7fb;--surface:#fff;--surface2:#f8fafc;--text:#172033;--muted:#7d8797;--line:#e7ebf1;
  --blue:#2e6cf6;--blue2:#edf4ff;--red:#c84747;--green:#267a48;
  --shadow:0 10px 35px rgba(35,51,84,.08);--radius:18px
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--bg)}
body.menu-open{overflow:hidden}button,input,select{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}.muted{color:var(--muted)}
.app-shell{min-height:100vh;display:grid;grid-template-columns:270px minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid var(--line);padding:22px 16px 18px;display:flex;flex-direction:column;z-index:40}
.sidebar-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:26px}.brand,.auth-brand{display:flex;align-items:center;gap:11px}
.brand-icon{width:42px;height:42px;border-radius:13px;background:linear-gradient(145deg,#2f74ff,#2456d6);color:#fff;display:grid;place-items:center;font-weight:800;font-size:20px;box-shadow:0 8px 20px rgba(46,108,246,.25)}
.brand-text{display:flex;flex-direction:column}.brand-text strong,.auth-brand strong{font-size:16px}.brand-text span,.auth-brand span{font-size:12px;color:var(--muted)}
.main-nav{display:flex;flex-direction:column;gap:5px}.nav-item{min-height:43px;display:flex;align-items:center;gap:11px;border-radius:12px;padding:10px 12px;color:#4f5b6f;font-weight:600;font-size:14px;transition:.15s}
.nav-item:hover,.nav-item.active{background:var(--blue2);color:var(--blue)}.nav-icon{width:20px;text-align:center}.badge{margin-left:auto;background:#eef1f6;color:#687386;border-radius:999px;min-width:24px;padding:3px 7px;text-align:center;font-size:11px}
.nav-section-title{font-size:11px;font-weight:800;color:#a1a9b7;text-transform:uppercase;letter-spacing:.08em;margin:22px 12px 7px}.sidebar-footer{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}.logout{color:#a45555}
.main-area{min-width:0;padding:0 28px 36px}.topbar{min-height:94px;display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid var(--line)}
.topbar-left{display:flex;align-items:center;gap:14px}.topbar h1{margin:0;font-size:27px}.topbar p{margin:3px 0 0;color:var(--muted);font-size:14px}.topbar-actions{display:flex;align-items:center;gap:10px}
.avatar{width:38px;height:38px;border-radius:50%;background:#172033;color:#fff;display:grid;place-items:center;font-weight:800}.btn{border:1px solid transparent;border-radius:11px;padding:11px 15px;font-weight:750;background:#fff}
.btn.primary{background:var(--blue);color:#fff;box-shadow:0 8px 18px rgba(46,108,246,.2)}.btn.secondary{border-color:var(--line);color:#4a566a}.btn.danger{background:#fff0f0;color:var(--red);border-color:#ffdada}.btn.wide{width:100%}
.icon-btn,.more-btn{border:0;background:#fff;color:#596579;border-radius:10px;min-width:38px;height:38px;display:grid;place-items:center}.menu-btn,.mobile-close{display:none}
.toolbar{display:flex;gap:10px;align-items:center;padding:22px 0}.searchbox{flex:1;display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);border-radius:13px;padding:0 14px;height:48px}
.searchbox input{border:0;outline:none;width:100%;background:transparent}.filter-btn{height:48px;padding:0 16px;border:1px solid var(--line);background:#fff;border-radius:13px;color:#566174;font-weight:650}.link-btn{display:flex;align-items:center}
.summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.summary-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px;display:flex;align-items:center;gap:13px;box-shadow:var(--shadow)}
.summary-icon{width:42px;height:42px;border-radius:12px;background:var(--blue2);display:grid;place-items:center}.summary-card strong{display:block;font-size:23px}.summary-card span:last-child{display:block;color:var(--muted);font-size:13px}
.section-head{display:flex;justify-content:space-between;align-items:end;margin:26px 2px 12px}.section-head h2{margin:0 0 3px;font-size:18px}
.document-list{background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow)}
.doc-row{display:grid;grid-template-columns:48px minmax(0,1fr) auto 34px;gap:13px;align-items:center;padding:16px;border-bottom:1px solid var(--line);transition:.15s}.doc-row:last-child{border-bottom:0}.doc-row:hover{background:#fbfdff}
.file-icon{width:43px;height:48px;border-radius:10px;display:grid;place-items:center;font-size:10px;font-weight:900}.file-icon.pdf{background:#fff0f0;color:#c44545;border:1px solid #ffdede}.file-icon.image{background:#eef8ff;color:#3678a8;border:1px solid #dceffc}
.doc-main{min-width:0}.doc-main strong{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.doc-main>span{display:block;color:var(--muted);font-size:12px;margin-top:4px}.tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.tags span{font-size:10px;background:#eef3f8;color:#667085;border-radius:999px;padding:4px 8px}.doc-size{color:var(--muted);font-size:12px}
.empty-state{text-align:center;padding:75px 20px}.empty-icon{font-size:48px}.empty-state h3{margin:10px 0 5px}.flash-wrap{padding-top:18px}.alert{padding:12px 14px;border-radius:11px}.alert.error{background:#fff0f0;color:#a13838}.alert.success{background:#eefaf1;color:var(--green)}
.fab{display:none}.mobile-backdrop{display:none}
.modal-backdrop{position:fixed;inset:0;background:rgba(20,28,45,.42);z-index:80;display:none;place-items:center;padding:18px}.modal-backdrop.show{display:grid}.modal-card{width:min(100%,590px);background:#fff;border-radius:20px;box-shadow:0 25px 70px rgba(20,30,50,.25);padding:22px}
.modal-head{display:flex;justify-content:space-between;align-items:start}.modal-head h2{margin:4px 0 0}.eyebrow{font-size:10px;letter-spacing:.09em;font-weight:800;color:#9aa3b0}.upload-form{display:grid;gap:14px;margin-top:18px}
.dropzone{border:2px dashed #cfd7e5;border-radius:15px;min-height:180px;position:relative;background:#fafcff;transition:.15s}.dropzone.dragging{border-color:var(--blue);background:var(--blue2)}.dropzone input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.dropzone-content{height:100%;min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:7px;color:var(--muted)}.dropzone-content strong{color:var(--text)}.upload-big{font-size:32px;color:var(--blue)}.optional,.field-help{font-size:11px;color:var(--muted);font-weight:500}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:5px}
.auth-page{min-height:100vh;display:grid;place-items:center;padding:20px;background:#f4f7fb}.auth-card{width:min(100%,430px);background:#fff;border:1px solid var(--line);border-radius:22px;padding:30px;box-shadow:var(--shadow)}.auth-card h1{margin:25px 0 5px;font-size:26px}.auth-card form,.edit-card form{display:grid;gap:14px;margin-top:22px}
label{display:grid;gap:7px;font-size:13px;font-weight:700}label input,label select{height:46px;border:1px solid var(--line);border-radius:11px;padding:0 12px;outline:none;background:#fff}
.detail-page{background:var(--bg)}.detail-topbar{height:76px;background:#fff;border-bottom:1px solid var(--line);display:grid;grid-template-columns:180px 1fr auto;align-items:center;padding:0 24px;gap:18px;position:sticky;top:0;z-index:20}.back-link{color:var(--blue);font-weight:700;font-size:14px}.detail-title{display:flex;flex-direction:column;min-width:0}.detail-title strong,.detail-title span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.detail-title span{font-size:12px;color:var(--muted);margin-top:3px}
.detail-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(320px,.6fr);gap:20px;padding:20px;max-width:1500px;margin:0 auto}.viewer-card,.edit-card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.viewer-card{min-height:calc(100vh - 116px);overflow:hidden}.pdf-frame{width:100%;height:calc(100vh - 120px);border:0}.image-preview{min-height:calc(100vh - 116px);display:grid;place-items:center;padding:20px;background:#eef1f5}.image-preview img{max-width:100%;max-height:calc(100vh - 160px);object-fit:contain;box-shadow:0 8px 30px rgba(0,0,0,.15)}
.edit-card{padding:20px;align-self:start;position:sticky;top:96px}.edit-card h2{margin-top:0}.danger-zone{border-top:1px solid var(--line);margin-top:22px;padding-top:4px}.danger-zone form{margin-top:12px}
@media(max-width:980px){
  .app-shell{display:block}.sidebar{position:fixed;left:-290px;top:0;width:270px;height:100dvh;transition:left .2s;box-shadow:0 0 45px rgba(20,30,50,.18)}.sidebar.open{left:0}.menu-btn,.mobile-close{display:grid}.main-area{padding:0 18px 90px}
  .mobile-backdrop{display:block;position:fixed;inset:0;background:rgba(20,28,45,.35);opacity:0;pointer-events:none;transition:.2s;z-index:30}.mobile-backdrop.show{opacity:1;pointer-events:auto}
  .detail-layout{grid-template-columns:1fr}.edit-card{position:static}.viewer-card,.pdf-frame{min-height:65vh;height:65vh}
}
@media(max-width:720px){
  .topbar{align-items:flex-start;padding:18px 0}.topbar-actions .primary,.avatar{display:none}.topbar h1{font-size:23px}.toolbar{display:grid;grid-template-columns:1fr auto}.searchbox{grid-column:1/-1}.summary-grid{grid-template-columns:repeat(3,1fr);gap:8px}.summary-card{padding:12px;gap:8px}.summary-icon{width:34px;height:34px}.summary-card strong{font-size:19px}.summary-card span:last-child{font-size:11px}.doc-row{grid-template-columns:44px minmax(0,1fr) 30px}.doc-size{display:none}.fab{display:grid;position:fixed;right:18px;bottom:18px;width:58px;height:58px;border-radius:50%;border:0;background:var(--blue);color:#fff;font-size:28px;place-items:center;box-shadow:0 10px 28px rgba(46,108,246,.35);z-index:20}
  .detail-topbar{grid-template-columns:auto 1fr;padding:0 14px}.detail-actions{display:none}.detail-layout{padding:12px}.viewer-card,.pdf-frame{height:56vh;min-height:56vh}.edit-card{padding:16px}
}
@media(max-width:520px){
  .main-area{padding-left:13px;padding-right:13px}.summary-grid{grid-template-columns:1fr}.summary-card{padding:14px}.doc-row{padding:13px 11px}.tags{display:none}.modal-card{padding:17px}.modal-actions{display:grid;grid-template-columns:1fr 1fr}
}


.tag-pill{
  display:inline-flex;align-items:center;
  font-size:10px;background:#eef3f8;color:#5f6b7b;
  border-radius:999px;padding:4px 8px;font-weight:650
}
.tag-pill:hover{background:#dfe9f6;color:#2e5f9d}

.tag-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:14px
}
.tag-card{
  background:#fff;border:1px solid var(--line);border-radius:16px;
  padding:17px;display:grid;grid-template-columns:42px 1fr auto;
  align-items:center;gap:12px;box-shadow:var(--shadow);transition:.15s ease
}
.tag-card:hover{transform:translateY(-1px);border-color:#cad7ec}
.tag-card-icon{
  width:42px;height:42px;border-radius:12px;background:var(--blue2);
  display:grid;place-items:center
}
.tag-card-main{display:flex;flex-direction:column;gap:3px}
.tag-card-main strong{font-size:14px}
.tag-card-main span{font-size:12px;color:var(--muted)}
.tag-card-arrow{font-size:25px;color:#9aa3b0}
.detail-tag-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}

@media(max-width:720px){
  .detail-tag-row{display:none}
}


/* v0.3.2 – stabile Dokumentzeilen ohne verschachtelte Links */
.doc-row{
  position:relative;
  display:grid;
  grid-template-columns:48px minmax(0,1fr) auto 38px;
  gap:13px;
  align-items:center;
  min-height:92px;
  padding:16px;
  border-bottom:1px solid var(--line);
  background:#fff;
}
.doc-row:last-child{border-bottom:0}
.doc-row:hover{background:#fbfdff}

.doc-open-link{
  position:absolute;
  inset:0;
  z-index:1;
  border-radius:0;
}

.doc-row > .file-icon,
.doc-row > .doc-main,
.doc-row > .doc-size,
.doc-row > .doc-arrow{
  position:relative;
  z-index:2;
}

.doc-row > .file-icon,
.doc-row > .doc-size{
  pointer-events:none;
}

.doc-title-link{
  display:block;
  position:relative;
  z-index:3;
}
.doc-title-link strong{
  display:block;
  color:var(--text);
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.doc-title-link span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
}

.doc-row .tags{
  position:relative;
  z-index:4;
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  margin-top:8px;
}
.doc-row .tag-pill,
.doc-row .type-pill,
.doc-row .status-pill{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:4px 9px;
  border-radius:999px;
  font-size:10px;
  line-height:1;
  white-space:nowrap;
}
.doc-row .tag-pill{
  background:#eaf2ff;
  color:#3461a4;
  font-weight:700;
}
.doc-row .tag-pill:hover{
  background:#dbe9ff;
}
.doc-row .type-pill{
  background:#f1f3f7;
  color:#677184;
}
.doc-row .status-pill{
  background:#eef8f2;
  color:#397355;
}

.doc-arrow{
  position:relative!important;
  z-index:4!important;
  text-decoration:none;
}

@media(max-width:720px){
  .doc-row{
    grid-template-columns:44px minmax(0,1fr) 34px;
    min-height:78px;
  }
  .doc-row .doc-size{display:none}
}
@media(max-width:520px){
  .doc-row .tags{display:flex}
  .doc-row .tags .type-pill,
  .doc-row .tags .status-pill{display:none}
  .doc-row .tag-pill{font-size:9px;padding:4px 7px}
}


/* =========================================================
   v0.4 – 3-Spalten-Dokumentarbeitsbereich
   ========================================================= */

.doc-workspace{
  display:grid;
  grid-template-columns:minmax(0,1fr) 390px;
  gap:20px;
  align-items:start;
}

.doc-center{
  min-width:0;
}

.right-preview{
  position:sticky;
  top:18px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:18px;
  min-width:0;
}

.right-preview-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.right-preview-head h3{
  margin:4px 0 0;
  font-size:17px;
  line-height:1.25;
}

.preview-tabs{
  display:flex;
  gap:18px;
  border-bottom:1px solid var(--line);
  margin:15px 0;
}

.preview-tab{
  border:0;
  background:transparent;
  padding:0 0 10px;
  color:var(--muted);
  font-size:12px;
  font-weight:750;
  position:relative;
}

.preview-tab.active{
  color:var(--blue);
}

.preview-tab.active::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:2px;
  background:var(--blue);
  border-radius:2px;
}

.preview-document{
  height:390px;
  background:#eef1f6;
  border-radius:14px;
  overflow:hidden;
  display:grid;
  place-items:center;
}

.preview-frame{
  width:100%;
  height:100%;
  border:0;
  background:#fff;
}

.preview-image{
  width:100%;
  height:100%;
  object-fit:contain;
  background:#eef1f6;
}

.hidden{
  display:none!important;
}

.preview-meta{
  margin-top:15px;
  display:grid;
  gap:1px;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  background:var(--line);
}

.preview-meta > div{
  background:#fff;
  padding:10px 12px;
  display:grid;
  grid-template-columns:105px minmax(0,1fr);
  gap:10px;
  align-items:start;
}

.preview-meta span{
  color:var(--muted);
  font-size:11px;
}

.preview-meta strong{
  font-size:11px;
  overflow-wrap:anywhere;
}

.preview-tags-wrap{
  margin-top:15px;
}

.preview-label{
  display:block;
  color:var(--muted);
  font-size:11px;
  margin-bottom:8px;
  font-weight:700;
}

.preview-tag-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  min-height:24px;
}

.muted-small{
  color:var(--muted);
  font-size:11px;
}

.preview-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:16px;
}

.preview-actions .btn{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.preview-empty{
  min-height:500px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:var(--muted);
}

.preview-empty > div{
  font-size:46px;
}

.preview-empty h3{
  margin:10px 0 4px;
  color:var(--text);
}

.preview-empty p{
  margin:0;
}

.previewable-doc{
  cursor:pointer;
}

.previewable-doc.selected{
  background:#f8fbff;
  box-shadow:inset 3px 0 0 var(--blue);
}

.preview-arrow{
  position:relative;
  z-index:4;
  pointer-events:none;
}

.doc-mobile-link{
  position:absolute;
  inset:0;
  z-index:1;
}

.previewable-doc > .file-icon,
.previewable-doc > .doc-main,
.previewable-doc > .doc-size,
.previewable-doc > .preview-arrow{
  position:relative;
  z-index:2;
}

.previewable-doc .tags{
  position:relative;
  z-index:5;
}

.previewable-doc .tag-pill{
  position:relative;
  z-index:6;
}

@media(max-width:1350px){
  .doc-workspace{
    grid-template-columns:minmax(0,1fr) 350px;
  }

  .preview-document{
    height:330px;
  }

  .summary-card{
    padding:14px;
  }
}

@media(max-width:1100px){
  .doc-workspace{
    grid-template-columns:minmax(0,1fr) 320px;
  }

  .right-preview{
    padding:14px;
  }

  .preview-document{
    height:290px;
  }

  .preview-meta > div{
    grid-template-columns:90px minmax(0,1fr);
  }
}

@media(max-width:980px){
  .doc-workspace{
    display:block;
  }

  .right-preview{
    display:none;
  }

  .previewable-doc{
    cursor:default;
  }

  .previewable-doc.selected{
    background:#fff;
    box-shadow:none;
  }
}


/* v0.4.1 – breitere rechte Vorschau */
.doc-workspace{
  grid-template-columns:minmax(0,1fr) 470px;
}

@media(max-width:1350px){
  .doc-workspace{
    grid-template-columns:minmax(0,1fr) 420px;
  }
}

@media(max-width:1180px){
  .doc-workspace{
    grid-template-columns:minmax(0,1fr) 380px;
  }
}

@media(max-width:980px){
  .doc-workspace{
    display:block;
  }
}


/* v0.5 – Kategorien/Ablage */
.category-pill{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:4px 9px;
  border-radius:999px;
  font-size:10px;
  line-height:1;
  white-space:nowrap;
  background:#fff4df;
  color:#8a6220;
  font-weight:700;
}

.preview-category-form{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.category-select-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}

.category-select-row select{
  min-width:0;
  height:42px;
  border:1px solid var(--line);
  border-radius:11px;
  padding:0 10px;
  background:#fff;
}

@media(max-width:520px){
  .doc-row .category-pill{
    display:inline-flex;
  }
}


/* ========================================================
   v0.6 – Layout näher am ursprünglichen Design-Mockup
   ======================================================== */
body{background:#f7f9fc}
.mock-layout{grid-template-columns:245px minmax(0,1fr)}
.mock-sidebar{padding:18px 16px 14px}
.mock-brand-row{margin-bottom:20px}
.mock-brand-row .brand-icon{width:34px;height:34px;border-radius:9px;font-size:16px}
.mock-brand-row .brand-text strong{font-size:15px}
.mock-brand-row .brand-text span{font-size:11px}
.mock-nav{gap:3px}
.mock-nav .nav-item{min-height:38px;padding:8px 10px;font-size:13px;border-radius:9px}
.mock-nav .nav-icon{width:18px;font-size:13px}
.mock-nav .badge{font-size:10px;min-width:21px;padding:2px 6px}
.nav-divider{height:1px;background:var(--line);margin:10px 0}
.nav-chevron{margin-left:auto;color:#a3acba}

.mock-main{padding:0;background:#f7f9fc}
.global-topbar{
  height:72px;background:#fff;border-bottom:1px solid var(--line);
  display:grid;grid-template-columns:auto minmax(360px,520px) 1fr;
  align-items:center;gap:18px;padding:0 22px;
}
.global-search{
  height:42px;border:1px solid #e4e8ef;border-radius:10px;background:#fff;
  box-shadow:0 2px 8px rgba(25,35,55,.04);
  display:flex;align-items:center;padding:0 12px;gap:9px
}
.global-search input{border:0;outline:0;flex:1;min-width:0;color:#586579}
.search-icon{color:#7c8799}
.search-shortcut{font-size:10px;background:#f4f6f9;border:1px solid #eef1f5;border-radius:6px;padding:3px 6px;color:#7e8898}
.global-user{justify-self:end;display:flex;align-items:center;gap:10px;font-size:12px}
.global-user .avatar{width:32px;height:32px;background:#6f48c8}
.global-user strong{font-size:12px}

.document-toolbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:20px 20px 12px
}
.document-actions{display:flex;gap:8px}
.document-actions .btn{height:40px;padding:0 14px;border-radius:8px;font-size:12px}
.upload-main{min-width:190px}
.btn-caret{margin-left:8px}
.view-switch{display:flex;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:#fff}
.view-btn{width:38px;height:38px;border:0;background:#fff;color:#7a8595}
.view-btn.active{background:#f0f5ff;color:var(--blue)}

.documents-heading-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:8px 20px 10px
}
.documents-title{display:flex;align-items:baseline;gap:14px}
.documents-title h1{font-size:18px;margin:0}
.documents-title span{font-size:11px;color:#9099a8}
.list-controls{display:flex;gap:8px}
.btn.compact{padding:8px 11px;border-radius:8px;font-size:11px}

.mock-workspace{
  display:grid;
  grid-template-columns:minmax(480px,1fr) 570px;
  gap:14px;
  padding:0 20px 20px
}
.mock-list-column{min-width:0}
.mock-document-list{background:transparent;border:0;box-shadow:none;border-radius:0;display:flex;flex-direction:column;gap:10px;overflow:visible}
.mock-doc-row{
  position:relative;display:grid;grid-template-columns:44px minmax(0,1fr) 88px 28px;
  align-items:center;gap:12px;min-height:78px;padding:13px 12px;
  background:#fff;border:1px solid #e3e8ef;border-radius:10px;transition:.15s
}
.mock-doc-row:hover,.mock-doc-row.selected{border-color:#d7e2f4;background:#fff}
.mock-doc-row.selected{box-shadow:0 0 0 1px #d8e6ff}
.mock-file-icon{width:34px;height:40px;border-radius:7px;display:grid;place-items:center;font-size:9px;font-weight:800}
.mock-file-icon.pdf{background:#fff0f0;color:#d04545}
.mock-file-icon.image{background:#eef8f3;color:#319465}
.mock-doc-body{min-width:0;position:relative;z-index:3}
.mock-doc-title-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mock-doc-title-line strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.mock-row-tags{display:flex;gap:6px;flex-wrap:wrap}
.tag-pill{font-size:9px!important;min-height:20px!important;padding:3px 7px!important;background:#edf4ff!important;color:#43689e!important}
.tag-pill.category{background:#eaf8ef!important;color:#3c7b56!important}
.mock-doc-subline{display:flex;gap:8px;color:#7c8797;font-size:10px;margin-top:6px}
.mock-doc-meta{text-align:right;display:flex;flex-direction:column;gap:5px;position:relative;z-index:3}
.mock-doc-meta span{font-size:10px;color:#687488}
.mock-doc-meta small{font-size:9px;color:#929baa}
.mock-more{border:0;background:transparent;color:#687488;font-size:18px;position:relative;z-index:4}
.load-more{height:38px;border:1px solid #e3e8ef;background:#fff;border-radius:9px;color:#5f6b7d;font-size:11px}

.mock-detail-panel{
  position:sticky;top:14px;align-self:start;background:#fff;border:1px solid #e3e8ef;
  border-radius:12px;padding:14px 16px 12px;box-shadow:none;min-width:0
}
.mock-detail-header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mock-detail-header h2{font-size:16px;margin:0}
.mock-tabs{display:flex;gap:20px;border-bottom:1px solid var(--line);margin-top:10px}
.mock-tab{border:0;background:transparent;padding:9px 0 10px;font-size:11px;color:#677284;position:relative}
.mock-tab.active{color:var(--blue);font-weight:700}
.mock-tab.active:after{content:"";height:2px;background:var(--blue);position:absolute;left:0;right:0;bottom:-1px}

.detail-content-grid{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:18px;padding-top:14px}
.detail-info h3{font-size:12px;margin:0 0 14px}
.info-field{margin-bottom:12px}
.info-field>span,.preview-label{display:block;font-size:9px;color:#788496;margin-bottom:5px}
.info-field strong{font-size:10px;font-weight:600}
.fake-select,.date-box{
  height:34px;border:1px solid #e2e7ee;border-radius:7px;background:#fff;
  display:flex;align-items:center;justify-content:space-between;padding:0 10px;font-size:10px
}
.info-two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.ocr-status{display:inline-flex;background:#e8f8ed;color:#318254;border-radius:999px;padding:4px 8px!important;font-size:9px!important}
.category-display{min-height:22px}
.mock-category-form{margin-top:6px;padding-top:10px}
.mock-category-form .category-select-row select{height:34px;font-size:10px}
.mock-category-form .btn{padding:0 10px;height:34px;font-size:10px}

.detail-preview-side{min-width:0}
.mock-pdf-preview{height:365px;border:1px solid #e3e8ef;border-radius:7px;background:#f6f7f9}
.preview-mini-toolbar{
  height:34px;border:1px solid #e3e8ef;border-top:0;border-radius:0 0 7px 7px;
  display:flex;align-items:center;justify-content:center;gap:11px;font-size:10px;color:#657083
}
.page-box{border:1px solid #e0e5ec;border-radius:4px;padding:3px 7px;background:#fff}
.reminder-box{margin-top:14px}
.reminder-box>span{display:block;font-size:9px;color:#788496;margin-bottom:6px}

.mock-actions-block{margin-top:14px}
.mock-actions-title{display:block;font-size:10px;font-weight:700;margin-bottom:8px}
.mock-actions-row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}
.mock-actions-row .btn{padding:9px 8px;font-size:10px;text-align:center;justify-content:center;display:flex}
.detail-footer-meta{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:14px;padding-top:10px;border-top:1px solid var(--line)}
.detail-footer-meta div{display:flex;flex-direction:column;gap:3px}
.detail-footer-meta span{font-size:9px;color:#7d8795}
.detail-footer-meta strong{font-size:9px}

.simple-page{background:#f7f9fc}
.simple-shell{max-width:1100px;margin:0 auto;padding:32px 22px}
.simple-shell.narrow{max-width:620px;text-align:center;padding-top:100px}
.simple-shell h1{margin:18px 0 5px}
.category-grid-page{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin-top:22px}
.category-card-page{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px}
.category-card-page>span{font-size:24px}
.category-card-page div{display:flex;flex-direction:column;gap:3px}
.category-card-page small{color:var(--muted)}
.category-card-page.static{cursor:default}
.coming-icon{font-size:48px}

@media(max-width:1450px){
  .mock-workspace{grid-template-columns:minmax(430px,1fr) 520px}
  .detail-content-grid{grid-template-columns:minmax(0,1fr) 245px}
  .mock-pdf-preview{height:330px}
}
@media(max-width:1250px){
  .mock-workspace{grid-template-columns:minmax(420px,1fr) 470px}
  .detail-content-grid{grid-template-columns:1fr}
  .detail-preview-side{display:none}
}
@media(max-width:980px){
  .mock-layout{display:block}
  .mock-sidebar{position:fixed;left:-270px;width:245px}
  .mock-sidebar.open{left:0}
  .mock-main{padding:0}
  .global-topbar{grid-template-columns:auto 1fr auto;padding:0 12px}
  .global-user strong,.global-user>span{display:none}
  .search-shortcut{display:none}
  .document-toolbar,.documents-heading-row{padding-left:12px;padding-right:12px}
  .mock-workspace{display:block;padding:0 12px 80px}
  .mock-detail-panel{display:none}
}
@media(max-width:650px){
  .global-topbar{height:64px}
  .global-search{min-width:0}
  .document-toolbar{align-items:flex-start}
  .document-actions .secondary{display:none}
  .view-switch{display:none}
  .documents-heading-row{align-items:flex-start;gap:10px}
  .documents-title{display:block}
  .documents-title span{display:block;margin-top:3px}
  .list-controls .btn:first-child{display:none}
  .mock-doc-row{grid-template-columns:40px minmax(0,1fr) 24px}
  .mock-doc-meta{display:none}
  .mock-row-tags{margin-top:4px}
}


/* v0.6.1 – Header und Detailspalte aufgeräumt */
.global-topbar{
  grid-template-columns:minmax(360px,520px) 1fr auto;
}

.global-search{
  grid-column:1;
}

.global-user{
  grid-column:3;
  justify-self:end;
  margin-left:auto;
  padding-right:4px;
}

.global-user strong{
  white-space:nowrap;
}

.mock-workspace{
  grid-template-columns:minmax(430px,1fr) 650px;
}

.detail-content-grid{
  grid-template-columns:minmax(0,1fr) 320px;
}

@media(max-width:1500px){
  .mock-workspace{
    grid-template-columns:minmax(430px,1fr) 590px;
  }

  .detail-content-grid{
    grid-template-columns:minmax(0,1fr) 285px;
  }
}

@media(max-width:1280px){
  .mock-workspace{
    grid-template-columns:minmax(420px,1fr) 520px;
  }

  .detail-content-grid{
    grid-template-columns:1fr;
  }

  .detail-preview-side{
    display:none;
  }
}

@media(max-width:980px){
  .global-topbar{
    grid-template-columns:auto minmax(0,1fr) auto;
  }

  .global-search{
    grid-column:2;
  }

  .global-user{
    grid-column:3;
  }
}


/* v0.6.3 – Einheitliches Layout für alle Menü-Unterseiten */
.subpage-topbar{
  grid-template-columns:minmax(360px,520px) 1fr auto;
}
.subpage-heading{
  padding:24px 24px 10px;
}
.subpage-heading h1{
  margin:0;
  font-size:22px;
}
.subpage-heading p{
  margin:5px 0 0;
  font-size:12px;
  color:var(--muted);
}
.subpage-content{
  padding:10px 24px 28px;
}
.subpage-card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:12px;
}
.subpage-card{
  min-height:72px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:11px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:12px;
  transition:.15s ease;
}
.subpage-card:hover{
  border-color:#d4dfef;
  box-shadow:0 4px 16px rgba(35,51,84,.05);
}
.subpage-card.static{
  cursor:default;
}
.subpage-card-icon{
  width:38px;
  height:38px;
  border-radius:9px;
  background:#eef4ff;
  display:grid;
  place-items:center;
  color:#41679e;
  font-size:16px;
}
.subpage-card-main{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.subpage-card-main strong{
  font-size:13px;
}
.subpage-card-main span{
  font-size:10px;
  color:var(--muted);
}
.wide-empty{
  grid-column:1/-1;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
}
.coming-panel{
  min-height:320px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:30px;
}
.coming-panel h2{
  margin:10px 0 4px;
}

@media(max-width:980px){
  .subpage-topbar{
    grid-template-columns:auto minmax(0,1fr) auto;
  }
  .subpage-heading,.subpage-content{
    padding-left:14px;
    padding-right:14px;
  }
}


/* ========================================================
   v0.7 – Bedienung / Filter / Menüs / Inline Edit / Papierkorb
   ======================================================== */
.inline-sort-form{display:flex}
.compact-select{
  height:34px;border:1px solid var(--line);border-radius:8px;background:#fff;
  padding:0 10px;font-size:11px;color:#566174
}
.filter-panel{
  display:none;margin:0 20px 12px;background:#fff;border:1px solid var(--line);
  border-radius:10px;padding:14px
}
.filter-panel.show{display:block}
.filter-grid{
  display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:10px;align-items:end
}
.filter-grid label{font-size:10px}
.filter-grid select,.filter-grid input{
  height:36px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:0 9px;font-size:11px
}
.filter-actions{display:flex;gap:8px;grid-column:1/-1}
.filter-actions .btn{font-size:10px;padding:8px 12px}

.row-menu-wrap{position:relative;z-index:20}
.row-menu-button{position:relative;z-index:21}
.row-menu{
  display:none;position:absolute;right:0;top:32px;width:190px;background:#fff;border:1px solid var(--line);
  border-radius:9px;box-shadow:0 14px 35px rgba(30,42,65,.16);padding:6px;z-index:50
}
.row-menu-wrap.open .row-menu{display:block}
.row-menu>a,.row-menu>button,.row-menu form button{
  width:100%;display:block;text-align:left;border:0;background:transparent;padding:9px 10px;border-radius:6px;
  color:#4f5b6d;font-size:11px;cursor:pointer;text-decoration:none
}
.row-menu>a:hover,.row-menu>button:hover,.row-menu form button:hover{background:#f4f7fb}
.row-menu form{margin:0}
.danger-text{color:#b94343!important}
.small-modal{width:min(100%,430px)}

.inline-edit{
  width:100%;height:34px;border:1px solid #e2e7ee;border-radius:7px;background:#fff;
  padding:0 9px;font-size:10px;color:#374151
}
.autosave-hint{float:right;font-size:8px!important;font-weight:500;color:#9aa4b1!important}
.autosave-hint.saving{color:#8c6a27!important}
.autosave-hint.saved{color:#2d7c4d!important}
.autosave-hint.error{color:#b94343!important}

.mock-actions-row form{margin:0}
.mock-actions-row form .btn{width:100%;height:100%}

.trash-list{display:flex;flex-direction:column;gap:10px}
.trash-row{
  display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:12px;
  background:#fff;border:1px solid var(--line);border-radius:10px;padding:13px
}
.trash-row>div:nth-child(2){display:flex;flex-direction:column;gap:4px}
.trash-row strong{font-size:12px}
.trash-row span{font-size:10px;color:var(--muted)}
.trash-actions{display:flex;gap:8px}
.trash-actions form{margin:0}

.management-create{
  display:flex;gap:8px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:12px
}
.management-create input{
  height:36px;border:1px solid var(--line);border-radius:8px;padding:0 10px;min-width:0
}
.management-create input[name="name"]{flex:1}
.icon-input{width:70px!important;flex:0 0 70px!important}
.management-list{display:flex;flex-direction:column;gap:8px}
.management-row{
  display:grid;grid-template-columns:42px minmax(0,1fr) auto auto;align-items:center;gap:10px;
  background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 12px
}
.management-icon{
  width:34px;height:34px;border-radius:8px;background:#eef4ff;display:grid;place-items:center;color:#466c9e
}
.management-edit{display:flex;gap:8px;min-width:0}
.management-edit input{
  height:34px;border:1px solid var(--line);border-radius:7px;padding:0 9px;min-width:0
}
.management-edit input[name="name"]{flex:1}
.management-count{font-size:10px;color:var(--muted);white-space:nowrap}

@media(max-width:1300px){
  .filter-grid{grid-template-columns:repeat(3,minmax(140px,1fr))}
}
@media(max-width:760px){
  .filter-grid{grid-template-columns:1fr 1fr}
  .management-row{grid-template-columns:38px 1fr}
  .management-count{grid-column:2}
  .management-row>form:last-child{grid-column:2}
  .trash-row{grid-template-columns:40px 1fr}
  .trash-actions{grid-column:2}
}
@media(max-width:520px){
  .filter-grid{grid-template-columns:1fr}
  .management-create{flex-wrap:wrap}
  .management-create input[name="name"]{flex-basis:100%}
  .management-edit{flex-wrap:wrap}
}

.preview-tab-panel{display:none}.preview-tab-panel.active{display:block}
.large-preview-shell{height:70vh;min-height:520px;border:1px solid #e1e7f0;border-radius:10px;overflow:hidden;background:#f7f9fc;margin-top:14px}
.large-preview-shell .preview-frame,.large-preview-shell .preview-image{width:100%;height:100%;border:0;object-fit:contain}
.notes-panel{padding:22px 0}.notes-panel label{display:flex;flex-direction:column;gap:10px;font-weight:600}.notes-panel textarea{width:100%;min-height:260px;resize:vertical;border:1px solid #d8e0ec;border-radius:9px;padding:14px;font:inherit;font-weight:400}
.history-list{padding:18px 2px}.history-item{display:flex;gap:12px;padding:0 0 20px 2px;position:relative}.history-dot{width:9px;height:9px;border-radius:50%;background:#2868e8;margin-top:6px;flex:0 0 auto}.history-item div:last-child{display:flex;flex-direction:column;gap:4px}.history-item span{font-size:12px;color:#7b879b}.tab-empty,.tab-loading{padding:28px 4px;color:#7b879b}
@media(max-width:980px){.large-preview-shell{height:65vh;min-height:420px}}


/* ========================================================
   v0.7.2 – Große Detailansicht im Stil der rechten Spalte
   ======================================================== */
.full-detail-page{
  min-height:100vh;
  background:#f7f9fc;
}
.full-detail-topbar{
  min-height:74px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:grid;
  grid-template-columns:130px minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
  padding:10px 24px;
  position:sticky;
  top:0;
  z-index:30;
}
.full-detail-back{
  justify-self:start;
  display:inline-flex;
  align-items:center;
}
.full-detail-title{
  min-width:0;
}
.full-detail-title h1{
  margin:2px 0 2px;
  font-size:18px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.full-detail-title>span:last-child{
  display:block;
  color:var(--muted);
  font-size:10px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.full-detail-user{
  display:flex;
  align-items:center;
  gap:9px;
  font-size:11px;
}
.full-detail-user .avatar{
  width:32px;
  height:32px;
}
.full-detail-flash{
  max-width:1500px;
  margin:14px auto 0;
  padding:0 20px;
}
.full-detail-shell{
  max-width:1500px;
  margin:0 auto;
  padding:18px 20px 32px;
}
.full-detail-card{
  background:#fff;
  border:1px solid #e3e8ef;
  border-radius:12px;
  padding:16px 18px 14px;
}
.full-detail-card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.full-detail-card-head h2{
  margin:0;
  font-size:18px;
}
.full-detail-card-head span{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:10px;
}
.full-detail-tabs{
  margin-top:12px;
}
.full-tab-panel{
  display:none;
}
.full-tab-panel.active{
  display:block;
}
.full-detail-grid{
  display:grid;
  grid-template-columns:minmax(360px,0.82fr) minmax(520px,1.5fr);
  gap:28px;
  padding-top:16px;
}
.full-detail-info{
  min-width:0;
}
.full-detail-info h3{
  margin:0 0 14px;
  font-size:12px;
}
.full-inline-edit{
  width:100%;
  height:38px;
  border:1px solid #e2e7ee;
  border-radius:7px;
  background:#fff;
  padding:0 10px;
  font-size:11px;
}
.full-detail-info .info-field{
  margin-bottom:14px;
}
.full-detail-info .info-field>span{
  font-size:10px;
}
.full-detail-info .info-field strong{
  font-size:11px;
}
.full-detail-preview{
  min-width:0;
}
.full-pdf-preview{
  height:68vh;
  min-height:620px;
  border:1px solid #e3e8ef;
  border-radius:8px;
  background:#f5f7fa;
  overflow:hidden;
}
.full-pdf-preview .preview-frame,
.full-pdf-preview .preview-image{
  width:100%;
  height:100%;
  border:0;
  object-fit:contain;
}
.full-large-preview{
  height:78vh;
  min-height:680px;
  margin-top:16px;
}
.full-notes-panel{
  padding:24px 0 8px;
}
.full-notes-panel textarea{
  min-height:420px;
}
.full-detail-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.full-detail-actions form{
  margin:0;
}
.full-detail-actions .btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.full-detail-footer{
  margin-top:14px;
}
@media(max-width:1100px){
  .full-detail-grid{
    grid-template-columns:1fr;
  }
  .full-pdf-preview{
    height:65vh;
    min-height:520px;
  }
}
@media(max-width:700px){
  .full-detail-topbar{
    grid-template-columns:auto 1fr;
    padding:10px 12px;
  }
  .full-detail-user{
    display:none;
  }
  .full-detail-shell{
    padding:12px;
  }
  .full-detail-card{
    padding:14px;
  }
  .full-detail-actions{
    grid-template-columns:1fr;
  }
  .full-pdf-preview,
  .full-large-preview{
    height:60vh;
    min-height:420px;
  }
}


/* v0.7.3 – einheitliches Menü auf allen authentifizierten Seiten */
.full-detail-page .full-detail-shell{
  max-width:none;
  margin:0;
  padding:18px 20px 32px;
}
.full-detail-page .full-detail-flash{
  max-width:none;
  margin:14px 20px 0;
  padding:0;
}
.full-detail-page .mock-main{
  min-width:0;
}
@media(max-width:980px){
  .full-detail-page .full-detail-shell{
    padding:12px;
  }
}


/* ========================================================
   v0.7.4 – Einheitliche SVG-Icons + Kategorie Icon-Galerie
   ======================================================== */
.menu-icon,
.management-svg-icon,
.picker-preview-icon,
.gallery-icon{
  display:block;
  width:18px;
  height:18px;
  flex:0 0 auto;
}
.nav-icon{
  display:grid;
  place-items:center;
}
.category-menu-icon{
  width:17px;
  height:17px;
}
.nav-item:hover .menu-icon,
.nav-item.active .menu-icon{
  stroke-width:2;
}
.app-icon-fallback{
  display:inline-grid;
  place-items:center;
  width:18px;
  height:18px;
  font-size:14px;
}

.management-section-title{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  margin-bottom:10px;
}
.management-section-title h2{
  margin:0;
  font-size:15px;
}
.management-section-title p{
  margin:3px 0 0;
  color:var(--muted);
  font-size:10px;
}
.existing-categories-title{
  margin-top:24px;
}

.category-create-form{
  display:grid;
  grid-template-columns:150px minmax(220px,1fr) auto;
  align-items:center;
}
.icon-picker-trigger{
  height:38px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:9px;
  padding:0 11px;
  color:#566174;
  font-size:10px;
  font-weight:650;
}
.icon-picker-trigger:hover{
  border-color:#bfd0eb;
  background:#f9fbff;
}
.picker-preview-icon{
  width:18px;
  height:18px;
  color:#2f6fe4;
}
.category-management-row{
  grid-template-columns:42px minmax(0,1fr) auto auto;
}
.category-edit-form{
  display:grid;
  grid-template-columns:88px minmax(160px,1fr) auto;
}
.compact-icon-picker{
  width:88px;
  padding:0 9px;
}
.management-icon .management-svg-icon{
  color:#316bd0;
  width:18px;
  height:18px;
}

.icon-gallery-card{
  width:min(720px,100%);
}
.icon-gallery{
  display:grid;
  grid-template-columns:repeat(5,minmax(90px,1fr));
  gap:9px;
  margin-top:18px;
  max-height:min(62vh,560px);
  overflow:auto;
  padding:2px;
}
.icon-gallery-item{
  min-height:82px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  color:#536074;
  font-size:9px;
  font-weight:650;
  transition:.14s ease;
}
.icon-gallery-item:hover{
  border-color:#afc6ed;
  background:#f6f9ff;
  color:#2763c8;
  transform:translateY(-1px);
}
.icon-gallery-item.selected{
  border-color:#2e6cf6;
  background:#edf4ff;
  color:#245fc9;
  box-shadow:0 0 0 1px #2e6cf6;
}
.gallery-icon{
  width:24px;
  height:24px;
}

@media(max-width:760px){
  .category-create-form{
    grid-template-columns:1fr;
  }
  .category-edit-form{
    grid-template-columns:88px minmax(0,1fr);
  }
  .category-edit-form .btn{
    grid-column:1/-1;
  }
  .icon-gallery{
    grid-template-columns:repeat(3,minmax(80px,1fr));
  }
}
@media(max-width:440px){
  .icon-gallery{
    grid-template-columns:repeat(2,minmax(80px,1fr));
  }
}


/* v0.7.5 – große gruppierte Icon-Galerie */
.icon-gallery-card{
  width:min(860px,100%);
}
.icon-gallery-search{
  height:42px;
  border:1px solid var(--line);
  border-radius:9px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 11px;
  margin-top:16px;
  background:#fff;
}
.icon-gallery-search span{
  color:#8490a1;
}
.icon-gallery-search input{
  border:0;
  outline:0;
  width:100%;
  background:transparent;
  font-size:11px;
}
.icon-gallery-groups{
  margin-top:14px;
  max-height:min(66vh,620px);
  overflow:auto;
  padding-right:4px;
}
.icon-gallery-group{
  margin-bottom:18px;
}
.icon-gallery-group h3{
  margin:0 0 8px;
  font-size:11px;
  color:#667286;
  text-transform:uppercase;
  letter-spacing:.055em;
}
.icon-gallery-group .icon-gallery{
  margin-top:0;
  max-height:none;
  overflow:visible;
  grid-template-columns:repeat(6,minmax(86px,1fr));
}
.icon-gallery-item[hidden],
.icon-gallery-group[hidden]{
  display:none!important;
}
@media(max-width:760px){
  .icon-gallery-group .icon-gallery{
    grid-template-columns:repeat(4,minmax(76px,1fr));
  }
}
@media(max-width:520px){
  .icon-gallery-group .icon-gallery{
    grid-template-columns:repeat(3,minmax(72px,1fr));
  }
}


/* ========================================================
   v0.8 – Benutzerprofil und Profilbild
   ======================================================== */
.global-user-link{
  text-decoration:none;
  color:inherit;
  border-radius:10px;
  padding:5px 7px;
  transition:.14s ease;
}
.global-user-link:hover{
  background:#f3f6fa;
}
.avatar-image{
  object-fit:cover;
  display:block;
  border:1px solid #e2e7ee;
}
.profile-page-content{
  max-width:980px;
}
.profile-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:22px;
}
.profile-avatar-section{
  display:grid;
  grid-template-columns:110px minmax(0,1fr);
  gap:22px;
  align-items:center;
}
.profile-avatar-large{
  width:96px;
  height:96px;
  border-radius:50%;
  background:linear-gradient(145deg,#2f74ff,#2456d6);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:34px;
  font-weight:800;
  overflow:hidden;
  border:3px solid #fff;
  box-shadow:0 0 0 1px #e1e6ee,0 8px 22px rgba(40,60,90,.12);
}
.profile-avatar-large img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.profile-avatar-text h2,
.profile-section-head h2{
  margin:0;
  font-size:15px;
}
.profile-avatar-text p,
.profile-section-head p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:10px;
}
.profile-avatar-actions{
  display:flex;
  align-items:center;
  gap:14px;
  margin-top:12px;
  flex-wrap:wrap;
}
.profile-upload-button{
  position:relative;
  overflow:hidden;
}
.profile-upload-button input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.profile-remove-avatar{
  display:flex;
  grid-template-columns:none;
  flex-direction:row;
  align-items:center;
  gap:7px;
  font-size:10px;
  font-weight:550;
  color:#667286;
}
.profile-remove-avatar input{
  width:auto;
  height:auto;
}
.profile-divider{
  height:1px;
  background:var(--line);
  margin:22px 0;
}
.profile-form-section{
  display:grid;
  grid-template-columns:210px minmax(0,1fr);
  gap:24px;
}
.profile-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.profile-form-grid label{
  font-size:10px;
}
.profile-form-grid input{
  height:40px;
  border:1px solid var(--line);
  border-radius:8px;
  padding:0 10px;
  background:#fff;
  font-size:11px;
}
.profile-grid-wide{
  grid-column:1/-1;
}
.profile-form-actions{
  display:flex;
  justify-content:flex-end;
  gap:9px;
  margin-top:24px;
  padding-top:16px;
  border-top:1px solid var(--line);
}
@media(max-width:720px){
  .profile-avatar-section{
    grid-template-columns:1fr;
  }
  .profile-form-section{
    grid-template-columns:1fr;
  }
  .profile-form-grid{
    grid-template-columns:1fr;
  }
  .profile-grid-wide{
    grid-column:auto;
  }
}


/* ========================================================
   v0.8.1 – globale Suche
   ======================================================== */
.global-search{
  position:relative;
}
.search-suggestions{
  display:none;
  position:absolute;
  top:calc(100% + 7px);
  left:0;
  right:0;
  z-index:120;
  background:#fff;
  border:1px solid #dfe5ee;
  border-radius:11px;
  box-shadow:0 18px 45px rgba(28,42,68,.16);
  overflow:hidden;
}
.search-suggestions.show{
  display:block;
}
.search-suggestion-item{
  display:grid;
  grid-template-columns:30px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  padding:10px 11px;
  color:inherit;
  text-decoration:none;
  border-bottom:1px solid #f0f2f6;
}
.search-suggestion-item:hover,
.search-suggestion-item.active{
  background:#f3f7ff;
}
.search-suggestion-icon{
  width:28px;
  height:28px;
  border-radius:7px;
  background:#eef4ff;
  display:grid;
  place-items:center;
  color:#2f6bd0;
}
.search-suggestion-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.search-suggestion-main strong{
  font-size:11px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.search-suggestion-main span{
  color:var(--muted);
  font-size:9px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.search-suggestion-status{
  font-size:8px;
  border-radius:999px;
  padding:3px 7px;
  background:#f1f3f6;
  color:#6e7785;
}
.search-all-results{
  width:100%;
  border:0;
  background:#fafbfd;
  color:#2f65bf;
  padding:10px;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
}
.search-all-results:hover{
  background:#f0f5ff;
}
.search-suggestion-empty{
  padding:14px;
  color:#606c7d;
  font-size:10px;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.search-suggestion-empty small{
  color:#98a1af;
  font-size:9px;
}
.search-page-content{
  max-width:1180px;
}
.search-result-list{
  display:flex;
  flex-direction:column;
  gap:9px;
}
.search-result-row{
  display:grid;
  grid-template-columns:44px minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  min-height:78px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px;
  color:inherit;
  text-decoration:none;
  transition:.14s ease;
}
.search-result-row:hover{
  border-color:#c9d8ee;
  box-shadow:0 3px 14px rgba(32,50,79,.05);
}
.search-result-main{
  min-width:0;
}
.search-result-title{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.search-result-title strong{
  font-size:12px;
}
.search-status-chip{
  font-size:8px;
  border-radius:999px;
  padding:3px 7px;
  font-weight:700;
}
.search-status-chip.archived{
  background:#f1f3f6;
  color:#6d7684;
}
.search-status-chip.inbox{
  background:#edf4ff;
  color:#3167c4;
}
.search-result-meta{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:5px;
  color:#7a8594;
  font-size:9px;
}
.search-result-meta span:not(:last-child)::after{
  content:" ·";
}
.search-result-tags{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  margin-top:7px;
}
.search-result-side{
  display:flex;
  align-items:center;
  gap:12px;
  color:#8a94a3;
  font-size:9px;
}
.search-result-side strong{
  font-size:20px;
  font-weight:400;
}
.search-empty-card{
  min-height:300px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:28px;
}
.search-empty-icon{
  font-size:36px;
  color:#7f8b9d;
}
.search-empty-card h2{
  margin:10px 0 5px;
  font-size:16px;
}
.search-empty-card p{
  max-width:520px;
  margin:0;
  color:var(--muted);
  font-size:10px;
}
@media(max-width:650px){
  .search-result-row{
    grid-template-columns:40px minmax(0,1fr);
  }
  .search-result-side{
    display:none;
  }
}


/* ========================================================
   v0.9 – OCR
   ======================================================== */
.ocr-control-row{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.ocr-status-badge{
  display:inline-flex;
  align-items:center;
  min-height:21px;
  border-radius:999px;
  padding:3px 8px;
  font-size:8px!important;
  font-weight:750!important;
  white-space:nowrap;
}
.ocr-status-badge.status-done{
  background:#e8f8ed;
  color:#287a48;
}
.ocr-status-badge.status-pending{
  background:#eef4ff;
  color:#3a67ac;
}
.ocr-status-badge.status-processing{
  background:#fff5df;
  color:#8a651d;
}
.ocr-status-badge.status-failed{
  background:#fdecec;
  color:#ad3f3f;
}
.ocr-status-badge.status-skipped{
  background:#f0f2f5;
  color:#697382;
}
.ocr-run-form{
  margin:0;
}
.ocr-retry-button{
  border:0;
  background:transparent;
  color:#3669bb;
  padding:2px 0;
  font-size:8px;
  font-weight:700;
  cursor:pointer;
}
.ocr-retry-button:hover{
  text-decoration:underline;
}
.ocr-meta{
  display:block;
  margin-top:5px;
  color:#8791a0;
  font-size:8px;
  line-height:1.35;
  overflow-wrap:anywhere;
}

/* ========================================================
   v0.9.1 – Einstellungen / OCR Diagnose
   ======================================================== */
.settings-page-content,.settings-ocr-content{padding-top:8px}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-width:900px}
.settings-tile{display:flex;align-items:center;gap:14px;padding:18px;background:#fff;border:1px solid #e7ebf1;border-radius:14px;text-decoration:none;color:#273244;box-shadow:0 2px 8px rgba(30,50,80,.03)}
.settings-tile:hover{border-color:#cbd8ec;transform:translateY(-1px)}
.settings-tile-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:#eef4ff;color:#3d6fb6}
.settings-tile-icon svg{width:21px;height:21px}
.settings-tile span:last-child{display:flex;flex-direction:column;gap:4px}
.settings-tile strong{font-size:13px}
.settings-tile small{font-size:10px;color:#7d8795;line-height:1.4}
.settings-back{display:inline-block;margin-bottom:5px;font-size:9px;color:#5f79a4;text-decoration:none}
.settings-ocr-heading{align-items:center}
.ocr-health-pill{display:inline-flex;align-items:center;gap:7px;padding:7px 11px;border-radius:999px;font-size:9px;font-weight:750}
.ocr-health-pill span{width:7px;height:7px;border-radius:50%}
.ocr-health-pill.healthy{background:#eaf8ef;color:#267347}.ocr-health-pill.healthy span{background:#35a864}
.ocr-health-pill.warning{background:#fff3e5;color:#9a631d}.ocr-health-pill.warning span{background:#e39a37}
.ocr-stat-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:14px}
.ocr-stat-card{background:#fff;border:1px solid #e7ebf1;border-radius:12px;padding:14px}
.ocr-stat-card span{display:block;font-size:9px;color:#7d8795;margin-bottom:7px}
.ocr-stat-card strong{display:block;font-size:24px;line-height:1;color:#273244;margin-bottom:6px}
.ocr-stat-card small{font-size:8px;color:#98a1ad}.ocr-stat-card.has-error{border-color:#efcaca;background:#fffafa}
.ocr-diagnostic-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:14px;margin-bottom:14px}
.ocr-panel{background:#fff;border:1px solid #e7ebf1;border-radius:14px;padding:16px;margin-bottom:14px}
.ocr-panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:13px}
.ocr-panel-head h2{margin:0 0 3px;font-size:13px;color:#293547}.ocr-panel-head p{margin:0;font-size:9px;color:#8993a0}
.ocr-check-list{display:flex;flex-direction:column}
.ocr-check-row{display:grid;grid-template-columns:10px 1fr auto;gap:9px;align-items:center;padding:9px 0;border-bottom:1px solid #f0f2f5}
.ocr-check-row:last-child{border-bottom:0}.ocr-check-dot{width:8px;height:8px;border-radius:50%}.ocr-check-dot.ok{background:#39aa67}.ocr-check-dot.bad{background:#d85c5c}
.ocr-check-row div{display:flex;flex-direction:column;gap:2px}.ocr-check-row strong{font-size:10px}.ocr-check-row small{font-size:8px;color:#8b95a2;max-width:430px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ocr-check-row b{font-size:8px;color:#697483}
.ocr-worker-data{margin:0}.ocr-worker-data div{display:flex;justify-content:space-between;gap:15px;padding:7px 0;border-bottom:1px solid #f0f2f5}.ocr-worker-data dt,.ocr-worker-data dd{font-size:9px}.ocr-worker-data dt{color:#7e8997}.ocr-worker-data dd{margin:0;font-weight:700;text-align:right;color:#3d4959}
.ocr-last-success{margin-top:13px;padding:11px;border-radius:10px;background:#f7f9fc;display:flex;flex-direction:column;gap:3px}.ocr-last-success span,.ocr-last-success small{font-size:8px;color:#8792a0}.ocr-last-success a{font-size:10px;font-weight:700;color:#3b68aa;text-decoration:none}
.ocr-action-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.ocr-action-row form{margin:0}.ocr-action-row .btn[disabled]{opacity:.45;cursor:not-allowed}.ocr-action-hint{font-size:8px;color:#929ba7;margin-left:auto}
.ocr-table-wrap{overflow:auto}.ocr-table{width:100%;border-collapse:collapse;min-width:650px}.ocr-table th{text-align:left;font-size:8px;color:#8a94a1;font-weight:700;padding:8px;border-bottom:1px solid #e9edf2}.ocr-table td{font-size:9px;padding:9px 8px;border-bottom:1px solid #f0f2f5;vertical-align:top}.ocr-table td a{font-weight:700;color:#354b6c;text-decoration:none}.ocr-row-error{display:block;color:#b24d4d;font-size:7px;margin-top:3px;max-width:360px}.ocr-empty{text-align:center;color:#8e98a5;padding:22px!important}
.ocr-journal{margin:0;padding:12px;background:#1f2630;color:#d9e1eb;border-radius:9px;white-space:pre-wrap;overflow:auto;max-height:260px;font-size:8px;line-height:1.55}
@media(max-width:900px){.ocr-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ocr-diagnostic-grid{grid-template-columns:1fr}.settings-grid{grid-template-columns:1fr}}
@media(max-width:600px){.settings-ocr-heading{align-items:flex-start;gap:10px}.ocr-health-pill{align-self:flex-start}.ocr-stat-grid{grid-template-columns:1fr 1fr}.ocr-stat-card strong{font-size:20px}.ocr-panel{padding:13px}.ocr-action-hint{width:100%;margin-left:0}}


/* ========================================================
   v0.9.2 – Benutzerverwaltung
   ======================================================== */
.settings-users-heading{
  align-items:flex-end;
}
.user-summary{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.user-summary span{
  border:1px solid #e2e7ee;
  background:#fff;
  border-radius:9px;
  padding:7px 10px;
  font-size:8px;
  color:#808a98;
}
.user-summary strong{
  color:#344152;
  font-size:11px;
  margin-right:3px;
}
.user-admin-content{
  max-width:1180px;
}
.user-admin-panel{
  background:#fff;
  border:1px solid #e6ebf1;
  border-radius:14px;
  padding:17px;
  margin-bottom:14px;
}
.user-admin-panel-head h2{
  margin:0;
  font-size:14px;
}
.user-admin-panel-head p{
  margin:4px 0 14px;
  color:#8993a0;
  font-size:9px;
}
.user-create-form{
  display:grid;
  grid-template-columns:repeat(4,minmax(135px,1fr));
  gap:10px;
  align-items:end;
}
.user-create-form label,
.user-edit-form label,
.user-password-reset-form label{
  display:flex;
  flex-direction:column;
  gap:5px;
  font-size:9px;
  font-weight:650;
  color:#657083;
}
.user-create-form input,
.user-create-form select,
.user-edit-form input,
.user-edit-form select,
.user-password-reset-form input{
  height:37px;
  border:1px solid #dfe5ec;
  border-radius:8px;
  background:#fff;
  padding:0 9px;
  font-size:10px;
  color:#364252;
}
.user-password-field{
  grid-column:span 2;
}
.user-create-action{
  display:flex;
  align-items:flex-end;
}
.user-admin-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.user-admin-row{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  align-items:center;
  gap:11px;
  padding:11px 12px;
  border:1px solid #e8ecf1;
  border-radius:11px;
  background:#fff;
}
.user-admin-row.is-disabled{
  background:#fafafa;
  opacity:.72;
}
.user-admin-avatar{
  width:38px;
  height:38px;
  border-radius:50%;
  overflow:hidden;
  background:#edf3ff;
  display:grid;
  place-items:center;
  color:#3168c2;
  font-size:13px;
  font-weight:800;
}
.user-admin-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.user-admin-main{
  min-width:0;
}
.user-admin-title{
  display:flex;
  align-items:center;
  gap:5px;
  flex-wrap:wrap;
}
.user-admin-title strong{
  font-size:11px;
}
.user-chip{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:3px 7px;
  font-size:7px;
  font-weight:750;
}
.user-chip.admin{background:#efeafe;color:#6551a5}
.user-chip.user{background:#eef4ff;color:#456ba6}
.user-chip.active{background:#e9f8ee;color:#2c7a4b}
.user-chip.disabled{background:#f0f1f3;color:#7d8490}
.user-chip.me{background:#fff2d9;color:#916618}
.user-admin-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:4px;
  color:#8993a0;
  font-size:8px;
}
.user-admin-details{
  position:relative;
}
.user-admin-details summary{
  list-style:none;
  border:1px solid #dfe5ec;
  border-radius:8px;
  padding:7px 10px;
  font-size:9px;
  font-weight:700;
  color:#5d6a7c;
  cursor:pointer;
}
.user-admin-details summary::-webkit-details-marker{display:none}
.user-admin-details[open]{
  grid-column:1/-1;
}
.user-edit-card{
  margin-top:10px;
  padding:13px;
  background:#f8fafc;
  border:1px solid #e8edf3;
  border-radius:10px;
}
.user-edit-form{
  display:grid;
  grid-template-columns:repeat(4,minmax(140px,1fr));
  gap:9px;
  align-items:end;
}
.user-edit-actions{
  grid-column:1/-1;
}
.user-secondary-actions{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #e4e9ef;
}
.user-secondary-actions form{
  margin:0;
}
.user-password-reset-form{
  display:flex;
  align-items:flex-end;
  gap:8px;
  flex:1;
}
.user-password-reset-form label{
  max-width:300px;
  flex:1;
}
@media(max-width:950px){
  .user-create-form,
  .user-edit-form{
    grid-template-columns:repeat(2,minmax(140px,1fr));
  }
  .user-password-field{
    grid-column:auto;
  }
}
@media(max-width:650px){
  .settings-users-heading{
    align-items:flex-start;
  }
  .user-create-form,
  .user-edit-form{
    grid-template-columns:1fr;
  }
  .user-admin-row{
    grid-template-columns:38px minmax(0,1fr);
  }
  .user-admin-details{
    grid-column:1/-1;
  }
  .user-secondary-actions,
  .user-password-reset-form{
    align-items:stretch;
    flex-direction:column;
  }
}


/* ========================================================
   v0.9.3 – Mobile Navigation scrollbar / touch scrolling
   ======================================================== */
@media (max-width: 900px) {
  .sidebar,
  .mock-sidebar {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  /* The menu itself must be allowed to grow beyond the viewport. */
  .sidebar-nav,
  .mock-sidebar nav,
  .nav-section {
    flex-shrink: 0;
  }

  /* Keep a little room below the final item on phones with browser bars. */
  .sidebar::after,
  .mock-sidebar::after {
    content: "";
    display: block;
    height: max(20px, env(safe-area-inset-bottom));
    flex: 0 0 auto;
  }
}


/* ========================================================
   v0.9.4 – Mobiler Mehrseiten-Dokumentenscanner
   ======================================================== */
.upload-modal-card{
  width:min(100%,650px);
}
.upload-mode-tabs{
  display:flex;
  gap:4px;
  border-bottom:1px solid #e6eaf0;
  margin:2px 0 14px;
}
.upload-mode-tab{
  border:0;
  background:transparent;
  color:#7a8492;
  padding:9px 11px;
  border-bottom:2px solid transparent;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
}
.upload-mode-tab.active{
  color:#3269c5;
  border-bottom-color:#3269c5;
}
.upload-mode-panel{
  display:none;
}
.upload-mode-panel.active{
  display:block;
}
.mobile-scan-tab{
  display:none;
}
.scan-intro{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border-radius:10px;
  background:#f4f8ff;
  border:1px solid #dfe9f8;
}
.scan-camera-icon{
  width:38px;
  height:38px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:#e3edff;
  color:#3167c1;
  font-size:18px;
}
.scan-intro>div{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.scan-intro strong{
  font-size:11px;
}
.scan-intro span:last-child{
  font-size:9px;
  line-height:1.4;
  color:#7b8695;
}
.scan-buttons{
  display:flex;
  gap:8px;
  margin:12px 0;
}
.scan-capture-button,
.scan-library-button{
  position:relative;
  overflow:hidden;
  flex:1;
  justify-content:center;
}
.scan-capture-button input,
.scan-library-button input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.scan-pages-empty{
  display:grid;
  place-items:center;
  min-height:75px;
  border:1px dashed #d9e0e9;
  border-radius:9px;
  color:#919ba8;
  font-size:9px;
  margin-bottom:10px;
}
.scan-pages{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}
.scan-page-card{
  position:relative;
  border:1px solid #dfe5ec;
  border-radius:9px;
  overflow:hidden;
  background:#f5f7fa;
}
.scan-page-card img{
  display:block;
  width:100%;
  aspect-ratio:3/4;
  object-fit:cover;
  background:#e8ebef;
}
.scan-page-number{
  position:absolute;
  top:5px;
  left:5px;
  z-index:2;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(21,30,43,.78);
  color:#fff;
  font-size:8px;
  font-weight:800;
}
.scan-page-actions{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  border-top:1px solid #e2e6ec;
}
.scan-page-actions button{
  height:27px;
  border:0;
  border-right:1px solid #e5e9ee;
  background:#fff;
  color:#687486;
  font-size:11px;
}
.scan-page-actions button:last-child{
  border-right:0;
}
.scan-page-actions button:disabled{
  opacity:.3;
}
.scan-page-actions button.danger{
  color:#b94b4b;
}
.scan-form-fields{
  display:grid;
  grid-template-columns:1fr 160px;
  gap:9px;
}
.scan-form-fields label{
  font-size:9px;
}
.scan-form-fields input{
  height:38px;
  border:1px solid #dfe5ec;
  border-radius:8px;
  padding:0 9px;
  font-size:10px;
}
.scan-upload-state{
  min-height:18px;
  margin-top:8px;
  font-size:9px;
  color:#6d7990;
}
@media(max-width:900px){
  .mobile-scan-tab{
    display:block;
  }
}
@media(max-width:600px){
  .upload-modal-card{
    width:calc(100vw - 20px);
    max-height:calc(100dvh - 20px);
    overflow:auto;
  }
  .scan-pages{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .scan-form-fields{
    grid-template-columns:1fr;
  }
  .scan-buttons{
    flex-direction:column;
  }
}
@media(max-width:380px){
  .scan-pages{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}


/* ========================================================
   v0.9.5 – automatische Dokumentkantenerkennung
   ======================================================== */
.scan-detect-state{
  position:absolute;
  top:5px;
  right:5px;
  z-index:2;
  border-radius:999px;
  padding:4px 6px;
  font-size:6px;
  font-weight:800;
  backdrop-filter:blur(4px);
}
.scan-detect-state.detected{
  color:#176d40;
  background:rgba(224,248,234,.94);
}
.scan-detect-state.fallback{
  color:#735e29;
  background:rgba(255,246,217,.94);
}

.scan-detect-state.fallback-crop{
  color:#6b5b1d;
  background:rgba(255,241,182,.95);
}


/* v0.9.7 – konservativer Zuschnitt */
.scan-page-actions.has-original-action{
  grid-template-columns:32px 32px 1fr 32px;
}
.scan-page-actions .use-original{
  font-size:7px;
  font-weight:700;
  color:#426ba5;
}
.scan-page-actions .use-original:hover{
  background:#eef4ff;
}


/* ========================================================
   v0.9.8 – Seitenerkennung entfernt
   ======================================================== */
.scan-detect-state.detected,
.scan-detect-state.fallback,
.scan-detect-state.fallback-crop{
  display:none !important;
}
.scan-detect-state.ready{
  position:absolute;
  top:5px;
  right:5px;
  z-index:2;
  border-radius:999px;
  padding:4px 6px;
  font-size:6px;
  font-weight:800;
  color:#3e628f;
  background:rgba(235,243,255,.95);
}
.scan-page-actions.has-original-action{
  grid-template-columns:1fr 1fr 1fr;
}
.scan-page-actions .use-original{
  display:none !important;
}


/* ========================================================
   v0.10 – OCR-Text + automatische Metadaten-Vorschläge
   ======================================================== */
.metadata-suggestions{
  margin:0 0 16px;
  border:1px solid #dfe8f5;
  border-radius:10px;
  background:#f8fbff;
  overflow:hidden;
}
.metadata-suggestions-head{
  padding:10px 11px 8px;
  border-bottom:1px solid #e5edf8;
}
.metadata-suggestions-head>div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.metadata-suggestions-head strong{
  font-size:10px;
  color:#315f9d;
}
.metadata-suggestions-head span{
  font-size:8px;
  color:#8491a3;
}
.metadata-suggestion-list{
  display:flex;
  flex-direction:column;
}
.metadata-suggestion-item{
  display:flex;
  align-items:center;
  gap:9px;
  justify-content:space-between;
  padding:9px 11px;
  border-bottom:1px solid #e8eef7;
}
.metadata-suggestion-item:last-child{
  border-bottom:0;
}
.metadata-suggestion-main{
  min-width:0;
  display:grid;
  grid-template-columns:95px minmax(0,1fr);
  column-gap:8px;
  row-gap:2px;
  align-items:center;
}
.metadata-suggestion-main>span{
  font-size:8px;
  color:#7b8797;
}
.metadata-suggestion-main>strong{
  font-size:10px;
  color:#354254;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.metadata-suggestion-main>small{
  grid-column:2;
  font-size:7px;
  color:#929caa;
  line-height:1.3;
}
.metadata-suggestion-apply{
  flex:0 0 auto;
  border:1px solid #cbd9ec;
  border-radius:7px;
  background:#fff;
  color:#3567ac;
  padding:5px 8px;
  font-size:8px;
  font-weight:750;
  cursor:pointer;
}
.metadata-suggestion-apply:hover{
  background:#edf4ff;
  border-color:#b5cae6;
}
.metadata-suggestion-apply:disabled{
  opacity:.55;
}
.metadata-suggestions-loading,
.metadata-suggestions-empty{
  padding:10px 11px;
  color:#8490a0;
  font-size:8px;
}
.ocr-text-panel{
  padding:14px 0 0;
}
.ocr-text-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:9px;
}
.ocr-text-toolbar>div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.ocr-text-toolbar strong{
  font-size:11px;
}
.ocr-text-toolbar span{
  color:#8994a2;
  font-size:8px;
}
.ocr-text-content{
  margin:0;
  min-height:390px;
  max-height:65vh;
  overflow:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  border:1px solid #e2e7ed;
  border-radius:9px;
  padding:13px;
  background:#fafbfc;
  color:#374354;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:9px;
  line-height:1.55;
  user-select:text;
}
.full-ocr-text-panel .ocr-text-content{
  min-height:58vh;
}
@media(max-width:650px){
  .metadata-suggestion-item{
    align-items:flex-start;
  }
  .metadata-suggestion-main{
    grid-template-columns:1fr;
  }
  .metadata-suggestion-main>small{
    grid-column:auto;
  }
  .ocr-text-toolbar{
    align-items:flex-start;
  }
}


/* ========================================================
   v0.10.1 – Vorschlagsfeedback / kontrolliertes Lernen
   ======================================================== */
.metadata-suggestion-actions{
  display:flex;
  align-items:center;
  gap:5px;
  flex:0 0 auto;
}
.metadata-suggestion-change,
.metadata-suggestion-ignore{
  border:0;
  background:transparent;
  padding:5px 4px;
  font-size:7px;
  font-weight:700;
  cursor:pointer;
}
.metadata-suggestion-change{color:#657b9b}
.metadata-suggestion-ignore{color:#9199a5}
.metadata-suggestion-change:hover{color:#315f9d}
.metadata-suggestion-ignore:hover{color:#5f6874}
.metadata-suggestion-editor{
  grid-column:1/-1;
  width:100%;
  margin-top:8px;
  padding:9px;
  background:#fff;
  border:1px solid #dfe7f1;
  border-radius:8px;
  display:grid;
  grid-template-columns:minmax(150px,1fr) auto;
  gap:8px;
  align-items:center;
}
.metadata-suggestion-editor-control{
  width:100%;
  height:34px;
  border:1px solid #d9e1eb;
  border-radius:7px;
  background:#fff;
  padding:0 8px;
  font-size:9px;
}
.metadata-suggestion-remember{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  gap:6px;
  font-size:8px;
  color:#647187;
}
.metadata-suggestion-remember input{
  width:auto;
  height:auto;
}
.metadata-suggestion-editor-actions{
  grid-column:1/-1;
  display:flex;
  justify-content:flex-end;
  gap:6px;
}
.metadata-suggestion-cancel,
.metadata-suggestion-save{
  border-radius:7px;
  padding:6px 8px;
  font-size:8px;
  font-weight:700;
  cursor:pointer;
}
.metadata-suggestion-cancel{
  border:1px solid #dce2e9;
  background:#fff;
  color:#6e7988;
}
.metadata-suggestion-save{
  border:1px solid #bed0e9;
  background:#edf4ff;
  color:#3264a7;
}
.metadata-suggestion-save:disabled{
  opacity:.55;
}
.metadata-suggestion-item:has(.metadata-suggestion-editor){
  flex-wrap:wrap;
}
@media(max-width:700px){
  .metadata-suggestion-item{
    flex-wrap:wrap;
  }
  .metadata-suggestion-actions{
    width:100%;
    justify-content:flex-end;
  }
  .metadata-suggestion-editor{
    grid-template-columns:1fr;
  }
}


/* ========================================================
   v0.10.2 – OCR-Vorschläge sauberer formatiert
   ======================================================== */
.metadata-suggestions{
  margin:0 0 18px;
  border:1px solid #d8e3f2;
  border-radius:11px;
  background:#fbfdff;
  overflow:hidden;
}

.metadata-suggestions-head{
  padding:11px 12px 10px;
  background:#f5f9ff;
  border-bottom:1px solid #e2eaf5;
}

.metadata-suggestions-head strong{
  font-size:11px;
  color:#294f83;
}

.metadata-suggestions-head span{
  margin-top:2px;
  font-size:8px;
  color:#7f8da0;
}

.metadata-suggestion-item{
  display:grid;
  grid-template-columns:105px minmax(0,1fr) auto;
  grid-template-areas:
    "label value actions"
    "label meta  actions";
  column-gap:12px;
  row-gap:3px;
  align-items:center;
  padding:11px 12px;
  border-bottom:1px solid #e8eef6;
  background:#fff;
}

.metadata-suggestion-item:last-child{
  border-bottom:0;
}

.metadata-suggestion-main{
  display:contents;
}

.metadata-suggestion-main>span{
  grid-area:label;
  align-self:start;
  padding-top:2px;
  font-size:8px;
  font-weight:650;
  color:#7a8798;
}

.metadata-suggestion-main>strong{
  grid-area:value;
  font-size:10px;
  font-weight:750;
  color:#2f3d50;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  line-height:1.35;
}

.metadata-suggestion-main>small{
  grid-area:meta;
  font-size:7px;
  color:#8d98a7;
  line-height:1.35;
}

.metadata-suggestion-actions{
  grid-area:actions;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  white-space:nowrap;
}

.metadata-suggestion-apply,
.metadata-suggestion-change,
.metadata-suggestion-ignore{
  min-height:27px;
  border-radius:7px;
  padding:0 8px;
  font-size:7px;
  font-weight:750;
  cursor:pointer;
}

.metadata-suggestion-apply{
  border:1px solid #b9cdea;
  background:#eef5ff;
  color:#2e63aa;
}

.metadata-suggestion-apply:hover{
  background:#e5effe;
}

.metadata-suggestion-change{
  border:1px solid #d8e0e9;
  background:#fff;
  color:#61728b;
}

.metadata-suggestion-ignore{
  border:1px solid transparent;
  background:transparent;
  color:#939ca8;
}

.metadata-suggestion-change:hover{
  background:#f5f7fa;
}

.metadata-suggestion-ignore:hover{
  background:#f7f7f8;
  color:#69727e;
}

.metadata-suggestion-editor{
  grid-column:1/-1;
  grid-area:auto;
  margin-top:7px;
}

@media(max-width:760px){
  .metadata-suggestion-item{
    grid-template-columns:95px minmax(0,1fr);
    grid-template-areas:
      "label value"
      "label meta"
      "actions actions";
    align-items:start;
  }

  .metadata-suggestion-actions{
    margin-top:6px;
    justify-content:flex-start;
  }

  .metadata-suggestion-apply,
  .metadata-suggestion-change,
  .metadata-suggestion-ignore{
    flex:1;
    min-height:31px;
  }
}

@media(max-width:420px){
  .metadata-suggestion-item{
    grid-template-columns:1fr;
    grid-template-areas:
      "label"
      "value"
      "meta"
      "actions";
    row-gap:4px;
  }

  .metadata-suggestion-main>span{
    padding-top:0;
  }

  .metadata-suggestion-actions{
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    width:100%;
  }
}


/* ========================================================
   v0.10.3 – OCR Vorschläge als kompakte Karten
   ======================================================== */
.metadata-suggestions{
  margin:0 0 16px;
}

.metadata-suggestion-list{
  display:flex;
  flex-direction:column;
}

.metadata-suggestion-item{
  display:flex !important;
  flex-direction:column;
  align-items:stretch;
  gap:7px;
  padding:11px 12px;
  background:#fff;
  border-bottom:1px solid #e7edf5;
}

.metadata-suggestion-item:last-child{
  border-bottom:0;
}

.metadata-suggestion-main{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:
    "label confidence"
    "value value"
    "reason reason";
  gap:3px 8px;
  width:100%;
}

.metadata-suggestion-main>span{
  grid-area:label !important;
  padding:0 !important;
  font-size:8px;
  font-weight:700;
  color:#748196;
  text-transform:none;
}

.metadata-suggestion-main>strong{
  grid-area:value !important;
  display:block;
  font-size:11px;
  line-height:1.35;
  font-weight:750;
  color:#26364a;
  white-space:normal;
  overflow:visible;
}

.metadata-suggestion-main>small{
  grid-area:reason !important;
  display:block;
  font-size:7.5px;
  line-height:1.4;
  color:#8b96a5;
}

.metadata-suggestion-actions{
  display:grid !important;
  grid-template-columns:1fr 1fr 1fr;
  gap:6px;
  width:100%;
  margin-top:1px;
}

.metadata-suggestion-apply,
.metadata-suggestion-change,
.metadata-suggestion-ignore{
  width:100%;
  min-width:0;
  height:30px;
  padding:0 5px;
  border-radius:7px;
  font-size:7px;
  font-weight:750;
  line-height:1;
  text-align:center;
  white-space:nowrap;
}

.metadata-suggestion-ignore{
  border:1px solid #e0e5ec;
  background:#fff;
}

.metadata-suggestion-editor{
  display:flex !important;
  flex-direction:column;
  gap:8px;
  width:100%;
  margin-top:2px;
  padding:10px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:8px;
}

.metadata-suggestion-editor-control{
  width:100%;
  min-width:0;
}

.metadata-suggestion-remember{
  width:100%;
  margin:0;
}

.metadata-suggestion-editor-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  width:100%;
}

.metadata-suggestion-cancel,
.metadata-suggestion-save{
  width:100%;
  min-height:30px;
}

/* In the wider full document view, keep the same simple card layout. */
.full-detail-info .metadata-suggestion-item{
  padding:12px 13px;
}

@media(max-width:420px){
  .metadata-suggestion-actions{
    grid-template-columns:1fr;
  }

  .metadata-suggestion-apply,
  .metadata-suggestion-change,
  .metadata-suggestion-ignore{
    height:32px;
  }
}


/* ========================================================
   v0.11 – Mailserver, Passwort-Reset und Freigaben
   ======================================================== */
.settings-form-page{max-width:900px}
.settings-form-card,.settings-test-card,.settings-info-card{
  background:#fff;border:1px solid #e4e9f0;border-radius:14px;padding:17px;margin-bottom:14px
}
.settings-section-title h2{margin:0;font-size:13px}
.settings-section-title p{margin:4px 0 14px;color:#8792a0;font-size:9px}
.settings-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.settings-form-grid label,.settings-single-field{
  display:flex;flex-direction:column;gap:5px;font-size:9px;font-weight:650;color:#657084
}
.settings-form-grid input,.settings-form-grid select,.settings-single-field input,.settings-test-card input{
  height:38px;border:1px solid #dce3eb;border-radius:8px;padding:0 9px;background:#fff;font-size:10px
}
.settings-grid-wide{grid-column:1/-1}
.settings-divider{height:1px;background:#e8ecf1;margin:18px 0}
.settings-form-actions{display:flex;justify-content:flex-end;margin-top:15px}
.settings-single-field small{font-size:8px;color:#909aa8;font-weight:400}
.settings-test-card{display:grid;grid-template-columns:minmax(160px,1fr) minmax(180px,280px) auto;gap:10px;align-items:center}
.settings-test-card>div{display:flex;flex-direction:column;gap:3px}
.settings-test-card strong{font-size:10px}.settings-test-card span{font-size:8px;color:#8a95a3}
.settings-info-card strong{font-size:11px}.settings-info-card p{font-size:9px;line-height:1.55;color:#7e8998;margin:6px 0 0}
.auth-forgot-link{display:block;text-align:center;margin-top:13px;font-size:9px;color:#5575a5;text-decoration:none}
.full-detail-head-actions{display:flex;align-items:center;gap:7px}

.share-modal-card{width:min(100%,520px)}
.share-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.share-form-grid label{display:flex;flex-direction:column;gap:5px;font-size:9px;font-weight:650;color:#647084}
.share-form-grid input,.share-form-grid select{
  height:38px;border:1px solid #dce3eb;border-radius:8px;padding:0 9px;background:#fff;font-size:10px
}
.share-form-hint{margin-top:10px;padding:9px 10px;border-radius:8px;background:#f6f8fb;color:#7d8898;font-size:8px;line-height:1.5}
.share-result{margin-top:12px;padding:11px;border:1px solid #cfe0f5;background:#f6faff;border-radius:9px}
.share-result>span{font-size:8px;color:#72829a}.share-result>div{display:flex;gap:6px;margin-top:5px}
.share-result input{flex:1;min-width:0;height:34px;border:1px solid #d4deeb;border-radius:7px;padding:0 8px;font-size:9px;background:#fff}
.share-result small{display:block;margin-top:5px;color:#8490a0;font-size:8px}

.public-share-page{margin:0;background:#f2f5f9;color:#243247;font-family:Arial,sans-serif;min-height:100vh}
.public-share-shell{max-width:1100px;margin:0 auto;padding:24px}
.public-share-brand{display:flex;align-items:center;gap:10px;margin-bottom:18px}.public-share-brand>div:last-child{display:flex;flex-direction:column}.public-share-brand strong{font-size:14px}.public-share-brand span{font-size:9px;color:#85909e}
.public-pin-card,.public-share-message{max-width:430px;margin:10vh auto 0;background:#fff;border:1px solid #e1e6ed;border-radius:15px;padding:24px;box-shadow:0 12px 35px rgba(30,50,75,.07)}
.public-pin-card h1,.public-share-message h1{font-size:18px;margin:0 0 7px}.public-pin-card p,.public-share-message p{font-size:10px;color:#7d8897;line-height:1.5}
.public-pin-card form label{display:flex;flex-direction:column;gap:6px;font-size:9px;margin:16px 0 10px}.share-pin-input{text-align:center;letter-spacing:10px;font-size:20px!important;height:48px;border:1px solid #dce3eb;border-radius:9px}
.public-pin-card small{display:block;text-align:center;margin-top:12px;color:#909aa7;font-size:8px}
.public-document-card{background:#fff;border:1px solid #e1e6ed;border-radius:15px;overflow:hidden}
.public-document-head{display:flex;justify-content:space-between;gap:15px;align-items:center;padding:15px 17px;border-bottom:1px solid #e7ebf0}.public-document-head h1{font-size:15px;margin:0 0 4px}.public-document-head span{font-size:9px;color:#8792a0}
.public-document-preview{display:block;width:100%;height:72vh;border:0;background:#eee}.public-image-wrap{display:grid;place-items:center;min-height:60vh;padding:18px;background:#f5f6f8}.public-image-wrap img{max-width:100%;max-height:70vh}
.public-share-meta{display:flex;justify-content:space-between;padding:10px 16px;font-size:8px;color:#8994a1;border-top:1px solid #e7ebf0}

@media(max-width:650px){
 .settings-form-grid,.share-form-grid{grid-template-columns:1fr}.settings-grid-wide{grid-column:auto}
 .settings-test-card{grid-template-columns:1fr}
 .public-share-shell{padding:12px}.public-document-head{align-items:flex-start;flex-direction:column}.public-document-preview{height:68vh}
}

.share-existing{margin-top:13px;border-top:1px solid #e6ebf1;padding-top:11px}
.share-existing-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px}.share-existing-head strong{font-size:9px}.share-existing-head span{font-size:8px;color:#8a95a3}
.share-existing-list{display:flex;flex-direction:column;gap:5px;max-height:150px;overflow:auto}
.share-existing-row{display:flex;align-items:center;justify-content:space-between;gap:9px;padding:8px 9px;background:#f8fafc;border:1px solid #e8edf3;border-radius:8px}
.share-existing-row>div{display:flex;flex-direction:column;gap:2px}.share-existing-row strong{font-size:8px}.share-existing-row span,.share-existing-empty{font-size:7px;color:#8792a0}
.share-disable-button{border:1px solid #e1caca;background:#fff;color:#a44b4b;border-radius:6px;padding:5px 7px;font-size:7px;cursor:pointer}


/* ========================================================
   v0.11.1 – zentrale Freigabenübersicht
   ======================================================== */
.settings-share-list-card{
  background:#fff;
  border:1px solid #e4e9f0;
  border-radius:14px;
  padding:17px;
  margin-bottom:14px;
}
.settings-share-list-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:15px;
  margin-bottom:13px;
}
.settings-share-list-head h2{
  margin:0;
  font-size:13px;
}
.settings-share-list-head p{
  margin:4px 0 0;
  color:#8792a0;
  font-size:9px;
}
.share-stats{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.share-stats span{
  padding:5px 7px;
  border:1px solid #e0e6ed;
  border-radius:7px;
  background:#fafbfc;
  font-size:7px;
  color:#7c8796;
}
.share-stats strong{
  color:#3b4655;
  margin-right:2px;
}
.settings-share-table-wrap{
  overflow:auto;
}
.settings-share-table{
  width:100%;
  min-width:900px;
  border-collapse:collapse;
}
.settings-share-table th{
  text-align:left;
  padding:8px;
  border-bottom:1px solid #e5eaf0;
  font-size:7px;
  color:#8893a1;
}
.settings-share-table td{
  padding:9px 8px;
  border-bottom:1px solid #eef1f5;
  font-size:8px;
  vertical-align:middle;
}
.settings-share-table td:first-child{
  min-width:210px;
}
.share-doc-link{
  display:block;
  max-width:260px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#355e98;
  font-size:9px;
  font-weight:700;
  text-decoration:none;
}
.settings-share-table td small{
  display:block;
  margin-top:2px;
  color:#929ba7;
  font-size:7px;
}
.share-status-pill{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:4px 7px;
  font-size:7px;
  font-weight:750;
}
.share-status-pill.state-active{
  background:#e8f8ed;
  color:#287a48;
}
.share-status-pill.state-expired{
  background:#f1f2f4;
  color:#747c87;
}
.share-status-pill.state-limit{
  background:#fff1dc;
  color:#8d641c;
}
.share-status-pill.state-disabled{
  background:#fdecec;
  color:#9a4848;
}
.share-row-actions{
  display:flex;
  gap:5px;
  align-items:center;
}
.share-row-actions form{
  margin:0;
}
.share-action-btn{
  border:1px solid #d9e0e9;
  background:#fff;
  border-radius:6px;
  padding:5px 7px;
  color:#5e6c7e;
  font-size:7px;
  font-weight:700;
  cursor:pointer;
}
.share-action-btn.danger{
  border-color:#ead1d1;
  color:#aa4949;
}
.share-table-empty{
  padding:22px!important;
  text-align:center;
  color:#8b95a2;
}
@media(max-width:700px){
  .settings-share-list-head{
    flex-direction:column;
  }
  .share-stats{
    justify-content:flex-start;
  }
}


/* ========================================================
   v0.11.2 – Einstellungen konsequent in voller Seitenbreite
   ======================================================== */

/* Alle Einstellungs-Unterseiten sollen – wie die OCR-Seite –
   die verfügbare Breite des Hauptbereichs verwenden. */
body .settings-form-page,
body .settings-page,
body .settings-content,
body .subpage-content.settings-form-page,
body .subpage-content.settings-page,
body .subpage-content.settings-content{
  width:100%;
  max-width:none !important;
  box-sizing:border-box;
}

/* Karten innerhalb der Einstellungen ebenfalls nicht künstlich begrenzen. */
.settings-form-page > .settings-form-card,
.settings-form-page > .settings-test-card,
.settings-form-page > .settings-info-card,
.settings-form-page > .settings-share-list-card,
.settings-page > .settings-form-card,
.settings-page > .settings-info-card{
  width:100%;
  max-width:none;
  box-sizing:border-box;
}

/* Formulare nutzen die gesamte Kartenbreite. */
.settings-form-card form,
.settings-form-page form.settings-form-card,
.settings-form-page .settings-form-grid,
.settings-form-page .settings-single-field{
  width:100%;
  max-width:none;
  box-sizing:border-box;
}

/* Große Desktop-Bildschirme: sinnvoll mehrspaltig statt schmaler Mittelspalte. */
@media(min-width:1100px){
  .settings-form-page .settings-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* Mobile bleibt einspaltig und ohne horizontales Überlaufen. */
@media(max-width:650px){
  .settings-form-page,
  .settings-page,
  .settings-content{
    width:100%;
    max-width:100% !important;
    min-width:0;
  }
}


/* ========================================================
   v0.11.3 – Benutzerverwaltung ebenfalls volle Seitenbreite
   ======================================================== */
body .user-admin-content,
body .subpage-content.user-admin-content{
  width:100%;
  max-width:none !important;
  box-sizing:border-box;
}

.user-admin-content .user-admin-panel{
  width:100%;
  max-width:none;
  box-sizing:border-box;
}

.user-admin-content .user-admin-list{
  width:100%;
}

.user-admin-content .user-admin-row{
  width:100%;
  box-sizing:border-box;
}

/* Auf großen Displays die verfügbare Breite sinnvoll nutzen. */
@media(min-width:1200px){
  .user-create-form{
    grid-template-columns:
      minmax(160px,1.1fr)
      minmax(150px,.9fr)
      minmax(220px,1.4fr)
      minmax(150px,.8fr);
  }

  .user-edit-form{
    grid-template-columns:
      minmax(160px,1.1fr)
      minmax(150px,.9fr)
      minmax(220px,1.4fr)
      minmax(150px,.8fr);
  }
}


/* ========================================================
   v0.12.1 – Haushaltsgeld-Einstellungen im Familien-Portal
   ======================================================== */
.settings-household-category-card{
  width:100%;
  background:#fff;
  border:1px solid #e4e9f0;
  border-radius:14px;
  padding:17px;
  margin-bottom:14px;
  box-sizing:border-box;
}
.settings-household-count{
  display:inline-flex;
  align-items:center;
  padding:5px 8px;
  border:1px solid #e0e6ed;
  border-radius:7px;
  background:#fafbfc;
  color:#7d8795;
  font-size:8px;
}
.settings-household-add-category{
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto;
  gap:8px;
  margin:12px 0 14px;
}
.settings-household-add-category input{
  height:38px;
  border:1px solid #dce3eb;
  border-radius:8px;
  padding:0 9px;
  font-size:10px;
}
.settings-household-category-list{
  border:1px solid #e8edf3;
  border-radius:10px;
  overflow:hidden;
}
.settings-household-category-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 11px;
  border-bottom:1px solid #edf1f5;
}
.settings-household-category-row:last-child{
  border-bottom:0;
}
.settings-household-category-row>div{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.settings-household-category-row strong{
  font-size:10px;
  color:#334154;
}
.settings-household-category-row span{
  font-size:8px;
  color:#8b96a4;
}
.settings-household-category-row form{
  margin:0;
}
.settings-household-category-row button:disabled{
  opacity:.4;
  cursor:not-allowed;
}
@media(max-width:650px){
  .settings-household-add-category{
    grid-template-columns:1fr;
  }
  .settings-household-category-row{
    align-items:flex-start;
  }
}


/* ========================================================
   v0.12.4 – Sidebar auf Desktop scrollbar
   ======================================================== */

/* Sidebar als feste Höhenstruktur:
   Logo oben, Navigation scrollbar, Footer unten. */
@media(min-width:901px){
  .sidebar.mock-sidebar{
    height:100vh;
    max-height:100vh;
    overflow:hidden;
    display:flex;
    flex-direction:column;
  }

  .sidebar.mock-sidebar .sidebar-top{
    flex:0 0 auto;
  }

  .sidebar.mock-sidebar .main-nav{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
    scrollbar-width:thin;
    padding-bottom:12px;
  }

  .sidebar.mock-sidebar .sidebar-footer{
    flex:0 0 auto;
    background:#fff;
    border-top:1px solid #e7ebf0;
  }

  /* Dezente Scrollbar in Chromium/Edge */
  .sidebar.mock-sidebar .main-nav::-webkit-scrollbar{
    width:6px;
  }

  .sidebar.mock-sidebar .main-nav::-webkit-scrollbar-track{
    background:transparent;
  }

  .sidebar.mock-sidebar .main-nav::-webkit-scrollbar-thumb{
    background:#d6dde7;
    border-radius:999px;
  }

  .sidebar.mock-sidebar .main-nav::-webkit-scrollbar-thumb:hover{
    background:#c2ccd9;
  }
}


/* ========================================================
   v0.12.5 – Sidebar scrollbar unsichtbar
   ======================================================== */
@media(min-width:901px){
  .sidebar.mock-sidebar .main-nav{
    scrollbar-width:none;        /* Firefox */
    -ms-overflow-style:none;     /* Legacy Edge/IE */
  }

  .sidebar.mock-sidebar .main-nav::-webkit-scrollbar{
    width:0;
    height:0;
    display:none;                /* Chromium / Safari */
  }
}

/* v0.13.3 – Login merken */
.auth-card .auth-remember{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:8px;
  margin-top:-2px;
  color:#657084;
  font-size:9px;
  font-weight:600;
  cursor:pointer;
}
.auth-card .auth-remember input{
  width:15px;
  height:15px;
  margin:0;
  accent-color:#4775b4;
}


/* ========================================================
   v0.13.4 – Theme-System
   ======================================================== */

/* Shared semantic variables */
:root,
html[data-theme="light"]{
  --theme-bg:#f5f7fb;
  --theme-surface:#ffffff;
  --theme-surface-2:#f8fafc;
  --theme-surface-3:#f1f4f8;
  --theme-text:#172033;
  --theme-text-2:#4f5b6f;
  --theme-muted:#7d8797;
  --theme-line:#e7ebf1;
  --theme-line-strong:#d9e0e9;
  --theme-accent:#2e6cf6;
  --theme-accent-soft:#edf4ff;
  --theme-hover:#fbfdff;
  --theme-input:#ffffff;
  --theme-shadow:0 10px 35px rgba(35,51,84,.08);
  --theme-overlay:rgba(20,28,45,.42);
}

/* More contrast, still light */
html[data-theme="light-contrast"]{
  --theme-bg:#eef1f5;
  --theme-surface:#ffffff;
  --theme-surface-2:#f4f6f8;
  --theme-surface-3:#e9edf2;
  --theme-text:#111827;
  --theme-text-2:#344054;
  --theme-muted:#5d6878;
  --theme-line:#cfd6df;
  --theme-line-strong:#b9c3cf;
  --theme-accent:#175fd4;
  --theme-accent-soft:#e3efff;
  --theme-hover:#f2f6fb;
  --theme-input:#ffffff;
  --theme-shadow:0 7px 22px rgba(25,39,61,.10);
  --theme-overlay:rgba(13,20,31,.48);
}

/* Dark */
html[data-theme="dark"]{
  color-scheme:dark;
  --theme-bg:#171b22;
  --theme-surface:#202630;
  --theme-surface-2:#252c37;
  --theme-surface-3:#2a323e;
  --theme-text:#edf2f7;
  --theme-text-2:#c5ced9;
  --theme-muted:#96a1af;
  --theme-line:#343d49;
  --theme-line-strong:#434d5b;
  --theme-accent:#6d9cff;
  --theme-accent-soft:#263954;
  --theme-hover:#252e39;
  --theme-input:#252c36;
  --theme-shadow:0 10px 32px rgba(0,0,0,.20);
  --theme-overlay:rgba(0,0,0,.62);
}

/* Strong dark contrast */
html[data-theme="dark-contrast"]{
  color-scheme:dark;
  --theme-bg:#0e1116;
  --theme-surface:#171c23;
  --theme-surface-2:#1d232c;
  --theme-surface-3:#232b35;
  --theme-text:#ffffff;
  --theme-text-2:#d9e1ea;
  --theme-muted:#aeb8c5;
  --theme-line:#3f4a58;
  --theme-line-strong:#566373;
  --theme-accent:#77a8ff;
  --theme-accent-soft:#203b61;
  --theme-hover:#222a34;
  --theme-input:#1d242d;
  --theme-shadow:0 10px 32px rgba(0,0,0,.34);
  --theme-overlay:rgba(0,0,0,.72);
}

/* Map the old base variables onto the selected theme. */
html[data-theme]{
  --bg:var(--theme-bg);
  --surface:var(--theme-surface);
  --surface2:var(--theme-surface-2);
  --text:var(--theme-text);
  --muted:var(--theme-muted);
  --line:var(--theme-line);
  --blue:var(--theme-accent);
  --blue2:var(--theme-accent-soft);
  --shadow:var(--theme-shadow);
}

html[data-theme] body,
html[data-theme] .main-area,
html[data-theme] .mock-main{
  background:var(--theme-bg);
  color:var(--theme-text);
}

/* Main chrome */
html[data-theme] .sidebar,
html[data-theme] .sidebar-footer,
html[data-theme] .global-topbar,
html[data-theme] .topbar,
html[data-theme] .detail-topbar,
html[data-theme] .subpage-heading{
  background:var(--theme-surface);
  color:var(--theme-text);
  border-color:var(--theme-line);
}

html[data-theme] .brand-text strong,
html[data-theme] .global-user strong,
html[data-theme] .subpage-heading h1,
html[data-theme] .section-head h2{
  color:var(--theme-text);
}

html[data-theme] .brand-text span,
html[data-theme] .subpage-heading p,
html[data-theme] .eyebrow{
  color:var(--theme-muted);
}

html[data-theme] .nav-item{
  color:var(--theme-text-2);
}

html[data-theme] .nav-item:hover,
html[data-theme] .nav-item.active{
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
}

html[data-theme] .nav-section-title{
  color:var(--theme-muted);
}

html[data-theme] .badge{
  background:var(--theme-surface-3);
  color:var(--theme-text-2);
}

/* Surfaces / cards / lists */
html[data-theme] .summary-card,
html[data-theme] .document-list,
html[data-theme] .viewer-card,
html[data-theme] .edit-card,
html[data-theme] .settings-tile,
html[data-theme] .settings-form-card,
html[data-theme] .settings-test-card,
html[data-theme] .settings-info-card,
html[data-theme] .settings-share-list-card,
html[data-theme] .settings-household-category-card,
html[data-theme] .profile-card,
html[data-theme] .modal-card,
html[data-theme] .auth-card,
html[data-theme] .ocr-card,
html[data-theme] .ocr-stat-card,
html[data-theme] .user-admin-panel{
  background:var(--theme-surface) !important;
  color:var(--theme-text);
  border-color:var(--theme-line) !important;
  box-shadow:var(--theme-shadow);
}

html[data-theme] .doc-row{
  border-color:var(--theme-line);
}

html[data-theme] .doc-row:hover{
  background:var(--theme-hover);
}

html[data-theme] .doc-main strong,
html[data-theme] .settings-tile strong,
html[data-theme] .profile-card h2{
  color:var(--theme-text);
}

html[data-theme] .doc-main>span,
html[data-theme] .settings-tile small,
html[data-theme] .doc-size,
html[data-theme] .settings-section-title p{
  color:var(--theme-muted);
}

/* Inputs and controls */
html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea,
html[data-theme] .searchbox,
html[data-theme] .global-search,
html[data-theme] .filter-btn,
html[data-theme] .icon-btn,
html[data-theme] .more-btn,
html[data-theme] .btn.secondary{
  background:var(--theme-input) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme] input::placeholder,
html[data-theme] textarea::placeholder{
  color:var(--theme-muted);
}

html[data-theme] .btn.primary{
  background:var(--theme-accent) !important;
  color:#fff !important;
}

html[data-theme] .modal-backdrop{
  background:var(--theme-overlay);
}

/* Tags / pills */
html[data-theme] .tags span,
html[data-theme] .metadata-chip{
  background:var(--theme-surface-3);
  color:var(--theme-text-2);
}

/* Preview / detail areas */
html[data-theme] .image-preview,
html[data-theme] .preview-placeholder,
html[data-theme] .preview-panel{
  background:var(--theme-surface-2);
}

/* Auth */
html[data-theme] .auth-page{
  background:var(--theme-bg);
}

/* Generic tables */
html[data-theme] table th{
  color:var(--theme-muted);
  border-color:var(--theme-line);
}
html[data-theme] table td{
  color:var(--theme-text-2);
  border-color:var(--theme-line);
}

/* Household integration */
html[data-theme] .household-module{
  background:var(--theme-bg) !important;
  color:var(--theme-text);
}
html[data-theme] .household-module .household-module-header,
html[data-theme] .household-module .hero-summary,
html[data-theme] .household-module .cost-card,
html[data-theme] .household-module .reserve-block,
html[data-theme] .household-module .modal-card{
  background:var(--theme-surface) !important;
  color:var(--theme-text);
  border-color:var(--theme-line) !important;
}
html[data-theme] .household-module .card-head,
html[data-theme] .household-module .card-footer,
html[data-theme] .household-module .reserve-head,
html[data-theme] .household-module .reserve-booking-box,
html[data-theme] .household-module .hero-mini-grid>div{
  background:var(--theme-surface-2) !important;
  border-color:var(--theme-line) !important;
}
html[data-theme] .household-module .card-head h2,
html[data-theme] .household-module .entry-main strong,
html[data-theme] .household-module .reserve-row strong,
html[data-theme] .household-module .entry-actions>b,
html[data-theme] .household-module .card-footer strong,
html[data-theme] .household-module .summary-list strong{
  color:var(--theme-text);
}
html[data-theme] .household-module .entry-main>span,
html[data-theme] .household-module .card-head span,
html[data-theme] .household-module .summary-list span{
  color:var(--theme-muted);
}

/* Octopus integration */
html[data-theme] .octopus-content{
  background:var(--theme-bg);
}
html[data-theme] .octopus-kpi,
html[data-theme] .octopus-table-card,
html[data-theme] .octopus-modal{
  background:var(--theme-surface) !important;
  border-color:var(--theme-line) !important;
  color:var(--theme-text);
}
html[data-theme] .octopus-year-summary>div,
html[data-theme] .octopus-table-head,
html[data-theme] .octopus-form-hint{
  background:var(--theme-surface-2) !important;
  border-color:var(--theme-line) !important;
}
html[data-theme] .octopus-kpi strong,
html[data-theme] .octopus-year-summary strong,
html[data-theme] .octopus-table-head h2,
html[data-theme] .octopus-table td:first-child strong{
  color:var(--theme-text);
}
html[data-theme] .octopus-kpi small,
html[data-theme] .octopus-year-summary span,
html[data-theme] .octopus-table-head p{
  color:var(--theme-muted);
}
html[data-theme] .octopus-table tbody tr:hover{
  background:var(--theme-hover);
}

/* Appearance page */
.appearance-settings-card{
  width:100%;
  padding:17px;
  border:1px solid var(--theme-line);
  border-radius:14px;
  background:var(--theme-surface);
}
.appearance-theme-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.appearance-theme-option{
  position:relative;
  display:grid;
  grid-template-columns:150px minmax(0,1fr) 24px;
  align-items:center;
  gap:13px;
  padding:12px;
  border:2px solid var(--theme-line);
  border-radius:12px;
  background:var(--theme-surface-2);
  cursor:pointer;
  transition:.15s;
}
.appearance-theme-option:hover{
  border-color:var(--theme-line-strong);
}
.appearance-theme-option.selected{
  border-color:var(--theme-accent);
  background:var(--theme-accent-soft);
}
.appearance-theme-option>input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.appearance-theme-copy{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.appearance-theme-copy strong{
  font-size:10px;
  color:var(--theme-text);
}
.appearance-theme-copy small{
  font-size:8px;
  line-height:1.4;
  color:var(--theme-muted);
}
.appearance-theme-check{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border:1px solid var(--theme-line-strong);
  border-radius:50%;
  color:transparent;
  font-size:10px;
}
.appearance-theme-option.selected .appearance-theme-check{
  border-color:var(--theme-accent);
  background:var(--theme-accent);
  color:#fff;
}
.appearance-theme-preview{
  height:88px;
  display:grid;
  grid-template-columns:36px 1fr;
  overflow:hidden;
  border:1px solid rgba(128,140,155,.35);
  border-radius:8px;
}
.appearance-preview-sidebar{
  padding:9px 6px;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.appearance-preview-sidebar i{
  display:block;
  height:5px;
  border-radius:4px;
}
.appearance-preview-main{
  padding:9px;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.appearance-preview-main>b{
  width:55%;
  height:6px;
  border-radius:4px;
}
.appearance-preview-cards{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
}
.appearance-preview-cards i{
  height:24px;
  border-radius:5px;
  border:1px solid;
}
.appearance-preview-lines{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.appearance-preview-lines i{
  height:4px;
  border-radius:4px;
}
.theme-preview-light{background:#f5f7fb}
.theme-preview-light .appearance-preview-sidebar{background:#fff}
.theme-preview-light i,.theme-preview-light b{background:#dce3ec}
.theme-preview-light .appearance-preview-cards i{background:#fff;border-color:#e1e7ee}

.theme-preview-light-contrast{background:#e9edf2}
.theme-preview-light-contrast .appearance-preview-sidebar{background:#fff}
.theme-preview-light-contrast i,.theme-preview-light-contrast b{background:#aeb8c5}
.theme-preview-light-contrast .appearance-preview-cards i{background:#fff;border-color:#bbc4cf}

.theme-preview-dark{background:#171b22}
.theme-preview-dark .appearance-preview-sidebar{background:#202630}
.theme-preview-dark i,.theme-preview-dark b{background:#566171}
.theme-preview-dark .appearance-preview-cards i{background:#252c37;border-color:#394350}

.theme-preview-dark-contrast{background:#0e1116}
.theme-preview-dark-contrast .appearance-preview-sidebar{background:#171c23}
.theme-preview-dark-contrast i,.theme-preview-dark-contrast b{background:#748193}
.theme-preview-dark-contrast .appearance-preview-cards i{background:#1d232c;border-color:#4d5967}

.appearance-note{
  margin-top:13px;
  padding:10px 11px;
  border:1px solid var(--theme-line);
  border-radius:8px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:8px;
}

@media(max-width:900px){
  .appearance-theme-grid{
    grid-template-columns:1fr;
  }
}
@media(max-width:560px){
  .appearance-theme-option{
    grid-template-columns:105px minmax(0,1fr) 22px;
  }
  .appearance-theme-preview{
    height:72px;
  }
}


/* ========================================================
   v0.13.8 – Dark Mode exakt auf echte Familien-Portal-Komponenten
   ======================================================== */

/* ---------- Hauptnavigation / Topbar ---------- */
html[data-theme="dark"] .global-topbar,
html[data-theme="dark-contrast"] .global-topbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark-contrast"] .sidebar,
html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark-contrast"] .sidebar-footer{
  background:var(--theme-surface) !important;
  border-color:var(--theme-line) !important;
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .global-search,
html[data-theme="dark-contrast"] .global-search{
  background:var(--theme-input) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .global-search input,
html[data-theme="dark-contrast"] .global-search input{
  background:transparent !important;
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .search-shortcut,
html[data-theme="dark-contrast"] .search-shortcut{
  background:var(--theme-surface-3) !important;
  color:var(--theme-text-2) !important;
  border-color:var(--theme-line) !important;
}

/* ---------- Dokumentarbeitsfläche ---------- */
html[data-theme="dark"] .doc-workspace,
html[data-theme="dark-contrast"] .doc-workspace,
html[data-theme="dark"] .doc-center,
html[data-theme="dark-contrast"] .doc-center{
  background:var(--theme-bg) !important;
}

/* Exakt die aktuelle Dokumentkarte */
html[data-theme="dark"] .mock-doc-row,
html[data-theme="dark-contrast"] .mock-doc-row{
  background:var(--theme-surface) !important;
  border-color:var(--theme-line) !important;
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .mock-doc-row:hover,
html[data-theme="dark-contrast"] .mock-doc-row:hover{
  background:var(--theme-hover) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .mock-doc-row.selected,
html[data-theme="dark-contrast"] .mock-doc-row.selected{
  background:var(--theme-accent-soft) !important;
  border-color:var(--theme-accent) !important;
  box-shadow:0 0 0 1px var(--theme-accent) !important;
}

html[data-theme="dark"] .mock-doc-title-line strong,
html[data-theme="dark-contrast"] .mock-doc-title-line strong,
html[data-theme="dark"] .doc-title-link strong,
html[data-theme="dark-contrast"] .doc-title-link strong{
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .mock-doc-subline,
html[data-theme="dark-contrast"] .mock-doc-subline,
html[data-theme="dark"] .mock-doc-meta span,
html[data-theme="dark-contrast"] .mock-doc-meta span,
html[data-theme="dark"] .mock-doc-meta small,
html[data-theme="dark-contrast"] .mock-doc-meta small{
  color:var(--theme-muted) !important;
}

html[data-theme="dark"] .mock-doc-row .tag-pill,
html[data-theme="dark-contrast"] .mock-doc-row .tag-pill,
html[data-theme="dark"] .mock-doc-row .type-pill,
html[data-theme="dark-contrast"] .mock-doc-row .type-pill,
html[data-theme="dark"] .mock-doc-row .category-pill,
html[data-theme="dark-contrast"] .mock-doc-row .category-pill{
  background:var(--theme-surface-3) !important;
  color:var(--theme-text-2) !important;
  border-color:var(--theme-line) !important;
}

/* PDF icon */
html[data-theme="dark"] .mock-doc-row .file-icon.pdf,
html[data-theme="dark-contrast"] .mock-doc-row .file-icon.pdf{
  background:#442a2e !important;
  color:#ff9ba2 !important;
  border-color:#684047 !important;
}

/* ---------- Rechte Detailspalte ---------- */
html[data-theme="dark"] .right-preview,
html[data-theme="dark-contrast"] .right-preview,
html[data-theme="dark"] .mock-detail-panel,
html[data-theme="dark-contrast"] .mock-detail-panel{
  background:var(--theme-surface) !important;
  border-color:var(--theme-line) !important;
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .right-preview-head,
html[data-theme="dark-contrast"] .right-preview-head{
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .right-preview-head h3,
html[data-theme="dark-contrast"] .right-preview-head h3,
html[data-theme="dark"] .mock-detail-header h2,
html[data-theme="dark-contrast"] .mock-detail-header h2,
html[data-theme="dark"] .detail-info h3,
html[data-theme="dark-contrast"] .detail-info h3{
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .mock-tabs,
html[data-theme="dark-contrast"] .mock-tabs,
html[data-theme="dark"] .preview-tabs,
html[data-theme="dark-contrast"] .preview-tabs{
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .mock-tab,
html[data-theme="dark-contrast"] .mock-tab,
html[data-theme="dark"] .preview-tab,
html[data-theme="dark-contrast"] .preview-tab{
  color:var(--theme-muted) !important;
  background:transparent !important;
}

html[data-theme="dark"] .mock-tab.active,
html[data-theme="dark-contrast"] .mock-tab.active,
html[data-theme="dark"] .preview-tab.active,
html[data-theme="dark-contrast"] .preview-tab.active{
  color:var(--theme-accent) !important;
}

/* Info-Felder */
html[data-theme="dark"] .info-field>span,
html[data-theme="dark-contrast"] .info-field>span,
html[data-theme="dark"] .preview-label,
html[data-theme="dark-contrast"] .preview-label{
  color:var(--theme-muted) !important;
}

html[data-theme="dark"] .info-field strong,
html[data-theme="dark-contrast"] .info-field strong{
  color:var(--theme-text) !important;
}

/* Felder in rechter Spalte */
html[data-theme="dark"] .inline-edit,
html[data-theme="dark-contrast"] .inline-edit,
html[data-theme="dark"] .preview-category-form select,
html[data-theme="dark-contrast"] .preview-category-form select{
  background:var(--theme-input) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line-strong) !important;
}

/* Vorschau-Rahmen */
html[data-theme="dark"] .mock-pdf-preview,
html[data-theme="dark-contrast"] .mock-pdf-preview,
html[data-theme="dark"] .preview-document,
html[data-theme="dark-contrast"] .preview-document,
html[data-theme="dark"] .large-preview-shell,
html[data-theme="dark-contrast"] .large-preview-shell{
  background:#303741 !important;
  border-color:var(--theme-line) !important;
}

/* Aktionen */
html[data-theme="dark"] .mock-actions-block,
html[data-theme="dark-contrast"] .mock-actions-block,
html[data-theme="dark"] .preview-actions,
html[data-theme="dark-contrast"] .preview-actions{
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .mock-actions-title,
html[data-theme="dark-contrast"] .mock-actions-title{
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .mock-actions-row .btn.secondary,
html[data-theme="dark-contrast"] .mock-actions-row .btn.secondary,
html[data-theme="dark"] .preview-actions .btn.secondary,
html[data-theme="dark-contrast"] .preview-actions .btn.secondary{
  background:var(--theme-surface-2) !important;
  color:var(--theme-text-2) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .detail-footer-meta,
html[data-theme="dark-contrast"] .detail-footer-meta{
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .detail-footer-meta span,
html[data-theme="dark-contrast"] .detail-footer-meta span{
  color:var(--theme-muted) !important;
}
html[data-theme="dark"] .detail-footer-meta strong,
html[data-theme="dark-contrast"] .detail-footer-meta strong{
  color:var(--theme-text) !important;
}

/* ---------- OCR Vorschläge, exakt aktuelle Klassen ---------- */
html[data-theme="dark"] .metadata-suggestions,
html[data-theme="dark-contrast"] .metadata-suggestions{
  background:var(--theme-surface-2) !important;
  border-color:var(--theme-line) !important;
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .metadata-suggestions-head,
html[data-theme="dark-contrast"] .metadata-suggestions-head{
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .metadata-suggestions-head strong,
html[data-theme="dark-contrast"] .metadata-suggestions-head strong,
html[data-theme="dark"] .metadata-suggestion-main>strong,
html[data-theme="dark-contrast"] .metadata-suggestion-main>strong{
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .metadata-suggestions-head span,
html[data-theme="dark-contrast"] .metadata-suggestions-head span,
html[data-theme="dark"] .metadata-suggestion-main>span,
html[data-theme="dark-contrast"] .metadata-suggestion-main>span,
html[data-theme="dark"] .metadata-suggestion-main>small,
html[data-theme="dark-contrast"] .metadata-suggestion-main>small,
html[data-theme="dark"] .metadata-suggestions-loading,
html[data-theme="dark-contrast"] .metadata-suggestions-loading,
html[data-theme="dark"] .metadata-suggestions-empty,
html[data-theme="dark-contrast"] .metadata-suggestions-empty{
  color:var(--theme-muted) !important;
}

html[data-theme="dark"] .metadata-suggestion-item,
html[data-theme="dark-contrast"] .metadata-suggestion-item{
  background:var(--theme-surface) !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .metadata-suggestion-editor,
html[data-theme="dark-contrast"] .metadata-suggestion-editor{
  background:var(--theme-surface-2) !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .metadata-suggestion-editor-control,
html[data-theme="dark-contrast"] .metadata-suggestion-editor-control{
  background:var(--theme-input) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line-strong) !important;
}

/* ---------- Große Detailansicht ---------- */
html[data-theme="dark"] .full-detail-page,
html[data-theme="dark-contrast"] .full-detail-page,
html[data-theme="dark"] .full-detail-shell,
html[data-theme="dark-contrast"] .full-detail-shell{
  background:var(--theme-bg) !important;
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .full-detail-topbar,
html[data-theme="dark-contrast"] .full-detail-topbar,
html[data-theme="dark"] .full-detail-card,
html[data-theme="dark-contrast"] .full-detail-card{
  background:var(--theme-surface) !important;
  border-color:var(--theme-line) !important;
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .full-detail-card-head,
html[data-theme="dark-contrast"] .full-detail-card-head{
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .full-detail-card-head h2,
html[data-theme="dark-contrast"] .full-detail-card-head h2,
html[data-theme="dark"] .full-detail-title h1,
html[data-theme="dark-contrast"] .full-detail-title h1,
html[data-theme="dark"] .full-detail-info h3,
html[data-theme="dark-contrast"] .full-detail-info h3,
html[data-theme="dark"] .full-detail-info .info-field strong,
html[data-theme="dark-contrast"] .full-detail-info .info-field strong{
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .full-detail-card-head span,
html[data-theme="dark-contrast"] .full-detail-card-head span,
html[data-theme="dark"] .full-detail-title>span:last-child,
html[data-theme="dark-contrast"] .full-detail-title>span:last-child,
html[data-theme="dark"] .full-detail-info .info-field>span,
html[data-theme="dark-contrast"] .full-detail-info .info-field>span{
  color:var(--theme-muted) !important;
}

html[data-theme="dark"] .full-inline-edit,
html[data-theme="dark-contrast"] .full-inline-edit{
  background:var(--theme-input) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .full-pdf-preview,
html[data-theme="dark-contrast"] .full-pdf-preview,
html[data-theme="dark"] .full-large-preview,
html[data-theme="dark-contrast"] .full-large-preview{
  background:#303741 !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .full-detail-actions,
html[data-theme="dark-contrast"] .full-detail-actions,
html[data-theme="dark"] .full-detail-footer,
html[data-theme="dark-contrast"] .full-detail-footer{
  border-color:var(--theme-line) !important;
}

/* ---------- Dropdowns ---------- */
html[data-theme="dark"] option,
html[data-theme="dark-contrast"] option{
  background:var(--theme-input) !important;
  color:var(--theme-text) !important;
}


/* ========================================================
   v0.14.0 – Dark Mode für Verwaltungsseiten
   Nur konkrete Familien-Portal-Klassen, keine globalen Kartenregeln.
   ======================================================== */

/* Tags, Kategorien, Korrespondenten */
html[data-theme="dark"] .management-create,
html[data-theme="dark-contrast"] .management-create,
html[data-theme="dark"] .management-row,
html[data-theme="dark-contrast"] .management-row{
  background:var(--theme-surface) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .management-create input,
html[data-theme="dark-contrast"] .management-create input,
html[data-theme="dark"] .management-edit input,
html[data-theme="dark-contrast"] .management-edit input{
  background:var(--theme-input) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .management-icon,
html[data-theme="dark-contrast"] .management-icon{
  background:var(--theme-accent-soft) !important;
  color:var(--theme-accent) !important;
}

html[data-theme="dark"] .management-count,
html[data-theme="dark-contrast"] .management-count{
  color:var(--theme-muted) !important;
}

html[data-theme="dark"] .management-section-title,
html[data-theme="dark-contrast"] .management-section-title{
  color:var(--theme-text) !important;
}

/* Kategorie Icon-Auswahl */
html[data-theme="dark"] .icon-picker-trigger,
html[data-theme="dark-contrast"] .icon-picker-trigger,
html[data-theme="dark"] .compact-icon-picker,
html[data-theme="dark-contrast"] .compact-icon-picker{
  background:var(--theme-input) !important;
  color:var(--theme-text-2) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .icon-gallery-card,
html[data-theme="dark-contrast"] .icon-gallery-card{
  background:var(--theme-surface) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .icon-gallery-search,
html[data-theme="dark-contrast"] .icon-gallery-search{
  background:var(--theme-input) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .icon-gallery-search input,
html[data-theme="dark-contrast"] .icon-gallery-search input{
  background:transparent !important;
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .icon-gallery-search span,
html[data-theme="dark-contrast"] .icon-gallery-search span,
html[data-theme="dark"] .icon-gallery-group h3,
html[data-theme="dark-contrast"] .icon-gallery-group h3{
  color:var(--theme-muted) !important;
}

html[data-theme="dark"] .icon-gallery-item,
html[data-theme="dark-contrast"] .icon-gallery-item{
  background:var(--theme-surface-2) !important;
  color:var(--theme-text-2) !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .icon-gallery-item:hover,
html[data-theme="dark-contrast"] .icon-gallery-item:hover{
  background:var(--theme-hover) !important;
  color:var(--theme-accent) !important;
  border-color:var(--theme-accent) !important;
}

html[data-theme="dark"] .icon-gallery-item.selected,
html[data-theme="dark-contrast"] .icon-gallery-item.selected{
  background:var(--theme-accent-soft) !important;
  color:var(--theme-accent) !important;
  border-color:var(--theme-accent) !important;
}

/* Papierkorb */
html[data-theme="dark"] .trash-row,
html[data-theme="dark-contrast"] .trash-row{
  background:var(--theme-surface) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .trash-row strong,
html[data-theme="dark-contrast"] .trash-row strong{
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .trash-row span,
html[data-theme="dark-contrast"] .trash-row span{
  color:var(--theme-muted) !important;
}

/* Unterseiten-Karten / leere Verwaltungsseiten */
html[data-theme="dark"] .subpage-card,
html[data-theme="dark-contrast"] .subpage-card,
html[data-theme="dark"] .wide-empty,
html[data-theme="dark-contrast"] .wide-empty,
html[data-theme="dark"] .coming-panel,
html[data-theme="dark-contrast"] .coming-panel{
  background:var(--theme-surface) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .subpage-card:hover,
html[data-theme="dark-contrast"] .subpage-card:hover{
  background:var(--theme-hover) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .subpage-card-icon,
html[data-theme="dark-contrast"] .subpage-card-icon{
  background:var(--theme-accent-soft) !important;
  color:var(--theme-accent) !important;
}

html[data-theme="dark"] .subpage-card-main strong,
html[data-theme="dark-contrast"] .subpage-card-main strong,
html[data-theme="dark"] .wide-empty h3,
html[data-theme="dark-contrast"] .wide-empty h3,
html[data-theme="dark"] .coming-panel h2,
html[data-theme="dark-contrast"] .coming-panel h2{
  color:var(--theme-text) !important;
}

html[data-theme="dark"] .subpage-card-main span,
html[data-theme="dark-contrast"] .subpage-card-main span{
  color:var(--theme-muted) !important;
}

/* Filterpanel / Sortierung */
html[data-theme="dark"] .filter-panel,
html[data-theme="dark-contrast"] .filter-panel{
  background:var(--theme-surface) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line) !important;
}

html[data-theme="dark"] .compact-select,
html[data-theme="dark-contrast"] .compact-select,
html[data-theme="dark"] .filter-grid select,
html[data-theme="dark-contrast"] .filter-grid select,
html[data-theme="dark"] .filter-grid input,
html[data-theme="dark-contrast"] .filter-grid input{
  background:var(--theme-input) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line-strong) !important;
}

/* Verlauf / Notizen der Dokumentdetailansicht */
html[data-theme="dark"] .notes-panel textarea,
html[data-theme="dark-contrast"] .notes-panel textarea{
  background:var(--theme-input) !important;
  color:var(--theme-text) !important;
  border-color:var(--theme-line-strong) !important;
}

html[data-theme="dark"] .history-item span,
html[data-theme="dark-contrast"] .history-item span,
html[data-theme="dark"] .tab-empty,
html[data-theme="dark-contrast"] .tab-empty,
html[data-theme="dark"] .tab-loading,
html[data-theme="dark-contrast"] .tab-loading{
  color:var(--theme-muted) !important;
}

/* v0.14.2 – Dokumenttypen / Filter */
.management-row .btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}
html[data-theme="dark"] .management-row .btn:disabled,
html[data-theme="dark-contrast"] .management-row .btn:disabled{
  color:var(--theme-muted) !important;
}


/* ========================================================
   v0.14.3 – Portal-Zoom
   ======================================================== */

/*
 * CSS zoom ist hier absichtlich gewählt:
 * Anders als nur font-size werden damit auch feste px-Abstände,
 * Buttons, Icons, Karten und die beiden Apps proportional skaliert.
 * Der Browser selbst bleibt dabei auf 100 %.
 */
html[data-portal-zoom="90"] .app-shell{zoom:.90}
html[data-portal-zoom="100"] .app-shell{zoom:1}
html[data-portal-zoom="110"] .app-shell{zoom:1.10}
html[data-portal-zoom="120"] .app-shell{zoom:1.20}
html[data-portal-zoom="125"] .app-shell{zoom:1.25}

/* Login/öffentliche Freigaben bleiben bewusst bei Browsergröße,
   da die Zoom-Einstellung eine angemeldete Benutzerpräferenz ist. */

.appearance-zoom-section{
  margin-top:22px;
  padding-top:20px;
  border-top:1px solid var(--theme-line);
}

.appearance-zoom-options{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:9px;
  margin-top:12px;
}

.appearance-zoom-option{
  position:relative;
  min-height:62px;
  padding:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  border:2px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-surface-2);
  cursor:pointer;
  transition:.15s ease;
}

.appearance-zoom-option>input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.appearance-zoom-option strong{
  font-size:12px;
  color:var(--theme-text);
}

.appearance-zoom-option small{
  font-size:8px;
  color:var(--theme-accent);
  font-weight:700;
}

.appearance-zoom-option:hover{
  border-color:var(--theme-line-strong);
}

.appearance-zoom-option.selected{
  border-color:var(--theme-accent);
  background:var(--theme-accent-soft);
}

.appearance-zoom-preview{
  margin-top:10px;
  padding:9px 11px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border:1px solid var(--theme-line);
  border-radius:8px;
  background:var(--theme-surface-2);
}

.appearance-zoom-preview span{
  font-size:9px;
  color:var(--theme-muted);
}

.appearance-zoom-preview strong{
  font-size:11px;
  color:var(--theme-text);
}

@media(max-width:760px){
  .appearance-zoom-options{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:460px){
  .appearance-zoom-options{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/*
 * Auf sehr schmalen Smartphones werden hohe Zoomstufen begrenzt,
 * damit das Portal nicht horizontal aus dem Viewport läuft.
 * 110 % bleibt erhalten; 120/125 % werden dort auf 110 % begrenzt.
 */
@media(max-width:600px){
  html[data-portal-zoom="120"] .app-shell,
  html[data-portal-zoom="125"] .app-shell{
    zoom:1.10;
  }
}


/* v0.14.4 – Rechnungen & Erinnerungen */
.invoice-status-badge{display:inline-flex;align-items:center;width:max-content;min-height:21px;padding:3px 7px;border:1px solid;border-radius:999px;font-size:9px;line-height:1;font-weight:750;white-space:nowrap}
.invoice-status-badge.paid{background:#edf9f1;border-color:#c9e8d3;color:#28764a}
.invoice-status-badge.open{background:#fff8e9;border-color:#ead9ae;color:#8a6a21}
.invoice-status-badge.due-soon{background:#fff1df;border-color:#ebc88e;color:#9b5d18}
.invoice-status-badge.overdue{background:#fff0f0;border-color:#ebcaca;color:#ac4545}

.invoice-fields{margin:11px 0;padding:11px;border:1px solid var(--line);border-radius:9px;background:#f8fafc}
.invoice-fields.hidden{display:none!important}
.invoice-fields-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.invoice-fields-head>strong{font-size:11px;color:#344152}
.invoice-paid-toggle{min-height:38px;display:flex;align-items:center;gap:9px;cursor:pointer}
.invoice-paid-toggle>input{position:absolute;opacity:0;pointer-events:none}
.invoice-paid-toggle>strong{font-size:10px;color:#526073}
.invoice-paid-switch{width:34px;height:19px;flex:0 0 auto;padding:2px;border-radius:999px;background:#d8dee7;transition:.15s ease}
.invoice-paid-switch::before{content:"";display:block;width:15px;height:15px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.18);transition:.15s ease}
.invoice-paid-toggle>input:checked + .invoice-paid-switch{background:#3c8c5d}
.invoice-paid-toggle>input:checked + .invoice-paid-switch::before{transform:translateX(15px)}

.reminders-page{display:flex;flex-direction:column;gap:15px}
.reminder-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.reminder-summary>div{padding:12px 13px;border:1px solid var(--line);border-radius:10px;background:#fff}
.reminder-summary span{display:block;margin-bottom:3px;font-size:10px;color:var(--muted)}
.reminder-summary strong{font-size:18px;color:#344152}
.reminder-summary .danger{border-color:#e8c6c6;background:#fff7f7}
.reminder-summary .danger strong{color:#ae4444}
.reminder-summary .warning{border-color:#ecd5ab;background:#fffaf0}
.reminder-summary .warning strong{color:#95621e}
.reminder-section{border:1px solid var(--line);border-radius:11px;overflow:hidden;background:#fff}
.reminder-section-head{min-height:44px;padding:10px 13px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:#fafbfc}
.reminder-section-head h2{margin:0;font-size:13px;color:#354255}
.reminder-section-head>span{min-width:24px;height:24px;display:grid;place-items:center;border-radius:999px;background:#edf1f6;color:#657286;font-size:9px;font-weight:700}
.reminder-list{padding:0 12px}
.reminder-invoice-row{min-height:58px;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid #edf0f3}
.reminder-invoice-row:last-child{border-bottom:0}
.reminder-invoice-main{min-width:0;display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none}
.reminder-invoice-icon{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border:1px solid #dfe7f2;border-radius:8px;background:#f3f7fc;color:#4f73a4}
.reminder-invoice-copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.reminder-invoice-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:#344152}
.reminder-invoice-copy small{font-size:9px;color:#85909f}
.reminder-invoice-row form{margin:0}
.reminder-empty p{color:var(--muted);font-size:10px}

html[data-theme="dark"] .invoice-fields,html[data-theme="dark-contrast"] .invoice-fields,
html[data-theme="dark"] .reminder-summary>div,html[data-theme="dark-contrast"] .reminder-summary>div,
html[data-theme="dark"] .reminder-section,html[data-theme="dark-contrast"] .reminder-section{background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] .reminder-section-head,html[data-theme="dark-contrast"] .reminder-section-head{background:var(--theme-surface-2)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] .invoice-fields-head>strong,html[data-theme="dark-contrast"] .invoice-fields-head>strong,
html[data-theme="dark"] .invoice-paid-toggle>strong,html[data-theme="dark-contrast"] .invoice-paid-toggle>strong,
html[data-theme="dark"] .reminder-summary strong,html[data-theme="dark-contrast"] .reminder-summary strong,
html[data-theme="dark"] .reminder-section-head h2,html[data-theme="dark-contrast"] .reminder-section-head h2,
html[data-theme="dark"] .reminder-invoice-copy strong,html[data-theme="dark-contrast"] .reminder-invoice-copy strong{color:var(--theme-text)!important}
html[data-theme="dark"] .reminder-invoice-row,html[data-theme="dark-contrast"] .reminder-invoice-row{border-color:var(--theme-line)!important}
html[data-theme="dark"] .invoice-status-badge.paid,html[data-theme="dark-contrast"] .invoice-status-badge.paid{background:#203b2b!important;border-color:#355d46!important;color:#8ed7aa!important}
html[data-theme="dark"] .invoice-status-badge.open,html[data-theme="dark-contrast"] .invoice-status-badge.open,
html[data-theme="dark"] .invoice-status-badge.due-soon,html[data-theme="dark-contrast"] .invoice-status-badge.due-soon{background:#493b22!important;border-color:#66542f!important;color:#f0ca79!important}
html[data-theme="dark"] .invoice-status-badge.overdue,html[data-theme="dark-contrast"] .invoice-status-badge.overdue{background:#482829!important;border-color:#694044!important;color:#f2a0a5!important}

@media(max-width:760px){.reminder-summary{grid-template-columns:1fr 1fr}.reminder-invoice-row{grid-template-columns:minmax(0,1fr) auto}.reminder-invoice-row form{grid-column:1/-1;display:flex;justify-content:flex-end}}
@media(max-width:460px){.reminder-summary{grid-template-columns:1fr}.reminder-invoice-row{grid-template-columns:1fr;align-items:start}.reminder-invoice-row form{grid-column:auto;justify-content:flex-start}}


/* ========================================================
   v0.14.5 – Push / NTFY
   ======================================================== */
.push-settings-status{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin-top:14px;
}
.push-settings-status>div{
  padding:11px 12px;
  border:1px solid var(--theme-line);
  border-radius:9px;
  background:var(--theme-surface-2);
}
.push-settings-status span{
  display:block;
  margin-bottom:4px;
  color:var(--theme-muted);
  font-size:9px;
}
.push-settings-status strong{
  color:var(--theme-text);
  font-size:12px;
}
.push-cron-info code{
  display:block;
  margin-top:12px;
  padding:11px 12px;
  overflow:auto;
  border:1px solid var(--theme-line);
  border-radius:8px;
  background:var(--theme-surface-2);
  color:var(--theme-text-2);
  font-size:10px;
  white-space:nowrap;
}
@media(max-width:700px){
  .push-settings-status{grid-template-columns:1fr}
}


/* v0.14.6 – E-Mail-Empfänger für Rechnungs-Erinnerungen */
.notification-mail-card{margin-top:2px}
.notification-user-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  margin-top:11px;
}
.notification-user-option{
  position:relative;
  min-width:0;
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  align-items:center;
  gap:9px;
  padding:10px 11px;
  border:1px solid var(--theme-line);
  border-radius:9px;
  background:var(--theme-surface-2);
  cursor:pointer;
}
.notification-user-option>input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.notification-user-check{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border:1px solid var(--theme-line-strong);
  border-radius:6px;
  background:var(--theme-input);
  color:transparent;
  font-size:10px;
  font-weight:800;
}
.notification-user-option>input:checked + .notification-user-check{
  border-color:var(--theme-accent);
  background:var(--theme-accent);
  color:#fff;
}
.notification-user-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.notification-user-copy strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--theme-text);
  font-size:10px;
}
.notification-user-copy small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--theme-muted);
  font-size:8.5px;
}
@media(max-width:700px){
  .notification-user-grid{grid-template-columns:1fr}
}

/* v0.14.8 – E-Mail-Import */
.email-import-log{margin-top:14px;border:1px solid var(--theme-line);border-radius:9px;overflow:hidden}
.email-import-log>div{display:grid;grid-template-columns:minmax(180px,1fr) minmax(150px,.8fr) auto auto;gap:10px;align-items:center;padding:9px 11px;border-bottom:1px solid var(--theme-line);background:var(--theme-surface)}
.email-import-log>div:last-child{border-bottom:0}.email-import-log strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--theme-text);font-size:10px}.email-import-log span{color:var(--theme-muted);font-size:9px}
@media(max-width:760px){.email-import-log>div{grid-template-columns:1fr auto}.email-import-log>div span:nth-of-type(1){grid-column:1/-1}}


/* ========================================================
   v0.14.11 – Neue Dokumentübersicht
   ======================================================== */

.documents-page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  padding:18px 20px 14px;
}

.documents-page-title{
  min-width:0;
}

.documents-page-title h1{
  margin:0;
  color:var(--theme-text);
  font-size:20px;
  line-height:1.15;
  font-weight:760;
}

.documents-page-title p{
  margin:5px 0 0;
  color:var(--theme-muted);
  font-size:10px;
  line-height:1.4;
}

.documents-page-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.documents-page-actions .inline-sort-form{
  margin:0;
}

.documents-page-actions .compact-select{
  min-width:138px;
  height:36px;
}

.documents-page-actions .btn{
  min-height:36px;
  border-radius:8px;
}

.documents-filter-button{
  gap:6px;
}

/* Hauptkarte */
.documents-table-card{
  margin:0 20px 20px;
  overflow:visible;
  border:1px solid var(--theme-line);
  border-radius:12px;
  background:var(--theme-surface);
  box-shadow:var(--theme-shadow);
}

.documents-table-scroll{
  width:100%;
  overflow-x:auto;
  border-radius:12px 12px 0 0;
}

.documents-table{
  width:100%;
  min-width:920px;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  background:transparent;
}

.documents-table thead th{
  height:42px;
  padding:9px 11px;
  border-bottom:1px solid var(--theme-line);
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:9px;
  font-weight:720;
  text-align:left;
  vertical-align:middle;
}

.documents-table thead th:first-child{
  border-top-left-radius:11px;
}

.documents-table thead th:last-child{
  border-top-right-radius:11px;
}

.documents-table tbody td{
  height:72px;
  padding:9px 11px;
  border-bottom:1px solid var(--theme-line);
  background:var(--theme-surface);
  color:var(--theme-text-2);
  vertical-align:middle;
}

.documents-table tbody tr:last-child td{
  border-bottom:0;
}

.documents-table tbody tr{
  transition:background .12s ease;
}

.documents-table tbody tr:hover td{
  background:var(--theme-hover);
}

.documents-col-type{
  width:64px;
}

.documents-col-actions{
  width:142px;
  text-align:right !important;
}

.documents-table th:nth-child(2){width:25%}
.documents-table th:nth-child(3){width:29%}
.documents-table th:nth-child(4){width:15%}
.documents-table th:nth-child(5){width:12%}
.documents-table th:nth-child(6){width:9%}

/* Dateityp */
.documents-file-type{
  width:39px;
  height:48px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  border:1px solid;
  border-radius:8px;
  font-weight:750;
}

.documents-file-type.pdf{
  border-color:#ffd9dc;
  background:#fff1f2;
  color:#df3e48;
}

.documents-file-type.image{
  border-color:#d8e9ff;
  background:#eff6ff;
  color:#3977c7;
}

.documents-file-glyph{
  height:17px;
  display:grid;
  place-items:center;
  font-size:16px;
  line-height:1;
}

.documents-file-type strong{
  font-size:8px;
  letter-spacing:.02em;
}

/* Dokument */
.documents-document-cell{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
}

.documents-document-title{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--theme-text);
  font-size:11px;
  font-weight:760;
  text-decoration:none;
}

.documents-document-title:hover{
  color:var(--theme-accent);
}

.documents-document-subtitle{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--theme-muted);
  font-size:9px;
}

.documents-document-mobile-meta{
  display:none;
  color:var(--theme-muted);
  font-size:8.5px;
}

/* Kategorien / Tags */
.documents-tags-cell{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px;
}

.documents-table .tag-pill{
  min-height:21px;
  display:inline-flex;
  align-items:center;
  padding:3px 8px;
  border:1px solid transparent;
  border-radius:999px;
  background:#edf4ff;
  color:#3168ac;
  font-size:8px;
  font-weight:680;
  line-height:1;
  text-decoration:none;
}

.documents-table .tag-pill.category{
  background:#edf8f0;
  color:#357951;
}

.documents-muted{
  color:var(--theme-muted);
  font-size:10px;
}

/* Quelle */
.documents-source-cell{
  display:flex;
  align-items:center;
  gap:8px;
}

.documents-source-icon{
  width:23px;
  height:23px;
  flex:0 0 23px;
  display:grid;
  place-items:center;
  border-radius:6px;
  font-size:13px;
  font-weight:700;
}

.documents-source-cell.email .documents-source-icon{
  background:#edf4ff;
  color:#2f6fda;
}

.documents-source-cell.upload .documents-source-icon{
  background:#f2f5f9;
  color:#68768a;
}

.documents-source-cell>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.documents-source-cell strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--theme-text-2);
  font-size:9px;
  font-weight:650;
}

.documents-source-cell small{
  color:var(--theme-muted);
  font-size:8px;
}

/* Datum / Größe */
.documents-date-cell{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.documents-date-cell strong{
  color:var(--theme-text);
  font-size:9.5px;
  font-weight:720;
}

.documents-date-cell small{
  color:var(--theme-muted);
  font-size:8px;
}

.documents-size-cell{
  color:var(--theme-muted) !important;
  font-size:9px;
  white-space:nowrap;
}

/* Aktionen */
.documents-row-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}

.documents-action-button{
  width:34px;
  height:34px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid var(--theme-line-strong);
  border-radius:7px;
  background:var(--theme-input);
  color:var(--theme-text-2);
  text-decoration:none;
  cursor:pointer;
  transition:.12s ease;
}

.documents-action-button:hover{
  border-color:var(--theme-accent);
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
}

.documents-action-button .menu-icon{
  width:15px;
  height:15px;
}

.documents-action-symbol{
  font-size:18px;
  line-height:1;
  transform:translateY(-1px);
}

.documents-action-more{
  font-size:18px;
  line-height:1;
}

.documents-row-actions .row-menu-wrap{
  position:relative;
}

.documents-row-actions .row-menu{
  right:0;
  top:40px;
  z-index:80;
}

/* Footer / Pagination */
.documents-table-footer{
  min-height:52px;
  padding:9px 12px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:12px;
  border-top:1px solid var(--theme-line);
  background:var(--theme-surface);
}

.documents-result-count{
  color:var(--theme-muted);
  font-size:9px;
}

.documents-pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
}

.documents-page-button{
  min-width:30px;
  height:30px;
  padding:0 7px;
  display:grid;
  place-items:center;
  border:1px solid var(--theme-line-strong);
  border-radius:6px;
  background:var(--theme-input);
  color:var(--theme-text-2);
  font-size:9px;
  font-weight:650;
  text-decoration:none;
}

.documents-page-button:hover:not(.disabled),
.documents-page-button.active{
  border-color:var(--theme-accent);
  background:var(--theme-accent);
  color:#fff;
}

.documents-page-button.disabled{
  opacity:.38;
  pointer-events:none;
}

.documents-page-size{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  color:var(--theme-muted);
  font-size:9px;
}

.documents-page-size select{
  width:64px;
  height:30px;
  padding:0 7px;
  border:1px solid var(--theme-line-strong);
  border-radius:6px;
  background:var(--theme-input);
  color:var(--theme-text);
  font-size:9px;
}

/* Legende */
.documents-table-legend{
  min-height:42px;
  padding:8px 12px;
  display:flex;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
  border-top:1px solid var(--theme-line);
  border-radius:0 0 11px 11px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:8.5px;
}

.documents-table-legend>span{
  display:flex;
  align-items:center;
  gap:6px;
}

.legend-file{
  min-width:25px;
  padding:3px 4px;
  border-radius:5px;
  background:#fff0f1;
  color:#df3e48;
  font-size:7px;
  text-align:center;
}

.legend-upload,
.legend-mail{
  font-size:14px;
  font-weight:700;
}

.legend-upload{color:#69778b}
.legend-mail{color:#2f6fda}

.documents-legend-categories{
  margin-left:auto;
}

.documents-table-legend .tag-pill{
  min-height:19px;
  padding:3px 7px;
}

/* Leerer Zustand */
.documents-table-empty{
  min-height:260px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:32px;
  background:transparent;
}

.documents-table-empty p{
  color:var(--theme-muted);
  font-size:9px;
}

/* Dark Mode */
html[data-theme="dark"] .documents-file-type.pdf,
html[data-theme="dark-contrast"] .documents-file-type.pdf{
  border-color:#654044;
  background:#402629;
  color:#ff9ea5;
}

html[data-theme="dark"] .documents-file-type.image,
html[data-theme="dark-contrast"] .documents-file-type.image{
  border-color:#36516f;
  background:#223549;
  color:#8ec5ff;
}

html[data-theme="dark"] .documents-table .tag-pill,
html[data-theme="dark-contrast"] .documents-table .tag-pill{
  background:#203754;
  color:#9bc3ff;
  border-color:#2b4668;
}

html[data-theme="dark"] .documents-table .tag-pill.category,
html[data-theme="dark-contrast"] .documents-table .tag-pill.category{
  background:#213d2c;
  color:#92d5a8;
  border-color:#315743;
}

html[data-theme="dark"] .documents-source-cell.email .documents-source-icon,
html[data-theme="dark-contrast"] .documents-source-cell.email .documents-source-icon{
  background:#203754;
  color:#8bbcff;
}

html[data-theme="dark"] .documents-source-cell.upload .documents-source-icon,
html[data-theme="dark-contrast"] .documents-source-cell.upload .documents-source-icon{
  background:var(--theme-surface-3);
  color:var(--theme-text-2);
}

html[data-theme="dark"] .legend-file,
html[data-theme="dark-contrast"] .legend-file{
  background:#402629;
  color:#ff9ea5;
}

/* Tablet */
@media(max-width:1120px){
  .documents-page-head{
    align-items:flex-start;
  }

  .documents-page-actions{
    max-width:520px;
  }

  .documents-table th:nth-child(3){width:25%}
  .documents-table th:nth-child(4){width:17%}
}

/* Smartphone: Tabellenzeile wird zu kompakter Dokumentkarte */
@media(max-width:760px){
  .documents-page-head{
    padding:14px 13px 10px;
    flex-direction:column;
    align-items:stretch;
  }

  .documents-page-title h1{
    font-size:18px;
  }

  .documents-page-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr auto;
  }

  .documents-page-actions .inline-sort-form{
    grid-column:1/-1;
  }

  .documents-page-actions .compact-select{
    width:100%;
  }

  .documents-page-actions .upload-main{
    min-width:0;
  }

  .documents-table-card{
    margin:0 10px 14px;
    border-radius:10px;
  }

  .documents-table-scroll{
    overflow:visible;
  }

  .documents-table{
    min-width:0;
    display:block;
  }

  .documents-table thead{
    display:none;
  }

  .documents-table tbody{
    display:flex;
    flex-direction:column;
    padding:8px;
    gap:8px;
  }

  .documents-table-row{
    position:relative;
    min-height:94px;
    display:block;
    padding:11px 48px 11px 58px;
    border:1px solid var(--theme-line);
    border-radius:9px;
    background:var(--theme-surface);
  }

  .documents-table tbody tr:hover td{
    background:transparent;
  }

  .documents-table tbody td{
    height:auto;
    display:block;
    padding:0;
    border:0;
    background:transparent;
  }

  .documents-table tbody .documents-col-type{
    position:absolute;
    left:10px;
    top:11px;
    width:39px;
  }

  .documents-file-type{
    width:39px;
    height:48px;
  }

  .documents-table tbody td:nth-child(2){
    min-height:49px;
  }

  .documents-document-title{
    padding-right:4px;
    font-size:10.5px;
  }

  .documents-document-mobile-meta{
    display:block;
  }

  .documents-table tbody td:nth-child(3){
    margin-top:6px;
  }

  .documents-table tbody td:nth-child(4),
  .documents-table tbody td:nth-child(5),
  .documents-table tbody td:nth-child(6){
    display:none;
  }

  .documents-col-actions{
    position:absolute;
    right:8px;
    top:10px;
    width:34px !important;
  }

  .documents-row-actions{
    display:block;
  }

  .documents-row-actions>a{
    display:none;
  }

  .documents-row-actions .documents-action-button{
    width:32px;
    height:32px;
  }

  .documents-row-actions .row-menu{
    top:37px;
    right:0;
    min-width:190px;
  }

  .documents-table-footer{
    grid-template-columns:1fr;
    justify-items:center;
    gap:9px;
    padding:12px;
  }

  .documents-result-count{
    order:2;
  }

  .documents-pagination{
    order:1;
  }

  .documents-page-size{
    order:3;
    justify-content:center;
  }

  .documents-table-legend{
    display:none;
  }
}


/* ========================================================
   v0.14.12 – Dokumenttabellen-Icons
   Menü-Icons bleiben unverändert.
   ======================================================== */

.documents-file-type{
  width:43px;
  height:50px;
  gap:2px;
}

.documents-file-glyph{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
}

.documents-type-svg{
  width:22px;
  height:22px;
  stroke-width:1.9;
}

.documents-file-type.pdf{
  border-color:#ffd4d7;
  background:#fff0f1;
  color:#e23842;
}

.documents-file-type.image{
  border-color:#d7e8ff;
  background:#eff6ff;
  color:#3478cf;
}

.documents-file-type strong{
  font-size:8px;
  font-weight:800;
  letter-spacing:.015em;
}

.documents-source-icon{
  width:25px;
  height:25px;
  background:transparent !important;
}

.documents-source-svg{
  width:17px;
  height:17px;
  stroke-width:1.8;
}

.documents-source-cell.email .documents-source-icon{
  color:#2f73df;
}

.documents-source-cell.upload .documents-source-icon{
  color:#61728a;
}

.documents-action-svg{
  width:16px;
  height:16px;
  stroke-width:1.8;
}

.documents-action-button{
  color:var(--theme-text-2);
}

.documents-action-button .documents-action-svg{
  pointer-events:none;
}

.documents-row-actions .documents-action-button:first-child .menu-icon{
  width:16px;
  height:16px;
  stroke-width:1.8;
}

/* Die bisher verwendeten Textsymbol-Klassen werden nicht mehr gebraucht. */
.documents-action-symbol,
.documents-action-more{
  display:none;
}

.legend-icon{
  width:19px;
  height:19px;
  display:grid;
  place-items:center;
  color:#66758b;
}

.legend-icon.mail{
  color:#2f73df;
}

.documents-legend-svg{
  width:15px;
  height:15px;
  stroke-width:1.8;
}

html[data-theme="dark"] .documents-file-type.pdf,
html[data-theme="dark-contrast"] .documents-file-type.pdf{
  border-color:#693c42;
  background:#48272b;
  color:#ff9ba3;
}

html[data-theme="dark"] .documents-file-type.image,
html[data-theme="dark-contrast"] .documents-file-type.image{
  border-color:#355576;
  background:#22364d;
  color:#8cc2ff;
}

html[data-theme="dark"] .documents-source-cell.email .documents-source-icon,
html[data-theme="dark-contrast"] .documents-source-cell.email .documents-source-icon{
  color:#79aefc;
}

html[data-theme="dark"] .documents-source-cell.upload .documents-source-icon,
html[data-theme="dark-contrast"] .documents-source-cell.upload .documents-source-icon{
  color:var(--theme-text-2);
}

html[data-theme="dark"] .legend-icon.mail,
html[data-theme="dark-contrast"] .legend-icon.mail{
  color:#79aefc;
}

@media(max-width:760px){
  .documents-file-type{
    width:43px;
    height:50px;
  }

  .documents-table tbody .documents-col-type{
    width:43px;
  }

  .documents-table-row{
    padding-left:62px;
  }
}


/* ========================================================
   v0.14.13 – Aktions-Icons exakt im Tabellenstil
   ======================================================== */

.documents-row-actions{
  gap:7px;
}

.documents-action-button{
  width:36px;
  height:36px;
  border:1px solid var(--theme-line-strong);
  border-radius:8px;
  background:var(--theme-surface);
  color:#52637a;
  box-shadow:none;
}

.documents-action-button:hover{
  border-color:#b8c7da;
  background:var(--theme-surface-2);
  color:#315f9b;
}

.documents-action-svg{
  width:17px;
  height:17px;
  display:block;
  stroke-width:1.75;
}

.documents-row-actions .row-menu-button .documents-action-svg{
  width:18px;
  height:18px;
}

html[data-theme="dark"] .documents-action-button,
html[data-theme="dark-contrast"] .documents-action-button{
  background:var(--theme-surface);
  border-color:var(--theme-line-strong);
  color:#b8c4d4;
}

html[data-theme="dark"] .documents-action-button:hover,
html[data-theme="dark-contrast"] .documents-action-button:hover{
  background:var(--theme-surface-2);
  border-color:#52657c;
  color:#8ebaff;
}

/* Alte Sonderregel vom generischen Menü-Auge neutralisieren */
.documents-row-actions .documents-action-button:first-child .menu-icon{
  width:auto;
  height:auto;
}

@media(max-width:760px){
  .documents-row-actions .documents-action-button{
    width:34px;
    height:34px;
  }
}


/* ========================================================
   v0.14.14 – Aktionsmenü überdeckt Nachbarzeilen vollständig
   ======================================================== */

/*
 * Ursache:
 * Die Aktionsbuttons der nachfolgenden Tabellenzeilen wurden oberhalb des
 * geöffneten Dropdowns gezeichnet. Das Dropdown erhält deshalb eine eigene
 * hohe Stacking-Ebene; die aktive Tabellenzeile wird ebenfalls angehoben.
 */
.documents-table-row{
  position:relative;
  z-index:1;
}

.documents-table-row:has(.row-menu.open),
.documents-table-row:has(.row-menu.is-open){
  z-index:200;
}

.documents-row-actions .row-menu-wrap{
  position:relative;
  z-index:1;
}

.documents-row-actions .row-menu{
  z-index:1000;
  background:var(--theme-surface);
  opacity:1;
  isolation:isolate;
  box-shadow:0 12px 32px rgba(15,23,42,.18);
}

/*
 * app.js schaltet das Menü je nach bestehender Implementierung entweder
 * direkt per display oder über eine Klasse. Sobald das Menü sichtbar ist,
 * liegt sein kompletter Bereich deckend über allen nachfolgenden Zeilen.
 */
.documents-row-actions .row-menu[style*="display: block"],
.documents-row-actions .row-menu[style*="display:block"],
.documents-row-actions .row-menu.open,
.documents-row-actions .row-menu.is-open{
  z-index:1000;
}

html[data-theme="dark"] .documents-row-actions .row-menu,
html[data-theme="dark-contrast"] .documents-row-actions .row-menu{
  background:var(--theme-surface);
  box-shadow:0 14px 34px rgba(0,0,0,.42);
}

/* Browser ohne :has(): geöffneter Wrapper wird per JS zusätzlich markiert. */
.documents-table-row.menu-is-open{
  z-index:200;
}

.documents-table-row.menu-is-open .row-menu-wrap{
  z-index:1000;
}


/* ========================================================
   v0.14.15 – Floating Aktionsmenü
   ======================================================== */

/*
 * Das geöffnete Menü wird per JavaScript direkt unter <body> verschoben.
 * Dadurch kann weder overflow der Tabelle noch der z-index einer anderen
 * Tabellenzeile das Menü abschneiden oder überdecken.
 */
.row-menu.document-floating-menu{
  position:fixed !important;
  right:auto !important;
  bottom:auto !important;
  width:220px;
  max-width:calc(100vw - 20px);
  display:block !important;
  z-index:2147483000 !important;
  margin:0;
  padding:7px;
  overflow:visible;
  border:1px solid var(--theme-line-strong);
  border-radius:10px;
  background:var(--theme-surface) !important;
  color:var(--theme-text-2);
  opacity:1 !important;
  isolation:isolate;
  box-shadow:0 14px 36px rgba(25,38,58,.20);
}

.row-menu.document-floating-menu>a,
.row-menu.document-floating-menu>button,
.row-menu.document-floating-menu form button{
  width:100%;
  min-height:36px;
  display:flex !important;
  align-items:center;
  gap:10px;
  padding:8px 9px;
  border:0;
  border-radius:7px;
  background:transparent !important;
  color:var(--theme-text-2);
  font-size:10px;
  line-height:1.25;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
}

.row-menu.document-floating-menu>a:hover,
.row-menu.document-floating-menu>button:hover,
.row-menu.document-floating-menu form button:hover{
  background:var(--theme-hover) !important;
  color:var(--theme-text);
}

.row-menu.document-floating-menu form{
  width:100%;
  margin:0;
}

.row-menu-action-icon{
  width:16px;
  height:16px;
  flex:0 0 16px;
  stroke-width:1.8;
}

.row-menu.document-floating-menu .danger-text{
  margin-top:4px;
  padding-top:9px;
  border-top:1px solid var(--theme-line) !important;
  border-radius:0 0 7px 7px;
  color:#c84646 !important;
}

.row-menu.document-floating-menu .danger-text:hover{
  background:rgba(200,70,70,.08) !important;
  color:#d13e3e !important;
}

/* Portal-Zoom auch für das an body verschobene Dropdown beibehalten. */
html[data-portal-zoom="90"] .row-menu.document-floating-menu{zoom:.90}
html[data-portal-zoom="100"] .row-menu.document-floating-menu{zoom:1}
html[data-portal-zoom="110"] .row-menu.document-floating-menu{zoom:1.10}
html[data-portal-zoom="120"] .row-menu.document-floating-menu{zoom:1.20}
html[data-portal-zoom="125"] .row-menu.document-floating-menu{zoom:1.25}

html[data-theme="dark"] .row-menu.document-floating-menu,
html[data-theme="dark-contrast"] .row-menu.document-floating-menu{
  background:var(--theme-surface) !important;
  border-color:var(--theme-line-strong);
  box-shadow:0 16px 40px rgba(0,0,0,.48);
}

html[data-theme="dark"] .row-menu.document-floating-menu .danger-text,
html[data-theme="dark-contrast"] .row-menu.document-floating-menu .danger-text{
  color:#ff858b !important;
}

/*
 * Die alten Tabellen-z-index-Regeln sind für das Floating-Menü nicht mehr
 * erforderlich. Diese Werte neutralisieren sie, ohne andere Dropdowns zu
 * verändern.
 */
.documents-table-row,
.documents-table-row.menu-is-open,
.documents-table-row:has(.row-menu.open),
.documents-table-row:has(.row-menu.is-open){
  z-index:auto;
}

@media(max-width:600px){
  html[data-portal-zoom="120"] .row-menu.document-floating-menu,
  html[data-portal-zoom="125"] .row-menu.document-floating-menu{
    zoom:1.10;
  }
}


/* ========================================================
   v0.14.16 – Floating-Menü weiter nach links
   ======================================================== */

.row-menu.document-floating-menu{
  width:220px;
}

/*
 * Kleine optische Markierung am rechten oberen Rand.
 * Das Menü selbst bleibt vollständig innerhalb des Viewports.
 */
.row-menu.document-floating-menu::before{
  content:"";
  position:absolute;
  top:-5px;
  right:15px;
  width:9px;
  height:9px;
  border-top:1px solid var(--theme-line-strong);
  border-left:1px solid var(--theme-line-strong);
  background:var(--theme-surface);
  transform:rotate(45deg);
}

html[data-theme="dark"] .row-menu.document-floating-menu::before,
html[data-theme="dark-contrast"] .row-menu.document-floating-menu::before{
  background:var(--theme-surface);
  border-color:var(--theme-line-strong);
}

@media(max-width:760px){
  .row-menu.document-floating-menu{
    width:min(220px,calc(100vw - 20px));
  }

  .row-menu.document-floating-menu::before{
    display:none;
  }
}


/* ========================================================
   v0.14.17 – Floating-Menü Viewport-Korrektur
   ======================================================== */

/*
 * Etwas mehr Abstand zum rechten Fensterrand. Die endgültige Position wird
 * zusätzlich per JavaScript nach dem tatsächlichen Rendern korrigiert.
 */
.row-menu.document-floating-menu{
  max-width:calc(100vw - 28px);
}

/* Anker etwas weiter rechts im Menü, passend zur versetzten Position. */
.row-menu.document-floating-menu::before{
  right:10px;
}


/* ========================================================
   v0.14.18 – Dokumentkopf + Tabellen-Sortierung
   ======================================================== */

/* Auf der Dokumentübersicht übernimmt der lokale Kopf Suche und Aktionen.
   Die globale Desktop-Topbar wird dort deshalb ausgeblendet.
   Mobil bleibt sie für den Menü-Button erhalten. */
@media(min-width:761px){
  .documents-overview-page .global-topbar{
    display:none;
  }
}

.documents-page-head{
  min-height:94px;
  padding:18px 20px 15px;
  align-items:center;
}

.documents-page-title-wrap{
  min-width:0;
  display:flex;
  align-items:center;
  gap:11px;
}

.documents-title-icon{
  width:40px;
  height:40px;
  flex:0 0 40px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#fff6e9;
  color:#f39a18;
}

.documents-title-icon-svg{
  width:22px;
  height:22px;
  stroke-width:1.8;
}

.documents-page-title h1{
  font-size:19px;
  letter-spacing:-.01em;
}

.documents-page-title p{
  margin-top:4px;
  font-size:9.5px;
}

/* Suche rechts im Dokumentkopf */
.documents-local-search{
  position:relative;
  width:210px;
  height:36px;
  display:flex;
  align-items:center;
}

.documents-local-search input{
  width:100%;
  height:100%;
  padding:0 38px 0 12px;
  border:1px solid var(--theme-line-strong);
  border-radius:8px;
  outline:0;
  background:var(--theme-input);
  color:var(--theme-text);
  font-size:10px;
  transition:.15s ease;
}

.documents-local-search input::placeholder{
  color:var(--theme-muted);
}

.documents-local-search input:focus{
  border-color:var(--theme-accent);
  box-shadow:0 0 0 3px var(--theme-accent-soft);
}

.documents-search-submit{
  position:absolute;
  right:4px;
  top:4px;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--theme-text-2);
  cursor:pointer;
}

.documents-search-submit:hover{
  background:var(--theme-hover);
  color:var(--theme-accent);
}

.documents-search-submit svg{
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.documents-filter-button{
  min-width:88px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
}

.documents-filter-icon{
  width:15px;
  height:15px;
  display:grid;
  place-items:center;
}

.documents-filter-icon svg{
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.documents-new-button{
  min-width:142px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
}

.documents-new-plus{
  font-size:15px;
  font-weight:500;
  line-height:1;
}

/* Alte Sortierauswahl im Kopf existiert in v0.14.18 nicht mehr. */
.documents-page-actions .inline-sort-form{
  display:none !important;
}

/* Klickbare Tabellenüberschriften */
.documents-table thead th{
  padding-top:0;
  padding-bottom:0;
}

.documents-sort-heading{
  width:max-content;
  max-width:100%;
  min-height:42px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:var(--theme-muted);
  font-size:9px;
  font-weight:720;
  line-height:1;
  text-decoration:none;
  cursor:pointer;
  user-select:none;
}

.documents-sort-heading:hover,
.documents-sort-heading.active{
  color:var(--theme-text);
}

.documents-sort-heading.active{
  font-weight:800;
}

.documents-sort-arrow{
  position:relative;
  width:10px;
  height:14px;
  flex:0 0 10px;
  opacity:.38;
}

.documents-sort-arrow::before,
.documents-sort-arrow::after{
  content:"";
  position:absolute;
  left:4px;
  width:5px;
  height:5px;
  border-right:1.4px solid currentColor;
  border-bottom:1.4px solid currentColor;
}

.documents-sort-arrow::before{
  top:1px;
  transform:rotate(225deg);
}

.documents-sort-arrow::after{
  bottom:1px;
  transform:rotate(45deg);
}

.documents-sort-heading:hover .documents-sort-arrow{
  opacity:.7;
}

.documents-sort-arrow.asc,
.documents-sort-arrow.desc{
  opacity:1;
  color:var(--theme-accent);
}

.documents-sort-arrow.asc::after{
  display:none;
}

.documents-sort-arrow.asc::before{
  top:4px;
}

.documents-sort-arrow.desc::before{
  display:none;
}

.documents-sort-arrow.desc::after{
  bottom:4px;
}

/* Dark Mode */
html[data-theme="dark"] .documents-title-icon,
html[data-theme="dark-contrast"] .documents-title-icon{
  background:#3b3020;
  color:#ffb34c;
}

html[data-theme="dark"] .documents-local-search input,
html[data-theme="dark-contrast"] .documents-local-search input{
  background:var(--theme-input);
  border-color:var(--theme-line-strong);
  color:var(--theme-text);
}

html[data-theme="dark"] .documents-sort-heading:hover,
html[data-theme="dark"] .documents-sort-heading.active,
html[data-theme="dark-contrast"] .documents-sort-heading:hover,
html[data-theme="dark-contrast"] .documents-sort-heading.active{
  color:var(--theme-text);
}

/* Tablet */
@media(max-width:1080px){
  .documents-page-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .documents-page-actions{
    width:100%;
    justify-content:flex-start;
  }

  .documents-local-search{
    flex:1 1 230px;
    max-width:360px;
  }
}

/* Mobile */
@media(max-width:760px){
  .documents-overview-page .global-topbar{
    display:flex;
  }

  .documents-page-head{
    min-height:0;
    padding:13px 13px 10px;
  }

  .documents-title-icon{
    width:36px;
    height:36px;
    flex-basis:36px;
  }

  .documents-title-icon-svg{
    width:20px;
    height:20px;
  }

  .documents-page-actions{
    display:grid;
    grid-template-columns:1fr auto;
    gap:7px;
  }

  .documents-local-search{
    width:100%;
    max-width:none;
    grid-column:1/-1;
  }

  .documents-filter-button{
    min-width:84px;
  }

  .documents-new-button{
    min-width:0;
  }
}


/* ========================================================
   v0.14.19 – Modulberechtigungen
   ======================================================== */
.user-module-permissions{
  grid-column:1/-1;
  margin:4px 0 0;
  padding:12px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-surface-2);
}
.user-module-permissions legend{
  padding:0 5px;
  color:var(--theme-text);
  font-size:10px;
  font-weight:750;
}
.user-module-permissions>p{
  margin:0 0 10px;
  color:var(--theme-muted);
  font-size:9px;
}
.user-module-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.user-module-grid>label{
  position:relative;
  min-width:0;
  display:flex;
  align-items:flex-start;
  gap:9px;
  padding:10px;
  border:1px solid var(--theme-line);
  border-radius:9px;
  background:var(--theme-surface);
  cursor:pointer;
}
.user-module-grid>label:has(input:checked){
  border-color:var(--theme-accent);
  background:var(--theme-accent-soft);
}
.user-module-grid input{
  margin-top:2px;
  accent-color:var(--theme-accent);
}
.user-module-grid label>span{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.user-module-grid strong{
  color:var(--theme-text);
  font-size:10px;
}
.user-module-grid small{
  color:var(--theme-muted);
  font-size:8.5px;
  line-height:1.35;
}
.user-module-grid .is-admin-fixed{
  opacity:.72;
  cursor:default;
}
.user-module-admin-note{
  color:var(--theme-accent)!important;
}
.user-module-chips{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px;
  margin-top:7px;
}
.user-module-chips span{
  display:inline-flex;
  min-height:20px;
  align-items:center;
  padding:3px 7px;
  border-radius:999px;
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
  font-size:8px;
  font-weight:700;
}
.user-module-chips span.none{
  background:var(--theme-surface-2);
  color:var(--theme-muted);
}
@media(max-width:900px){
  .user-module-grid{grid-template-columns:1fr}
}


/* ========================================================
   v0.14.20 – Dokument-Sichtbarkeit & Aktionsrechte
   ======================================================== */
.user-document-access{
  grid-column:1/-1;
  margin:3px 0 0;
  padding:13px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-surface-2);
}
.user-document-access legend{
  padding:0 5px;
  color:var(--theme-text);
  font-size:10px;
  font-weight:760;
}
.user-document-access>p{
  margin:0 0 11px;
  color:var(--theme-muted);
  font-size:9px;
}
.user-document-scope-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.permission-check-card{
  display:flex;
  align-items:flex-start;
  gap:9px;
  padding:10px;
  border:1px solid var(--theme-line);
  border-radius:9px;
  background:var(--theme-surface);
  cursor:pointer;
}
.permission-check-card:has(input:checked){
  border-color:var(--theme-accent);
  background:var(--theme-accent-soft);
}
.permission-check-card input{
  margin-top:2px;
  accent-color:var(--theme-accent);
}
.permission-check-card>span{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:3px;
}
.permission-check-card strong{
  color:var(--theme-text);
  font-size:10px;
}
.permission-check-card small{
  color:var(--theme-muted);
  font-size:8.5px;
  line-height:1.35;
}
.user-category-permissions,
.user-action-permissions{
  margin-top:12px;
  padding-top:11px;
  border-top:1px solid var(--theme-line);
}
.user-category-permissions>strong,
.user-action-permissions>strong{
  display:block;
  margin-bottom:8px;
  color:var(--theme-text);
  font-size:9.5px;
}
.user-category-grid{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.user-category-grid label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:29px;
  padding:5px 9px;
  border:1px solid var(--theme-line);
  border-radius:7px;
  background:var(--theme-surface);
  color:var(--theme-text-2);
  font-size:9px;
  cursor:pointer;
}
.user-category-grid label:has(input:checked){
  border-color:var(--theme-accent);
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
}
.user-category-grid input{
  accent-color:var(--theme-accent);
}
.user-category-permissions.is-disabled{
  opacity:.45;
}
.user-action-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
}
.permission-check-card.compact{
  padding:9px;
}
.user-document-access.is-admin-fixed{
  opacity:.78;
}
.documents-no-upload [data-open-upload]{
  display:none!important;
}

/* Lesemodus in der Dokumentdetailansicht */
.document-readonly-mode .full-inline-edit:disabled{
  opacity:1;
  cursor:default;
  background:var(--theme-surface-2);
  color:var(--theme-text-2);
}
.document-readonly-mode .metadata-suggestion-editor-actions,
.document-readonly-mode .metadata-suggestion-actions{
  display:none!important;
}
.document-readonly-mode #fullDocumentNote[readonly]{
  background:var(--theme-surface-2);
  color:var(--theme-text-2);
  cursor:default;
}

@media(max-width:900px){
  .user-action-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:620px){
  .user-document-scope-grid,
  .user-action-grid{grid-template-columns:1fr}
}


/* ========================================================
   v0.15.1 – Familien-Portal Branding
   ======================================================== */
.brand-logo{
  width:44px;
  height:44px;
  flex:0 0 44px;
  display:block;
  object-fit:cover;
  border-radius:13px;
  box-shadow:0 7px 18px rgba(31,91,211,.18);
}
.sidebar-top .brand{
  min-width:0;
}
.sidebar-top .brand-text strong{
  font-size:15px;
  line-height:1.18;
}
.sidebar-top .brand-text span{
  margin-top:3px;
  font-size:11px;
}
.auth-brand-logo{
  width:52px;
  height:52px;
  flex-basis:52px;
  border-radius:15px;
}
.auth-brand>div{
  display:flex;
  flex-direction:column;
}
@media(max-width:760px){
  .brand-logo{
    width:40px;
    height:40px;
    flex-basis:40px;
    border-radius:12px;
  }
}


/* ========================================================
   v1.0.0 – Modulares Familien-Portal / App-Startseite
   ======================================================== */
.portal-home-page{
  min-height:100vh;
  background:
    radial-gradient(circle at 10% 0%,rgba(46,108,246,.08),transparent 28rem),
    var(--theme-bg,var(--bg));
}
.portal-home-header{
  min-height:82px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:14px clamp(20px,4vw,58px);
  border-bottom:1px solid var(--theme-line,var(--line));
  background:color-mix(in srgb,var(--theme-surface,#fff) 92%,transparent);
  backdrop-filter:blur(14px);
  position:sticky;
  top:0;
  z-index:20;
}
.portal-home-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.portal-home-brand img{
  width:48px;
  height:48px;
  border-radius:14px;
  object-fit:cover;
  box-shadow:0 7px 18px rgba(31,91,211,.16);
}
.portal-home-brand>div{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.portal-home-brand strong{
  font-size:17px;
  line-height:1.2;
}
.portal-home-brand span{
  margin-top:3px;
  color:var(--theme-muted,var(--muted));
  font-size:12px;
}
.portal-home-user{
  display:flex;
  align-items:center;
  gap:10px;
}
.portal-header-link,
.portal-header-profile,
.portal-header-logout{
  min-height:42px;
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--theme-line,var(--line));
  border-radius:12px;
  padding:7px 11px;
  background:var(--theme-surface,#fff);
  color:var(--theme-text-2,#4f5b6f);
  font-size:13px;
  font-weight:700;
  transition:.16s ease;
}
.portal-header-link:hover,
.portal-header-profile:hover,
.portal-header-logout:hover{
  border-color:color-mix(in srgb,var(--theme-accent,var(--blue)) 34%,var(--theme-line,var(--line)));
  color:var(--theme-accent,var(--blue));
  transform:translateY(-1px);
}
.portal-header-profile .avatar{
  width:29px;
  height:29px;
  font-size:11px;
}
.portal-header-logout{
  width:42px;
  justify-content:center;
  padding:7px;
}
.portal-header-icon{
  width:18px;
  height:18px;
}
.portal-home-main{
  width:min(1240px,calc(100% - 40px));
  margin:0 auto;
  padding:clamp(34px,5vw,70px) 0 70px;
}
.portal-welcome{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  margin-bottom:30px;
}
.portal-eyebrow{
  display:block;
  margin-bottom:8px;
  color:var(--theme-accent,var(--blue));
  font-size:10px;
  font-weight:850;
  letter-spacing:.11em;
}
.portal-welcome h1{
  margin:0;
  color:var(--theme-text,var(--text));
  font-size:clamp(27px,4vw,42px);
  letter-spacing:-.035em;
}
.portal-welcome p{
  margin:8px 0 0;
  color:var(--theme-muted,var(--muted));
  font-size:15px;
}
.portal-app-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}
.portal-app-card{
  position:relative;
  min-height:245px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:24px;
  border:1px solid var(--theme-line,var(--line));
  border-radius:22px;
  background:var(--theme-surface,#fff);
  box-shadow:0 12px 34px rgba(31,48,82,.07);
  overflow:hidden;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
a.portal-app-card:hover{
  transform:translateY(-4px);
  border-color:color-mix(in srgb,var(--theme-accent,var(--blue)) 32%,var(--theme-line,var(--line)));
  box-shadow:0 19px 45px rgba(31,48,82,.12);
}
.portal-app-card::after{
  content:"";
  position:absolute;
  width:145px;
  height:145px;
  right:-46px;
  top:-51px;
  border-radius:50%;
  background:var(--portal-app-glow,rgba(46,108,246,.08));
  pointer-events:none;
}
.portal-app-documents{--portal-app-glow:rgba(46,108,246,.11)}
.portal-app-household{--portal-app-glow:rgba(47,156,102,.11)}
.portal-app-octopus{--portal-app-glow:rgba(242,169,47,.13)}
.portal-app-icon{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  border-radius:17px;
  background:var(--theme-accent-soft,var(--blue2));
  color:var(--theme-accent,var(--blue));
}
.portal-app-household .portal-app-icon{
  background:rgba(46,157,100,.11);
  color:#2a8b5b;
}
.portal-app-octopus .portal-app-icon{
  background:rgba(242,169,47,.14);
  color:#bc7610;
}
.portal-app-icon-svg{
  width:28px;
  height:28px;
}
.portal-app-content{
  margin-top:28px;
}
.portal-app-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.portal-app-title-row h2{
  margin:0;
  color:var(--theme-text,var(--text));
  font-size:20px;
}
.portal-app-arrow{
  color:var(--theme-muted,var(--muted));
  font-size:21px;
  transition:transform .16s ease,color .16s ease;
}
a.portal-app-card:hover .portal-app-arrow{
  transform:translateX(3px);
  color:var(--theme-accent,var(--blue));
}
.portal-app-content>p{
  min-height:44px;
  margin:8px 0 18px;
  color:var(--theme-muted,var(--muted));
  font-size:13px;
  line-height:1.55;
}
.portal-app-meta{
  min-height:24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-top:14px;
  border-top:1px solid var(--theme-line,var(--line));
  color:var(--theme-muted,var(--muted));
  font-size:11px;
}
.portal-app-meta strong{
  padding:4px 8px;
  border-radius:999px;
  background:var(--theme-accent-soft,var(--blue2));
  color:var(--theme-accent,var(--blue));
  font-size:10px;
}
.portal-app-placeholder{
  opacity:.72;
  box-shadow:none;
  border-style:dashed;
}
.portal-app-icon-muted{
  background:var(--theme-surface-2,#f5f7fb);
  color:var(--theme-muted,var(--muted));
  font-size:27px;
}
.portal-empty-apps{
  padding:50px 25px;
  text-align:center;
  border:1px dashed var(--theme-line,var(--line));
  border-radius:22px;
  background:var(--theme-surface,#fff);
}
.portal-empty-apps .portal-app-icon{
  margin:0 auto 16px;
}
.portal-empty-apps h2{
  margin:0 0 7px;
}
.portal-empty-apps p{
  margin:0;
  color:var(--theme-muted,var(--muted));
}
.portal-app-sidebar .app-workspace-title{
  margin-top:3px;
  color:var(--theme-accent,var(--blue));
}
.portal-app-sidebar .sidebar-footer{
  background:var(--theme-surface,#fff);
}

@media(max-width:950px){
  .portal-app-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .portal-home-header{padding:12px 16px}
  .portal-home-brand span{display:none}
  .portal-header-link span,
  .portal-header-profile>span{display:none}
  .portal-header-link{width:42px;justify-content:center;padding:7px}
  .portal-home-main{width:min(100% - 26px,1240px);padding-top:32px}
  .portal-app-grid{grid-template-columns:1fr}
  .portal-app-card{min-height:215px}
}
@media(max-width:430px){
  .portal-home-brand strong{font-size:14px}
  .portal-home-brand img{width:42px;height:42px}
  .portal-home-user{gap:6px}
  .portal-header-link,.portal-header-logout,.portal-header-profile{min-height:38px}
}


/* ========================================================
   v1.0.1 – Topbar ohne Fake-Suche + mobiles Benutzericon
   ======================================================== */
.global-topbar-spacer{
  grid-column:1;
  min-width:0;
  height:1px;
  pointer-events:none;
}

/* Die allgemeine alte Mobile-Regel blendet .avatar aus.
   In der globalen Topbar soll das Benutzerbild/Initial aber sichtbar bleiben. */
@media(max-width:720px){
  .global-user .avatar{
    display:grid !important;
    width:32px;
    height:32px;
  }
  .global-user img.avatar,
  .global-user .avatar-image{
    display:block !important;
    width:32px;
    height:32px;
    border-radius:50%;
    object-fit:cover;
  }
  .global-user{
    min-width:40px;
    min-height:40px;
    justify-content:center;
  }
}

/* Ohne Suchfunktion bleibt nur unsichtbarer Platz im Grid – kein weißes Suchfeld. */
@media(max-width:980px){
  .global-topbar-spacer{
    grid-column:2;
  }
}


/* ========================================================
   v1.0.2 – Benutzerbutton auf Portal-Startseite mobil
   ======================================================== */
@media(max-width:720px){
  .portal-header-profile .avatar{
    display:grid !important;
    width:29px !important;
    height:29px !important;
    flex:0 0 29px;
  }

  .portal-header-profile img.avatar,
  .portal-header-profile .avatar-image{
    display:block !important;
    width:29px !important;
    height:29px !important;
    flex:0 0 29px;
    border-radius:50%;
    object-fit:cover;
  }

  .portal-header-profile{
    width:42px;
    min-width:42px;
    justify-content:center;
    padding:6px;
  }
}


/* ========================================================
   v1.0.3 – Portal-Header: mobile Buttons einheitlich
   ======================================================== */
@media(max-width:720px){
  .portal-home-user{
    gap:6px;
  }

  .portal-home-user .portal-header-link,
  .portal-home-user .portal-header-profile,
  .portal-home-user .portal-header-logout{
    width:42px !important;
    min-width:42px !important;
    max-width:42px !important;
    height:42px !important;
    min-height:42px !important;
    padding:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:12px;
  }

  .portal-home-user .portal-header-profile .avatar,
  .portal-home-user .portal-header-profile img.avatar,
  .portal-home-user .portal-header-profile .avatar-image{
    width:29px !important;
    height:29px !important;
    flex:0 0 29px;
  }

  .portal-home-user .portal-header-icon{
    width:18px;
    height:18px;
    flex:0 0 18px;
  }
}


/* ========================================================
   v1.1.0 – Mail App
   ======================================================== */
.portal-app-mail{--portal-app-glow:rgba(92,95,209,.12)}
.portal-app-mail .portal-app-icon{
  background:#efefff;
  color:#5f62cb;
}

.mail-compose-nav{
  background:var(--theme-accent-soft,#eef4ff);
  color:var(--theme-accent,#2e6cf6);
  font-weight:750;
  margin-bottom:4px;
}

.mail-page-head,
.mail-compose-head{
  min-height:94px;
  padding:18px 20px 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  border-bottom:1px solid var(--theme-line,var(--line));
}
.mail-page-title{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.mail-page-icon{
  width:40px;height:40px;border-radius:10px;
  display:grid;place-items:center;
  background:#efefff;color:#5f62cb;
}
.mail-page-title h1,.mail-compose-head h1{margin:0;font-size:20px}
.mail-page-title p,.mail-compose-head p{margin:4px 0 0;color:var(--theme-muted,var(--muted));font-size:11px}
.mail-head-actions{display:flex;align-items:center;gap:9px}
.mail-search{
  width:min(370px,32vw);height:40px;
  display:flex;align-items:center;gap:8px;
  padding:0 11px;background:var(--theme-input,#fff);
  border:1px solid var(--theme-line,var(--line));border-radius:10px;
}
.mail-search input{
  width:100%;border:0;outline:0;background:transparent;color:var(--theme-text,#253047);
}

.mail-workspace{
  margin:16px 20px 24px;
  height:calc(100vh - 204px);
  min-height:560px;
  display:grid;
  grid-template-columns:minmax(360px,440px) minmax(0,1fr);
  border:1px solid var(--theme-line,var(--line));
  border-radius:15px;
  overflow:hidden;
  background:var(--theme-surface,#fff);
  box-shadow:var(--theme-shadow,var(--shadow));
}
.mail-list-panel{
  min-width:0;border-right:1px solid var(--theme-line,var(--line));
  display:flex;flex-direction:column;
}
.mail-list-toolbar{
  min-height:46px;padding:0 13px;
  display:flex;align-items:center;justify-content:space-between;
  border-bottom:1px solid var(--theme-line,var(--line));
  color:var(--theme-muted,var(--muted));font-size:11px;
}
.mail-list-toolbar a{color:inherit;display:grid;place-items:center}
.mail-message-list{overflow:auto;min-height:0}
.mail-message-row{
  position:relative;
  display:grid;grid-template-columns:38px minmax(0,1fr) auto;
  gap:10px;padding:12px 12px;
  border-bottom:1px solid var(--theme-line,var(--line));
  color:inherit;text-decoration:none;background:var(--theme-surface,#fff);
}
.mail-message-row:hover,.mail-message-row.is-active{background:var(--theme-surface-2,#f7f9fc)}
.mail-message-row.is-unread{background:var(--theme-accent-soft,#eef4ff)}
.mail-row-avatar{
  width:36px;height:36px;border-radius:50%;display:grid;place-items:center;
  background:#eef1f7;color:#59657a;font-weight:800;font-size:12px;
}
.mail-row-main{min-width:0}
.mail-row-top{display:flex;align-items:center;gap:8px;min-width:0}
.mail-row-top strong{
  flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px
}
.mail-row-top time{white-space:nowrap;font-size:9px;color:var(--theme-muted,var(--muted))}
.mail-row-subject{margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px}
.mail-row-meta{margin-top:4px;font-size:9px;color:var(--theme-muted,var(--muted))}
.mail-star{color:#e4a82e;font-size:14px}
.mail-list-empty{padding:40px 20px;text-align:center;color:var(--theme-muted,var(--muted));font-size:12px}

.mail-reader-panel{min-width:0;overflow:auto;background:var(--theme-surface,#fff)}
.mail-reader-empty{
  height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;color:var(--theme-muted,var(--muted));padding:30px;
}
.mail-reader-empty>div{width:52px;height:52px;margin-bottom:12px;color:#8d93cf}
.mail-reader-empty h2{margin:0 0 5px;color:var(--theme-text,#253047);font-size:18px}
.mail-reader-empty p{margin:0;font-size:12px}
.mail-reader{padding:20px 22px 32px}
.mail-reader-actions{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:18px}
.mail-reader-actions .btn{padding:8px 11px;font-size:10px}
.inline-form{display:inline-flex}
.mail-mobile-back{display:none}
.mail-reader-head{
  border-bottom:1px solid var(--theme-line,var(--line));padding-bottom:17px;margin-bottom:18px
}
.mail-reader-head h2{margin:0 0 13px;font-size:21px;line-height:1.35}
.mail-reader-address{font-size:11px;margin-top:4px;color:var(--theme-text-2,#566174)}
.mail-reader-head time{display:block;margin-top:8px;font-size:10px;color:var(--theme-muted,var(--muted))}
.mail-reader-body{
  font-size:13px;line-height:1.65;color:var(--theme-text,#253047);
  overflow-wrap:anywhere;
}
.mail-attachments{
  display:flex;flex-direction:column;gap:8px;margin:0 0 18px;
}
.mail-attachment{
  display:flex;align-items:center;gap:9px;padding:9px 10px;
  border:1px solid var(--theme-line,var(--line));border-radius:10px;
  background:var(--theme-surface-2,#f8fafc);
}
.mail-attachment>span{width:24px;height:24px;display:grid;place-items:center}
.mail-attachment>div{min-width:0;flex:1}
.mail-attachment strong{display:block;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mail-attachment small{display:block;color:var(--theme-muted,var(--muted));font-size:9px;margin-top:2px}
.mail-attachment .btn{padding:6px 9px;font-size:9px}

.mail-empty-setup,.mail-error-card{
  max-width:680px;margin:55px auto;padding:30px;
  border:1px solid var(--theme-line,var(--line));border-radius:16px;
  background:var(--theme-surface,#fff);text-align:center;
}
.mail-empty-icon{width:56px;height:56px;margin:0 auto 13px;color:#5f62cb}
.mail-empty-setup h1{margin:0 0 8px}
.mail-empty-setup p,.mail-error-card p{color:var(--theme-muted,var(--muted));line-height:1.55}
.mail-error-card strong{font-size:16px}

.mail-compose-card{padding:20px;max-width:980px}
.mail-compose-form,.mail-account-form{display:flex;flex-direction:column;gap:13px}
.mail-compose-form>label,.mail-account-form label{
  display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:700
}
.mail-compose-form input,.mail-compose-form textarea,
.mail-account-form input,.mail-account-form select{
  border:1px solid var(--theme-line,var(--line));border-radius:10px;
  background:var(--theme-input,#fff);color:var(--theme-text,#253047);
  padding:11px 12px;font:inherit;
}
.mail-compose-form textarea{resize:vertical;min-height:300px;line-height:1.55}
.mail-compose-actions,.mail-settings-actions{display:flex;gap:9px;align-items:center}
.mail-settings-note{
  padding:15px 16px;margin-bottom:14px;border-radius:12px;
  background:var(--theme-accent-soft,#eef4ff);border:1px solid var(--theme-line,var(--line))
}
.mail-settings-note p{margin:4px 0 0;font-size:11px;color:var(--theme-muted,var(--muted))}
.mail-account-form{max-width:900px}
.mail-account-form .settings-card{
  padding:18px;border:1px solid var(--theme-line,var(--line));border-radius:13px;
  background:var(--theme-surface,#fff);display:flex;flex-direction:column;gap:11px
}
.mail-account-form .settings-card h2{margin:0 0 4px;font-size:15px}
.mail-settings-grid{display:grid;grid-template-columns:180px minmax(220px,1fr);gap:12px}

@media(max-width:1050px){
  .mail-workspace{grid-template-columns:340px minmax(0,1fr)}
}
@media(max-width:760px){
  .mail-page-head,.mail-compose-head{
    min-height:0;padding:13px;align-items:flex-start;flex-direction:column
  }
  .mail-head-actions{width:100%;display:grid;grid-template-columns:1fr auto}
  .mail-search{width:100%;max-width:none}
  .mail-workspace{
    margin:10px 12px 80px;height:auto;min-height:calc(100vh - 160px);
    display:block;
  }
  .mail-list-panel{border-right:0}
  .mail-reader-panel{display:none}
  .mail-workspace.has-message .mail-list-panel{display:none}
  .mail-workspace.has-message .mail-reader-panel{display:block;min-height:calc(100vh - 160px)}
  .mail-reader{padding:15px 14px 28px}
  .mail-mobile-back{display:inline-flex}
  .mail-reader-head h2{font-size:18px}
  .mail-attachment{align-items:flex-start;flex-wrap:wrap}
  .mail-attachment>div{min-width:170px}
  .mail-compose-card{padding:13px}
  .mail-settings-grid{grid-template-columns:1fr}
  .mail-compose-actions,.mail-settings-actions{flex-wrap:wrap}
}


/* ========================================================
   v1.1.2 – Mail Scrollbars + 10er Nachladen
   ======================================================== */
.mail-message-list,
.mail-reader-panel{
  scrollbar-width:auto;
  scrollbar-color:auto;
  overflow-y:scroll;
}

.mail-message-list::-webkit-scrollbar,
.mail-reader-panel::-webkit-scrollbar{
  width:12px;
}

.mail-message-list::-webkit-scrollbar-track,
.mail-reader-panel::-webkit-scrollbar-track{
  background:var(--theme-surface-2,#f3f5f8);
}

.mail-message-list::-webkit-scrollbar-thumb,
.mail-reader-panel::-webkit-scrollbar-thumb{
  background:#b8beca;
  border-radius:10px;
  border:3px solid var(--theme-surface-2,#f3f5f8);
}

.mail-message-list::-webkit-scrollbar-thumb:hover,
.mail-reader-panel::-webkit-scrollbar-thumb:hover{
  background:#969eac;
}

.mail-load-more-wrap{
  padding:14px 12px 16px;
  display:flex;
  justify-content:center;
  border-top:1px solid var(--theme-line,var(--line));
  background:var(--theme-surface,#fff);
}

.mail-load-more{
  width:100%;
  justify-content:center;
}

@media(max-width:760px){
  .mail-message-list,
  .mail-reader-panel{
    overflow-y:auto;
  }
}


/* ========================================================
   v1.1.3 – Mail Desktop-Scrolling zuverlässig begrenzen
   ======================================================== */
@media(min-width:761px){
  /*
   * Die Portal-Oberfläche wird über CSS zoom skaliert. 100vh innerhalb
   * des gezoomten App-Shells war dadurch höher als der sichtbare Browser.
   * Deshalb wird die Mail-Arbeitsfläche je Zoomstufe auf den tatsächlich
   * verfügbaren Viewport begrenzt.
   */
  html[data-portal-zoom="90"] .mail-workspace{height:calc(111.111vh - 215px)}
  html[data-portal-zoom="100"] .mail-workspace{height:calc(100vh - 215px)}
  html[data-portal-zoom="110"] .mail-workspace{height:calc(90.909vh - 215px)}
  html[data-portal-zoom="120"] .mail-workspace{height:calc(83.333vh - 215px)}
  html[data-portal-zoom="125"] .mail-workspace{height:calc(80vh - 215px)}

  .mail-workspace{
    min-height:360px;
    max-height:none;
  }

  .mail-list-panel,
  .mail-reader-panel{
    height:100%;
    min-height:0;
    max-height:100%;
    overflow:hidden;
  }

  .mail-list-panel{
    display:flex;
    flex-direction:column;
  }

  .mail-list-toolbar{
    flex:0 0 46px;
  }

  .mail-message-list{
    flex:1 1 0;
    height:0;
    min-height:0;
    overflow-y:scroll !important;
    overscroll-behavior:contain;
  }

  .mail-reader-panel{
    overflow-y:scroll !important;
    overscroll-behavior:contain;
  }
}


/* ========================================================
   v1.1.4 – Mail in Ordner verschieben
   ======================================================== */
.mail-move-form{
  gap:6px;
  align-items:center;
}
.mail-move-select{
  min-width:180px;
  max-width:260px;
  height:34px;
  padding:0 9px;
  border:1px solid var(--theme-line,var(--line));
  border-radius:9px;
  background:var(--theme-input,#fff);
  color:var(--theme-text,#253047);
  font-size:10px;
}
@media(max-width:760px){
  .mail-move-form{
    width:100%;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
  }
  .mail-move-select{
    width:100%;
    min-width:0;
    max-width:none;
  }
}

/* v1.2.0 – zentrale App-Anordnung */
.portal-order-card{padding:20px}
.portal-order-card>h2{margin:0 0 7px}
.portal-order-list{display:flex;flex-direction:column;gap:9px;margin:18px 0}
.portal-order-item{display:grid;grid-template-columns:28px 42px minmax(0,1fr) auto;align-items:center;gap:11px;padding:11px 12px;border:1px solid var(--theme-line,var(--line));border-radius:12px;background:var(--theme-surface,#fff)}
.portal-order-item.is-dragging{opacity:.45}
.portal-order-item strong{display:block;font-size:12px}
.portal-order-item small{display:block;margin-top:3px;color:var(--theme-muted,var(--muted));font-size:10px}
.portal-order-drag{cursor:grab;color:var(--theme-muted,var(--muted));font-weight:800;letter-spacing:-3px;user-select:none}
.portal-order-buttons{display:flex;gap:5px}
.portal-order-buttons .icon-btn{width:32px;height:32px;border:1px solid var(--theme-line,var(--line));border-radius:8px;background:var(--theme-surface-2,#f7f9fc);color:var(--theme-text,#253047);cursor:pointer}
@media(max-width:600px){.portal-order-item{grid-template-columns:24px 38px minmax(0,1fr)}.portal-order-buttons{grid-column:3;justify-content:flex-end}}

/* v1.3.0 – Zugänge & Eintrittskarten */
.portal-app-wallet .portal-app-icon{background:linear-gradient(145deg,#e8f6ef,#d8eee4)}
.wallet-page{padding-bottom:40px}.wallet-heading{align-items:center}
.wallet-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.wallet-stats>div{padding:14px 16px;border:1px solid var(--theme-line,var(--line));border-radius:13px;background:var(--theme-surface,#fff)}
.wallet-stats strong{display:block;font-size:21px}.wallet-stats span{font-size:10px;color:var(--theme-muted,var(--muted))}
.wallet-filterbar{display:flex;gap:12px;justify-content:space-between;align-items:flex-end;margin-bottom:18px;flex-wrap:wrap}
.wallet-type-tabs{display:flex;gap:6px;flex-wrap:wrap}.wallet-type-tabs a{padding:7px 10px;border:1px solid var(--theme-line,var(--line));border-radius:999px;color:var(--theme-muted,var(--muted));font-size:10px;text-decoration:none}.wallet-type-tabs a.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.wallet-search{display:flex;gap:7px;min-width:min(100%,340px)}.wallet-search input{min-width:0;flex:1}
.wallet-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.wallet-card{min-height:220px;display:flex;flex-direction:column;border:1px solid var(--theme-line,var(--line));border-radius:18px;padding:15px;background:var(--theme-surface,#fff);box-shadow:0 5px 16px rgba(20,35,60,.04)}
.wallet-card.is-favorite{box-shadow:0 8px 24px rgba(20,35,60,.08)}.wallet-card-top{display:flex;align-items:center;gap:9px}.wallet-card-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:var(--theme-surface-2,#f4f6fa)}.wallet-card-icon svg{width:20px;height:20px}.wallet-card-owner{font-size:9px;color:var(--theme-muted,var(--muted));flex:1}.wallet-star{font-size:18px}
.wallet-card-body{padding:18px 2px 12px;flex:1}.wallet-kind{font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--theme-muted,var(--muted))}.wallet-card h2{margin:5px 0 4px;font-size:17px}.wallet-card p{margin:0;color:var(--theme-muted,var(--muted));font-size:10px}.wallet-identifier{margin-top:13px;padding:8px 10px;border-radius:9px;background:var(--theme-surface-2,#f5f7fb);font-family:ui-monospace,SFMono-Regular,monospace;font-size:11px}.wallet-valid{margin-top:9px;font-size:9px;color:var(--theme-muted,var(--muted))}.wallet-valid.expired{color:#b42318}.wallet-card-actions{display:flex;gap:7px}.wallet-empty{text-align:center;padding:50px 20px;border:1px dashed var(--theme-line,var(--line));border-radius:18px}
.wallet-edit-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(270px,.8fr);gap:16px;align-items:start}.wallet-form{padding:18px}.wallet-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.wallet-form label{display:flex;flex-direction:column;gap:6px;font-size:10px;font-weight:700}.wallet-form label small{font-weight:400;color:var(--theme-muted,var(--muted))}.wallet-full{grid-column:1/-1}.wallet-check{flex-direction:row!important;align-items:center!important}.wallet-check input{width:auto}
.wallet-wifi-field,.wallet-access-field{display:none!important}.wallet-is-wifi .wallet-wifi-field{display:flex!important}.wallet-is-access .wallet-access-field{display:flex!important}
.wallet-detail-side{display:flex;flex-direction:column;gap:14px}.wallet-code-card,.wallet-share-card{padding:16px}.wallet-code-card h2,.wallet-share-card h2{margin-top:0}.wallet-big-qr,.wallet-public-qr{display:block;width:min(100%,280px);aspect-ratio:1;margin:10px auto;background:#fff;border-radius:12px;padding:8px}.wallet-secret{margin:8px 0;padding:9px;border-radius:9px;background:var(--theme-surface-2,#f4f6fa);font-family:monospace;word-break:break-all}
.wallet-share-card form{display:flex;flex-direction:column;gap:9px}.wallet-share-card label{display:flex;flex-direction:column;gap:5px;font-size:10px;font-weight:700}.wallet-share-list{margin-top:14px;display:flex;flex-direction:column;gap:8px}.wallet-share-list>div{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:9px;border:1px solid var(--theme-line,var(--line));border-radius:10px}.wallet-share-list strong,.wallet-share-list small{display:block}.wallet-share-list small{color:var(--theme-muted,var(--muted));font-size:9px}.wallet-new-share{padding:10px;margin-bottom:12px;border:1px solid var(--theme-line,var(--line));border-radius:11px}.wallet-new-share input{width:100%;margin:7px 0}
.wallet-public-card{max-width:520px;margin:auto;padding:24px;border-radius:18px;background:#fff;box-shadow:0 20px 60px rgba(10,20,40,.12);text-align:center}.wallet-public-card h1{margin:6px 0}.wallet-public-number{font-family:monospace;font-size:16px;padding:10px;border-radius:10px;background:#f4f6fa;margin:10px 0}.wallet-public-wifi{display:flex;flex-direction:column;gap:5px;margin:10px 0 16px}
@media(max-width:980px){.wallet-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wallet-edit-layout{grid-template-columns:1fr}}
@media(max-width:700px){.wallet-stats{grid-template-columns:repeat(2,1fr)}.wallet-grid{grid-template-columns:1fr}.wallet-form-grid{grid-template-columns:1fr}.wallet-full{grid-column:auto}.wallet-filterbar,.wallet-search{width:100%}.wallet-type-tabs{overflow-x:auto;flex-wrap:nowrap;padding-bottom:3px}.wallet-type-tabs a{white-space:nowrap}}


/* ========================================================
   v1.3.1 – Wallet Layout / Responsive Hotfix
   ======================================================== */

/* Die Wallet bleibt vollständig innerhalb ihrer Grid-Spalten. */
.wallet-page,
.wallet-page *,
.wallet-edit-layout,
.wallet-edit-layout *{
  box-sizing:border-box;
}

.wallet-heading{
  display:flex;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.wallet-heading .btn{
  flex:0 0 auto;
  white-space:nowrap;
}

.wallet-edit-layout{
  width:100%;
  min-width:0;
  grid-template-columns:minmax(0,1fr) minmax(300px,360px);
  gap:18px;
}
.wallet-form,
.wallet-detail-side,
.wallet-code-card,
.wallet-share-card{
  min-width:0;
  width:100%;
}

.wallet-form-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.wallet-form-grid > label{
  min-width:0;
}
.wallet-form input:not([type="checkbox"]):not([type="radio"]),
.wallet-form select,
.wallet-form textarea,
.wallet-share-card input:not([type="checkbox"]):not([type="radio"]),
.wallet-share-card select,
.wallet-new-share input{
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
}

.wallet-form textarea{
  resize:vertical;
}

.wallet-form .settings-actions{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
  margin-top:18px;
}
.wallet-form .settings-actions .btn{
  position:static;
  width:auto;
  max-width:100%;
  margin:0;
  white-space:nowrap;
}

/* Kartenschaltflächen dürfen bei schmaleren Kacheln umbrechen. */
.wallet-card-actions{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.wallet-card-actions .btn{
  flex:1 1 auto;
  min-width:88px;
  text-align:center;
  white-space:nowrap;
}

/* Rechte Detailspalte */
.wallet-code-card .btn,
.wallet-share-card > form > .btn,
.wallet-new-share .btn{
  max-width:100%;
}
.wallet-code-card .wide,
.wallet-share-card .wide{
  display:flex;
  width:100%;
  justify-content:center;
  text-align:center;
  white-space:normal;
}

.wallet-big-qr{
  max-width:240px;
  height:auto;
}

/* Nur das eigentliche Freigabeformular ist ein vertikales Formular.
   Die kleinen Deaktivieren-Formulare in der Liste werden separat behandelt. */
.wallet-share-card > form{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.wallet-share-card > form > label{
  min-width:0;
}
.wallet-share-list{
  min-width:0;
}
.wallet-share-list > div{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  min-width:0;
}
.wallet-share-list > div > div{
  min-width:0;
}
.wallet-share-list > div > form{
  display:block;
  margin:0;
  min-width:0;
}
.wallet-share-list > div > form .btn{
  margin:0;
  width:auto;
  max-width:100%;
  white-space:nowrap;
}
.wallet-share-list small{
  overflow-wrap:anywhere;
}

.wallet-new-share{
  min-width:0;
  overflow:hidden;
}
.wallet-new-share input{
  text-overflow:ellipsis;
}

/* Filterleiste */
.wallet-filterbar,
.wallet-type-tabs,
.wallet-search{
  min-width:0;
}
.wallet-search{
  flex:0 1 360px;
}
.wallet-search .btn{
  flex:0 0 auto;
  white-space:nowrap;
}

/* Bereits deutlich vor Tabletbreite auf eine Spalte wechseln:
   wichtig bei Portal-Zoom 110/120/125 %. */
@media(max-width:1180px){
  .wallet-edit-layout{
    grid-template-columns:1fr;
  }
  .wallet-detail-side{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:start;
  }
}

@media(max-width:900px){
  .wallet-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .wallet-detail-side{
    grid-template-columns:1fr;
  }
  .wallet-filterbar{
    align-items:stretch;
  }
  .wallet-search{
    flex:1 1 100%;
    width:100%;
  }
}

@media(max-width:700px){
  .wallet-heading{
    align-items:stretch;
  }
  .wallet-heading .btn{
    width:100%;
    text-align:center;
  }
  .wallet-form{
    padding:14px;
  }
  .wallet-form-grid{
    grid-template-columns:1fr;
  }
  .wallet-form-grid > label,
  .wallet-full{
    grid-column:1 !important;
  }
  .wallet-form .settings-actions{
    display:grid;
    grid-template-columns:1fr;
  }
  .wallet-form .settings-actions .btn{
    width:100%;
  }
  .wallet-share-list > div{
    grid-template-columns:1fr;
  }
  .wallet-share-list > div > form .btn{
    width:100%;
  }
  .wallet-card-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .wallet-card-actions .btn{
    width:100%;
    min-width:0;
  }
}

@media(max-width:430px){
  .wallet-stats{
    grid-template-columns:1fr 1fr;
  }
  .wallet-card-actions{
    grid-template-columns:1fr;
  }
  .wallet-search{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
  }
}


/* ========================================================
   v1.3.2 – Wallet: kompakte Karten + reine Anzeige
   ======================================================== */
.wallet-grid{
  grid-template-columns:repeat(4,minmax(180px,1fr));
  gap:12px;
}
.wallet-card{
  min-height:155px;
  padding:12px;
  border-radius:16px;
}
.wallet-card-link{
  color:inherit;
  text-decoration:none;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  min-width:0;
  flex:1;
}
.wallet-card-body{
  padding:12px 0 8px;
  min-width:0;
}
.wallet-card h2{
  font-size:14px;
  line-height:1.2;
  margin:4px 0 3px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.wallet-card p{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.wallet-card-mini-code{
  align-self:center;
  justify-self:end;
  width:42px;
  height:42px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:#fff;
  color:#111;
  border:1px solid rgba(0,0,0,.08);
  overflow:hidden;
}
.mini-qr{font-size:27px;line-height:1}
.mini-barcode{
  font-family:monospace;
  font-size:10px;
  letter-spacing:-1px;
  white-space:nowrap;
  transform:rotate(90deg);
}
.wallet-card-actions{
  margin-top:7px;
  padding-top:8px;
  border-top:1px solid var(--theme-line,var(--line));
}
.wallet-card-actions .btn{
  padding:5px 8px;
  font-size:8.5px;
}

.wallet-view-page{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding-top:18px;
}
.wallet-view-heading{
  align-items:center;
}
.wallet-pass{
  width:min(100%,460px);
  border:1px solid var(--theme-line,var(--line));
  border-radius:22px;
  background:var(--theme-surface,#fff);
  box-shadow:0 12px 34px rgba(20,35,60,.10);
  overflow:hidden;
}
.wallet-pass-header{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:20px 22px 14px;
}
.wallet-pass-header h2{
  margin:4px 0 2px;
  font-size:22px;
}
.wallet-pass-header p{
  margin:0;
  color:var(--theme-muted,var(--muted));
  font-size:11px;
}
.wallet-pass-star{font-size:22px}
.wallet-pass-code{
  padding:12px 22px 18px;
  text-align:center;
  background:var(--theme-surface-2,#f6f7fa);
}
.wallet-pass-qr{
  width:min(100%,280px);
  aspect-ratio:1;
  object-fit:contain;
  background:#fff;
  padding:8px;
  border-radius:12px;
}
.wallet-pass-barcode{
  width:100%;
  max-height:145px;
  object-fit:contain;
  background:#fff;
  padding:10px;
  border-radius:12px;
}
.wallet-pass-primary,
.wallet-pass-row{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  padding:13px 22px;
  border-top:1px solid var(--theme-line,var(--line));
}
.wallet-pass-primary span,
.wallet-pass-row span{
  color:var(--theme-muted,var(--muted));
  font-size:10px;
}
.wallet-pass-primary strong,
.wallet-pass-row strong{
  text-align:right;
  overflow-wrap:anywhere;
}
.wallet-pass-secret{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:13px 22px;
  border-top:1px solid var(--theme-line,var(--line));
}
.wallet-pass-secret strong{
  font-family:ui-monospace,SFMono-Regular,monospace;
  overflow-wrap:anywhere;
}
.wallet-pass-file{
  display:flex;
  justify-content:center;
  margin:14px 22px 20px;
}
.wallet-view-actions{
  display:flex;
  gap:8px;
  margin-top:14px;
  flex-wrap:wrap;
  justify-content:center;
}

@media(max-width:1200px){
  .wallet-grid{grid-template-columns:repeat(3,minmax(180px,1fr))}
}
@media(max-width:900px){
  .wallet-grid{grid-template-columns:repeat(2,minmax(170px,1fr))}
}
@media(max-width:560px){
  .wallet-grid{grid-template-columns:1fr}
  .wallet-card{min-height:145px}
  .wallet-pass{border-radius:17px}
  .wallet-pass-header,.wallet-pass-primary,.wallet-pass-row,.wallet-pass-secret{padding-left:16px;padding-right:16px}
  .wallet-pass-code{padding-left:16px;padding-right:16px}
}

/* ========================================================
   v1.3.3 – Kamera-Scanner + Mobile Wallet
   ======================================================== */
.wallet-code-import{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 13px;border:1px solid var(--theme-line,var(--line));border-radius:12px;background:var(--theme-surface-2,#f6f7fa)}
.wallet-code-import>div{min-width:0}.wallet-code-import strong,.wallet-code-import small{display:block}.wallet-code-import small{margin-top:3px;color:var(--theme-muted,var(--muted));font-weight:400;line-height:1.35}.wallet-code-import .btn{flex:0 0 auto;white-space:nowrap}
.wallet-scanner-open{overflow:hidden}.wallet-scanner-modal{position:fixed;inset:0;z-index:5000;background:rgba(8,14,25,.72);display:grid;place-items:center;padding:18px}.wallet-scanner-modal[hidden]{display:none}.wallet-scanner-sheet{width:min(100%,520px);max-height:calc(100dvh - 36px);overflow:auto;background:var(--theme-surface,#fff);border-radius:20px;padding:16px;box-shadow:0 24px 80px rgba(0,0,0,.3)}
.wallet-scanner-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.wallet-scanner-head strong,.wallet-scanner-head span{display:block}.wallet-scanner-head strong{font-size:17px}.wallet-scanner-head span{margin-top:2px;font-size:10px;color:var(--theme-muted,var(--muted))}.wallet-scanner-close{border:0;background:var(--theme-surface-2,#f3f5f8);color:inherit;width:36px;height:36px;border-radius:10px;font-size:24px;line-height:1;cursor:pointer}
.wallet-scanner-camera{position:relative;overflow:hidden;border-radius:15px;background:#080b10;aspect-ratio:4/3}.wallet-scanner-camera video{width:100%;height:100%;object-fit:cover}.wallet-scanner-frame{position:absolute;left:8%;right:8%;top:31%;height:38%;border:2px solid rgba(255,255,255,.92);border-radius:12px;box-shadow:0 0 0 999px rgba(0,0,0,.24);pointer-events:none}.wallet-scanner-frame:after{content:"";position:absolute;left:8%;right:8%;top:50%;height:2px;background:rgba(255,255,255,.75)}
.wallet-scanner-status{min-height:32px;margin:10px 2px;font-size:11px;color:var(--theme-muted,var(--muted));line-height:1.4}.wallet-scanner-status.ok{color:#14804a;font-weight:700}.wallet-scan-file{display:flex!important;width:100%;justify-content:center;margin-bottom:8px}.wallet-scanner-sheet>.btn:last-child{width:100%}
.wallet-code-type{display:block;margin:0 auto 7px;font-size:9px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:#596273}

/* Smartphone: wie eine echte Wallet – Inhalt zuerst, Navigation und Aktionen kompakt. */
@media(max-width:700px){
  .wallet-page{padding:10px 12px 28px!important}.wallet-heading{padding-left:12px!important;padding-right:12px!important;gap:10px}.wallet-heading h1{font-size:20px}.wallet-heading p{font-size:10px;line-height:1.35}.wallet-heading .btn{height:40px;display:flex;align-items:center;justify-content:center}
  .wallet-stats{display:none}.wallet-filterbar{margin-bottom:12px}.wallet-type-tabs{margin:0 -2px}.wallet-type-tabs a{padding:8px 11px;font-size:9px}.wallet-search{grid-template-columns:minmax(0,1fr) 72px}.wallet-search input,.wallet-search .btn{height:38px}
  .wallet-grid{gap:10px}.wallet-card{min-height:0;padding:11px;border-radius:15px}.wallet-card-top{gap:7px}.wallet-card-icon{width:32px;height:32px;border-radius:9px}.wallet-card-icon svg{width:17px;height:17px}.wallet-card-owner{font-size:8px}.wallet-card-link{grid-template-columns:minmax(0,1fr) 36px;gap:7px}.wallet-card-body{padding:9px 0 6px}.wallet-card h2{font-size:15px}.wallet-card-mini-code{width:36px;height:36px}.wallet-card-actions{grid-template-columns:1fr 1fr;margin-top:5px;padding-top:7px}.wallet-card-actions .btn{height:34px;display:flex;align-items:center;justify-content:center}
  .wallet-view-heading{padding:10px 12px!important}.wallet-view-heading>div{min-width:0}.wallet-view-heading h1{font-size:20px}.wallet-view-heading p{font-size:9px}.wallet-view-heading>.btn{width:auto!important;min-width:92px}
  .wallet-view-page{padding:8px 10px 24px!important}.wallet-pass{width:100%;border-radius:18px;box-shadow:0 8px 24px rgba(20,35,60,.09)}.wallet-pass-header{padding:16px 16px 11px}.wallet-pass-header h2{font-size:20px}.wallet-pass-code{padding:10px 12px 14px}.wallet-pass-barcode{max-height:125px;padding:7px}.wallet-pass-qr{width:min(78vw,260px)}.wallet-pass-primary,.wallet-pass-row,.wallet-pass-secret{padding:11px 15px}.wallet-pass-secret{align-items:stretch;flex-direction:column}.wallet-pass-secret .btn{width:100%}.wallet-pass-secret strong{text-align:center;padding:6px}.wallet-pass-file{margin:12px 15px 15px}.wallet-view-actions{width:100%;display:grid;grid-template-columns:1fr 1fr;padding:0 4px}.wallet-view-actions .btn{display:flex;justify-content:center}
  .wallet-edit-layout{padding:8px 10px 28px!important;gap:10px}.wallet-form,.wallet-code-card,.wallet-share-card{border-radius:15px!important}.wallet-form{padding:13px}.wallet-form-grid{gap:10px}.wallet-form label{font-size:9px}.wallet-form input:not([type=checkbox]):not([type=radio]),.wallet-form select{min-height:42px}.wallet-code-import{align-items:stretch;flex-direction:column;padding:11px}.wallet-code-import .btn{width:100%;height:42px}.wallet-form .settings-actions{position:sticky;bottom:8px;z-index:20;background:var(--theme-surface,#fff);padding:8px;border:1px solid var(--theme-line,var(--line));border-radius:12px;box-shadow:0 6px 20px rgba(0,0,0,.1)}
  .wallet-scanner-modal{padding:0;place-items:end center}.wallet-scanner-sheet{width:100%;max-height:92dvh;border-radius:20px 20px 0 0;padding:14px 14px calc(14px + env(safe-area-inset-bottom))}.wallet-scanner-camera{aspect-ratio:3/4;max-height:58dvh}.wallet-scanner-frame{left:6%;right:6%;top:37%;height:26%}
}
@media(max-width:390px){.wallet-card-actions{grid-template-columns:1fr}.wallet-view-actions{grid-template-columns:1fr}.wallet-view-heading{align-items:flex-start}.wallet-view-heading>.btn{width:100%!important}}
.wallet-big-barcode{display:block;width:100%;max-height:150px;object-fit:contain;margin:10px auto;background:#fff;border-radius:12px;padding:8px}.wallet-code-hint{display:block;text-align:center;color:var(--theme-muted,var(--muted));margin:-3px 0 9px}
@media(max-width:700px){.wallet-big-barcode{max-height:125px}}


/* ========================================================
   v1.3.4 – Wallet Filter: ohne Suche / Mobile Dropdown
   ======================================================== */
.wallet-filterbar{
  display:block;
  margin-bottom:16px;
}
.wallet-type-mobile{
  display:none;
}
.wallet-type-tabs{
  width:100%;
}
.wallet-search{
  display:none !important;
}

@media(max-width:700px){
  .wallet-filterbar{
    margin:0 0 12px;
  }
  .wallet-type-tabs{
    display:none !important;
  }
  .wallet-type-mobile{
    display:flex;
    flex-direction:column;
    gap:6px;
    width:100%;
    font-size:9px;
    font-weight:700;
  }
  .wallet-type-mobile span{
    color:var(--theme-muted,var(--muted));
    text-transform:uppercase;
    letter-spacing:.05em;
  }
  .wallet-type-mobile select{
    width:100%;
    min-width:0;
    height:42px;
    padding:0 12px;
    border:1px solid var(--theme-line,var(--line));
    border-radius:11px;
    background:var(--theme-input,var(--theme-surface,#fff));
    color:var(--theme-text,#253047);
    font:inherit;
  }
}


/* ========================================================
   v1.3.5 – Wallet Formular + gezielte Benutzerfreigabe
   ======================================================== */
.wallet-edit-layout{
  grid-template-columns:minmax(0,1fr) minmax(310px,370px);
  gap:22px;
}
.wallet-form{
  padding:22px;
}
.wallet-form-grid{
  gap:14px 16px;
}
.wallet-section-title{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:14px;
  padding-bottom:9px;
  border-bottom:1px solid var(--theme-line,var(--line));
}
.wallet-section-title strong{
  font-size:13px;
}
.wallet-section-title small{
  color:var(--theme-muted,var(--muted));
  font-size:9px;
  font-weight:400;
  text-align:right;
}
.wallet-section-spacer{
  margin-top:8px;
}
.wallet-share-people{
  padding:14px;
  border:1px solid var(--theme-line,var(--line));
  border-radius:13px;
  background:var(--theme-surface-2,#f7f8fb);
}
.wallet-share-people .wallet-section-title{
  margin-bottom:10px;
}
.wallet-people-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.wallet-person-option{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:9px!important;
  min-width:0;
  padding:10px 11px;
  border:1px solid var(--theme-line,var(--line));
  border-radius:11px;
  background:var(--theme-surface,#fff);
  cursor:pointer;
}
.wallet-person-option:has(input:checked){
  border-color:var(--theme-accent,var(--accent));
  box-shadow:0 0 0 1px var(--theme-accent,var(--accent)) inset;
}
.wallet-person-option input{
  flex:0 0 auto;
  width:16px!important;
  height:16px;
}
.wallet-person-option span{
  min-width:0;
}
.wallet-person-option strong,
.wallet-person-option small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.wallet-person-option small{
  margin-top:2px;
  color:var(--theme-muted,var(--muted));
  font-size:8px;
  font-weight:400;
}
.wallet-muted{
  margin:0;
  color:var(--theme-muted,var(--muted));
  font-size:10px;
}
.wallet-mobile-edit{
  display:none!important;
}

@media(min-width:1181px){
  .wallet-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .wallet-form .settings-actions{
    padding-top:16px;
    border-top:1px solid var(--theme-line,var(--line));
  }
}

@media(max-width:700px){
  .wallet-edit-desktop{
    display:none!important;
  }
  .wallet-view-actions{
    position:sticky;
    bottom:8px;
    z-index:25;
    grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr)!important;
    padding:8px!important;
    border:1px solid var(--theme-line,var(--line));
    border-radius:13px;
    background:var(--theme-surface,#fff);
    box-shadow:0 10px 28px rgba(20,35,60,.14);
  }
  .wallet-mobile-edit{
    display:flex!important;
    align-items:center;
    justify-content:center;
    min-height:42px;
    font-weight:700;
  }
  .wallet-people-grid{
    grid-template-columns:1fr;
  }
  .wallet-share-people{
    padding:11px;
  }
  .wallet-section-title{
    display:block;
  }
  .wallet-section-title small{
    display:block;
    margin-top:3px;
    text-align:left;
  }
}
