:root{--bg:#f5f7fb;--panel:#fff;--text:#172033;--muted:#667085;--line:#e4e7ec;--brand:#39656F;--brand-dark:#2D5058;--brand-soft:#E8F0F2;--brand-rgb:57,101,111;--brand-contrast:#fff;--brand-contrast-rgb:255,255,255;--primary:#39656F;--primary-dark:#2D5058;--primary-soft:#E8F0F2;--primary-rgb:57,101,111;--primary-contrast:#fff;--danger:#b42318;--success:#067647}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.topbar{height:76px;background:var(--brand);border-bottom:1px solid var(--brand-dark);display:flex;align-items:center;justify-content:space-between;padding:0 max(24px,calc((100vw - 1240px)/2));position:sticky;top:0;z-index:10}.brand{display:flex;align-items:center;font-weight:800;font-size:20px;color:var(--brand-contrast);text-decoration:none;min-width:0}.brandname{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar nav{display:flex;gap:18px;flex-wrap:wrap}.topbar a{color:var(--brand-contrast);text-decoration:none;font-weight:600}.container{max-width:1240px;margin:38px auto;padding:0 24px}.pagehead{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin-bottom:24px}h1{font-size:30px;margin:0 0 4px}h2{font-size:19px;margin:0 0 18px}.muted{color:var(--muted)}.small{font-size:13px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}.stat,.panel,.auth-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:0 1px 2px rgba(16,24,40,.04)}.stat{padding:20px}.stat span,.stat small{display:block;color:var(--muted)}.stat strong{display:block;font-size:28px;margin:4px 0}.panel{padding:22px;margin-bottom:24px}.narrow{max-width:680px}.panelhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.panelhead h2{margin:0}.button,button{display:inline-block;background:var(--primary);color:var(--primary-contrast);border:0;border-radius:9px;padding:10px 15px;font-weight:700;text-decoration:none;cursor:pointer;transition:background .18s ease,transform .18s ease,box-shadow .18s ease}.button:hover,button:hover{background:var(--primary-dark)}.button:focus-visible,button:focus-visible,.topbar a:focus-visible{outline:3px solid rgba(var(--primary-rgb),.28);outline-offset:2px}.button.secondary{background:#fff;color:var(--primary);border:1px solid #b8c9cd}.button.secondary:hover{background:var(--primary-soft);color:var(--primary-dark)}form label{display:block;font-weight:650;margin-bottom:15px}input,select,textarea{display:block;width:100%;margin-top:6px;padding:10px 11px;border:1px solid #d0d5dd;border-radius:9px;background:#fff;color:#101828;font:inherit}textarea{resize:vertical}.check{display:flex;align-items:center;gap:9px}.check input{width:auto;margin:0}.filters{display:grid;grid-template-columns:1fr 200px auto;gap:10px;align-items:end;margin-bottom:18px}.filters input,.filters select{margin:0}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:820px}th,td{text-align:left;border-bottom:1px solid var(--line);padding:12px 10px;vertical-align:middle}th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}td a{color:var(--text);text-decoration:none}.num{text-align:right}.badge{display:inline-block;padding:3px 8px;border-radius:999px;font-size:12px;font-weight:700}.badge.open{background:#fff3d6;color:#8a4b00}.badge.paid{background:#dcfae6;color:#067647}.badge.closed{background:#eaecf0;color:#475467}.flash{padding:12px 14px;border-radius:10px;margin-bottom:18px}.flash.success{background:#ecfdf3;color:var(--success)}.flash.error{background:#fef3f2;color:var(--danger)}.auth-card{max-width:440px;padding:28px;margin:8vh auto}.twocol{display:grid;grid-template-columns:2fr 1fr;gap:22px}.inline{display:inline}.linkbtn{background:transparent;color:var(--primary);padding:0}.chips{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 20px}.chips span{background:var(--primary-soft);color:var(--primary-dark);padding:5px 9px;border-radius:999px;font-size:13px}.meta{display:grid;grid-template-columns:120px 1fr;gap:6px;margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}.meta dt{color:var(--muted)}.meta dd{margin:0}.empty{text-align:center;color:var(--muted);padding:30px}@media(max-width:900px){.stats{grid-template-columns:1fr 1fr}.twocol{grid-template-columns:1fr}.topbar{height:auto;padding:14px 20px;align-items:flex-start;gap:14px}.topbar nav{gap:10px}.container{margin-top:24px}.filters{grid-template-columns:1fr}.pagehead{flex-direction:column}.stats{grid-template-columns:1fr 1fr}}@media(max-width:560px){.stats{grid-template-columns:1fr}}

/* Responsive Hauptnavigation */
.nav-toggle{display:none;width:44px;height:44px;padding:10px;background:transparent;border:1px solid rgba(var(--brand-contrast-rgb),.28);border-radius:10px;align-items:center;justify-content:center;flex-direction:column;gap:5px;flex:0 0 auto}.nav-toggle span{display:block;width:21px;height:2px;background:var(--brand-contrast);border-radius:2px;transition:transform .2s ease,opacity .2s ease}.nav-toggle.is-open span:nth-child(1){transform:translateY(7px) rotate(45deg)}.nav-toggle.is-open span:nth-child(2){opacity:0}.nav-toggle.is-open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
@media(max-width:900px){.topbar{padding:12px 18px;align-items:center;position:sticky}.brand{min-width:0}.brandname{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}.nav-toggle{display:flex;margin-left:auto}.topbar .main-nav{display:none;position:absolute;left:0;right:0;top:100%;background:var(--brand);border-top:1px solid rgba(var(--brand-contrast-rgb),.12);border-bottom:1px solid var(--brand-dark);padding:10px 18px 16px;box-shadow:0 12px 24px rgba(16,24,40,.18);flex-direction:column;gap:4px}.topbar .main-nav.is-open{display:flex}.topbar .main-nav a{display:block;padding:11px 12px;border-radius:8px}.topbar .main-nav a:hover,.topbar .main-nav a:focus-visible{background:rgba(var(--brand-contrast-rgb),.09);outline:none}}
@media(max-width:560px){.topbar{padding:10px 14px}.brand{flex:1 1 auto;max-width:calc(100% - 52px)}.brandname{display:block;font-size:17px;line-height:1.2;max-width:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-toggle{width:42px;height:42px}.container{padding:0 14px}.pagehead>div:last-child{width:100%;display:flex;gap:8px;flex-wrap:wrap}.pagehead .button{flex:1 1 auto;text-align:center}}

/* Portal Design */
a:not(.button):not(.brand){transition:color .18s ease} .panel td a:hover{color:var(--primary)} input:focus,select:focus,textarea:focus{border-color:var(--primary);outline:3px solid rgba(var(--primary-rgb),.12)} .stat strong{color:var(--primary-dark)}

/* Dropdown-Navigation und zusammengefasste Seiten */
.nav-dropdown{position:relative;display:flex;align-items:center}.nav-dropdown-toggle{background:transparent;color:var(--brand-contrast);padding:8px 10px;border-radius:8px;font:inherit;font-weight:600;display:flex;align-items:center;gap:6px}.nav-dropdown-toggle:hover,.nav-dropdown.is-open>.nav-dropdown-toggle{background:rgba(var(--brand-contrast-rgb),.1)}.nav-dropdown-toggle span{font-size:11px;transition:transform .18s ease}.nav-dropdown.is-open>.nav-dropdown-toggle span{transform:rotate(180deg)}.nav-dropdown-menu{display:none;position:absolute;top:calc(100% + 8px);left:0;min-width:230px;background:#fff;border:1px solid var(--line);border-radius:11px;padding:6px;box-shadow:0 14px 32px rgba(16,24,40,.16);z-index:30}.nav-dropdown.is-open>.nav-dropdown-menu{display:block}.topbar .nav-dropdown-menu a{display:block;color:var(--text);padding:9px 11px;border-radius:7px;white-space:nowrap}.topbar .nav-dropdown-menu a:hover{background:var(--primary-soft);color:var(--primary-dark)}.entry-grid,.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:start}.entry-grid .panel,.settings-grid .panel{margin-bottom:0}
@media(max-width:900px){.nav-dropdown{display:block;width:100%}.nav-dropdown-toggle{width:100%;justify-content:space-between;padding:11px 12px}.nav-dropdown-menu{position:static;min-width:0;background:rgba(var(--brand-contrast-rgb),.07);border:0;border-radius:8px;box-shadow:none;margin:2px 0 5px;padding:4px}.topbar .nav-dropdown-menu a{color:var(--brand-contrast);padding:10px 14px 10px 24px;white-space:normal}.topbar .nav-dropdown-menu a:hover{background:rgba(var(--brand-contrast-rgb),.09);color:var(--brand-contrast)}.entry-grid,.settings-grid{grid-template-columns:1fr}}


/* Update 7: Navigation exakt ausrichten + deutlichere Dropdown-Pfeile */
@media (min-width:901px){
  .topbar .main-nav{align-items:center;gap:18px;flex-wrap:nowrap}
  .topbar .main-nav>a,
  .topbar .nav-dropdown-toggle{
    min-height:42px;
    padding:8px 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    line-height:1.2;
    margin:0;
  }
  .topbar .nav-dropdown{height:42px;align-items:center}
}
.nav-dropdown-toggle{line-height:1.2}
.nav-caret{
  display:inline-block;
  width:9px;
  height:9px;
  margin-left:3px;
  flex:0 0 auto;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transform-origin:center;
  transition:transform .18s ease;
}
.nav-dropdown.is-open>.nav-dropdown-toggle .nav-caret{
  transform:rotate(225deg) translate(-1px,-1px);
}
@media(max-width:900px){
  .topbar .main-nav{align-items:stretch}
  .topbar .main-nav>a,
  .topbar .nav-dropdown-toggle{
    min-height:46px;
    display:flex;
    align-items:center;
    line-height:1.25;
    margin:0;
  }
  .topbar .main-nav>a{padding:11px 12px}
  .nav-dropdown{height:auto}
  .nav-caret{
    width:11px;
    height:11px;
    border-right-width:2.5px;
    border-bottom-width:2.5px;
    margin-left:10px;
    margin-right:4px;
  }
}

/* Security update: logout is a CSRF-protected POST form while keeping nav appearance. */
.nav-logout{margin:0;display:flex;align-items:stretch}
.nav-logout-button{appearance:none;border:0;background:transparent;color:inherit;font:inherit;font-weight:700;padding:0 14px;cursor:pointer;display:flex;align-items:center;min-height:48px}
.nav-logout-button:hover,.nav-logout-button:focus-visible{background:rgba(var(--brand-contrast-rgb),.08)}
@media(max-width:900px){.nav-logout{width:100%}.nav-logout-button{width:100%;justify-content:flex-start;padding:14px 16px}}

/* Update 9: Logout als klar erkennbarer Button */
.nav-logout{
  margin:0;
  display:flex;
  align-items:center;
}
.nav-logout-button{
  appearance:none;
  border:1.5px solid rgba(var(--brand-contrast-rgb),.82);
  background:transparent;
  color:var(--brand-contrast);
  font:inherit;
  font-weight:700;
  line-height:1.2;
  min-height:42px;
  padding:8px 15px;
  border-radius:9px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.nav-logout-button:hover{
  background:var(--brand-contrast);
  color:var(--brand);
  border-color:var(--brand-contrast);
}
.nav-logout-button:focus-visible{
  outline:3px solid rgba(var(--brand-contrast-rgb),.3);
  outline-offset:2px;
  background:var(--brand-contrast);
  color:var(--brand);
  border-color:var(--brand-contrast);
}
@media(max-width:900px){
  .nav-logout{
    width:100%;
    padding:7px 12px 2px;
  }
  .nav-logout-button{
    width:100%;
    min-height:46px;
    justify-content:center;
    padding:11px 16px;
    border-color:rgba(var(--brand-contrast-rgb),.72);
  }
}


/* Update 10: kompakter Power-Off-Icon-Button für den sicheren Logout */
.sr-only{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.nav-logout{padding:0}
.nav-logout-button{
  width:42px;
  height:42px;
  min-width:42px;
  min-height:42px;
  padding:0;
  border-radius:10px;
}
.nav-logout-icon{
  width:23px;
  height:23px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2.15;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none;
}
@media(max-width:900px){
  .nav-logout{
    width:100%;
    padding:8px 12px 3px;
    justify-content:flex-start;
  }
  .nav-logout-button{
    width:48px;
    min-width:48px;
    height:48px;
    min-height:48px;
    padding:0;
    justify-content:center;
    border-radius:10px;
  }
  .nav-logout-icon{width:26px;height:26px}
}

/* Update 13: E-Mail-Erinnerungsverlauf in der Rechnungsansicht */
.notification-history{margin-top:0}.notification-history .panelhead{align-items:flex-start}.notification-history .panelhead p{margin:5px 0 0}.history-table{min-width:760px}.badge.sent{background:#dcfae6;color:#067647}.badge.failed{background:#fef3f2;color:#b42318}.badge.logged{background:var(--primary-soft);color:var(--primary)}

/* Update 16: balanced invoice edit layout for wide screens */
.invoice-edit-layout{display:grid;grid-template-columns:minmax(520px,.9fr) minmax(620px,1.1fr);gap:28px;align-items:start;max-width:1480px;margin:0 auto}.invoice-edit-layout>.panel,.invoice-edit-layout .panel{margin-bottom:0}.invoice-form-panel{min-width:0}.invoice-sidebar{min-width:0}.invoice-sidebar .notification-history{position:sticky;top:104px}.invoice-sidebar .history-table{min-width:0}.invoice-sidebar .history-table th,.invoice-sidebar .history-table td{padding:12px 9px}.invoice-sidebar .history-table th:nth-child(1){width:17%}.invoice-sidebar .history-table th:nth-child(2){width:29%}.invoice-sidebar .history-table th:nth-child(3){width:26%}.invoice-sidebar .history-table th:nth-child(4){width:28%}.invoice-pagehead{max-width:1480px;margin-left:auto;margin-right:auto}
@media(min-width:1350px){.container:has(.invoice-edit-layout){max-width:1540px}.invoice-form-panel{padding:26px}.invoice-sidebar .notification-history{padding:26px}}
@media(max-width:1180px){.invoice-edit-layout{grid-template-columns:1fr}.invoice-sidebar .notification-history{position:static}.invoice-sidebar .history-table{min-width:760px}}
@media(max-width:700px){.invoice-edit-layout{gap:18px}.invoice-form-panel,.invoice-sidebar .notification-history{padding:18px}.invoice-sidebar .history-table{min-width:680px}}

/* Update 17: Notiz-Historie in der rechten Rechnungsspalte */
.invoice-sidebar{display:flex;flex-direction:column;gap:22px}
.invoice-sidebar .notification-history{position:static;top:auto}
.note-history{margin:0}
.note-history .panelhead{align-items:flex-start}
.note-history .panelhead p{margin:5px 0 0}
.note-add-form{padding-bottom:20px;border-bottom:1px solid var(--line);margin-bottom:4px}
.note-add-form textarea{resize:vertical;min-height:86px}
.note-timeline{display:flex;flex-direction:column}
.note-entry{position:relative;padding:18px 0 18px 22px;border-bottom:1px solid var(--line)}
.note-entry:last-child{border-bottom:0;padding-bottom:4px}
.note-entry:before{content:"";position:absolute;left:2px;top:25px;width:9px;height:9px;border-radius:50%;background:var(--primary)}
.note-entry:after{content:"";position:absolute;left:6px;top:34px;bottom:-1px;width:1px;background:var(--line)}
.note-entry:last-child:after{display:none}
.note-entry-meta{display:flex;justify-content:space-between;gap:16px;align-items:baseline;margin-bottom:7px}
.note-entry-meta time{color:var(--muted);font-size:13px;white-space:nowrap}
.note-entry-text{line-height:1.55;overflow-wrap:anywhere}
.note-empty{text-align:left;padding:20px 0 4px}
@media(min-width:1350px){.invoice-sidebar .note-history,.invoice-sidebar .notification-history{padding:26px}}
@media(max-width:700px){.invoice-sidebar .note-history,.invoice-sidebar .notification-history{padding:18px}.note-entry-meta{flex-direction:column;gap:3px}.note-entry-meta time{white-space:normal}}


/* Update 18: hochwertiger Hinweis-Schalter in der Benutzer:innenverwaltung */
.notify-toggle{
  appearance:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-width:92px;
  justify-content:flex-start;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:13px;
  font-weight:750;
  line-height:1;
  cursor:pointer;
  box-shadow:none;
  transform:none;
  transition:background-color .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease;
}
.notify-toggle-dot{
  width:9px;
  height:9px;
  flex:0 0 9px;
  border-radius:50%;
  background:currentColor;
  box-shadow:0 0 0 3px rgba(255,255,255,.55);
}
.notify-toggle.is-on{
  background:#e9f7ef;
  border-color:#b7e4c7;
  color:#176b43;
}
.notify-toggle.is-on:hover{
  background:#dff2e7;
  border-color:#8fd0a8;
  color:#115536;
  box-shadow:0 0 0 3px rgba(23,107,67,.08);
}
.notify-toggle.is-off{
  background:#f2f4f7;
  border-color:#d0d5dd;
  color:#667085;
}
.notify-toggle.is-off:hover{
  background:var(--primary-soft);
  border-color:#aac1c6;
  color:var(--primary-dark);
  box-shadow:0 0 0 3px rgba(var(--primary-rgb),.08);
}
.notify-toggle:focus-visible{
  outline:3px solid rgba(var(--primary-rgb),.18);
  outline-offset:2px;
}
.notify-toggle:active{
  transform:none;
  box-shadow:none;
}
@media(max-width:560px){
  .notify-toggle{min-height:38px;padding:8px 12px}
}

/* Update 19: klarer Notiz-Indikator und mobile Rechnungskarten */
.note-indicator{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:30px;
  min-height:30px;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
  line-height:1;
}
.note-indicator svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.note-indicator.has-note{
  color:var(--primary-dark);
  background:var(--primary-soft);
  border:1px solid #c4d4d7;
  padding:5px 7px;
  cursor:help;
}
.note-indicator.has-note:hover{
  background:#dfeaec;
  border-color:#9db8be;
}
.note-indicator.has-note span{display:none}
.note-indicator.no-note{color:#98a2b3;background:transparent}

@media(max-width:760px){
  .invoice-tablewrap{
    overflow:visible;
    border:0;
    background:transparent;
  }
  .invoice-table{
    display:block;
    min-width:0!important;
    width:100%;
  }
  .invoice-table thead{display:none}
  .invoice-table tbody{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  .invoice-table tr.invoice-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px 14px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    box-shadow:0 1px 2px rgba(16,24,40,.04);
  }
  .invoice-table tr.invoice-row td{
    display:grid;
    grid-template-columns:112px minmax(0,1fr);
    gap:10px;
    align-items:baseline;
    width:auto;
    padding:0;
    border:0;
    min-width:0;
    text-align:left;
    overflow-wrap:anywhere;
  }
  .invoice-table tr.invoice-row td::before{
    content:attr(data-label);
    color:var(--muted);
    font-size:11px;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:uppercase;
  }
  .invoice-table tr.invoice-row td.invoice-debtor{
    display:block;
    grid-column:1/2;
    grid-row:1;
    font-size:17px;
    line-height:1.3;
  }
  .invoice-table tr.invoice-row td.invoice-debtor::before{display:none}
  .invoice-table tr.invoice-row td.invoice-debtor a{display:block}
  .invoice-table tr.invoice-row td.invoice-status{
    display:block;
    grid-column:2/3;
    grid-row:1;
    justify-self:end;
    align-self:start;
    white-space:nowrap;
  }
  .invoice-table tr.invoice-row td.invoice-status::before{display:none}
  .invoice-table tr.invoice-row td.invoice-amount{
    grid-column:1/-1;
    order:2;
    font-size:18px;
    font-weight:800;
    color:var(--primary-dark);
    padding:12px 0;
    margin:2px 0;
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
  }
  .invoice-table tr.invoice-row td:not(.invoice-debtor):not(.invoice-status):not(.invoice-amount){grid-column:1/-1}
  .invoice-table tr.invoice-row td.invoice-note{
    align-items:center;
  }
  .invoice-table .note-indicator.has-note{
    justify-self:start;
    min-height:28px;
    padding:5px 9px;
  }
  .invoice-table .note-indicator.has-note span{display:inline}
  .invoice-table tr.invoice-empty-row{display:block}
  .invoice-table tr.invoice-empty-row td{display:block;padding:18px}
}

@media(max-width:430px){
  .invoice-table tr.invoice-row{grid-template-columns:minmax(0,1fr);padding:14px}
  .invoice-table tr.invoice-row td.invoice-debtor,
  .invoice-table tr.invoice-row td.invoice-status{grid-column:1;grid-row:auto;justify-self:start}
  .invoice-table tr.invoice-row td.invoice-status{margin-top:-2px}
  .invoice-table tr.invoice-row td{grid-template-columns:102px minmax(0,1fr);gap:8px}
}


/* Update 20: komplette Rechnungszeilen und mobile Karten klickbar */
.invoice-table tr.invoice-row-link{
  cursor:pointer;
}
.invoice-table tr.invoice-row-link td{
  transition:background-color .16s ease;
}
.invoice-table tr.invoice-row-link:hover td{
  background:#f5f9fa;
}
.invoice-table tr.invoice-row-link:focus-visible{
  outline:3px solid rgba(var(--primary-rgb),.22);
  outline-offset:2px;
}
.invoice-table tr.invoice-row-link:focus-visible td{
  background:#f5f9fa;
}
.invoice-table tr.invoice-row-link:active td{
  background:#edf4f5;
}

@media(max-width:760px){
  .invoice-table tr.invoice-row-link{
    transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background-color .16s ease;
  }
  .invoice-table tr.invoice-row-link:hover{
    transform:translateY(-1px);
    border-color:#b5c9cd;
    box-shadow:0 5px 14px rgba(16,24,40,.08);
  }
  .invoice-table tr.invoice-row-link:hover td,
  .invoice-table tr.invoice-row-link:focus-visible td{
    background:transparent;
  }
  .invoice-table tr.invoice-row-link:active{
    transform:translateY(0);
    background:#f4f8f9;
    box-shadow:0 1px 2px rgba(16,24,40,.04);
  }
}


/* Update 22: einheitliche Seitenbreite im gesamten Portal */
.invoice-pagehead,
.invoice-edit-layout{
  max-width:none;
  width:100%;
}

.invoice-edit-layout{
  grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);
  gap:24px;
}

@media(min-width:1350px){
  .container:has(.invoice-edit-layout){max-width:1240px}
}

@media(max-width:1180px){
  .invoice-edit-layout{grid-template-columns:1fr}
}


/* Mobile Rechnungsübersicht – lange Labels nicht umbrechen. */
@media(max-width:760px){
  .invoice-table tr.invoice-row td{
    grid-template-columns:max-content minmax(0,1fr);
    column-gap:14px;
  }
  .invoice-table tr.invoice-row td::before{
    white-space:nowrap;
  }
}

@media(max-width:430px){
  .invoice-table tr.invoice-row td{
    grid-template-columns:max-content minmax(0,1fr);
    column-gap:12px;
  }
}

/* Update 25: dieselbe mobile Datumsdarstellung auch beim Bearbeiten einer Rechnung. */

/* Update 26: Portal-Module + Keep */
.module-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;max-width:980px}
.module-card{display:flex;gap:18px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:16px;padding:24px;color:var(--text);text-decoration:none;box-shadow:0 1px 2px rgba(16,24,40,.04);transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.module-card:hover{border-color:#aac1c6;box-shadow:0 8px 24px rgba(16,24,40,.08);transform:translateY(-1px)}
.module-card h2{margin:0 0 6px;font-size:22px}.module-card p{margin:0 0 12px;color:var(--muted)}.module-card strong{color:var(--primary-dark)}
.module-icon{display:grid;place-items:center;width:50px;height:50px;flex:0 0 50px;border-radius:14px;background:var(--primary-soft);color:var(--primary-dark);font-size:22px;font-weight:850}.keep-module-icon{font-size:25px}

.user-admin-layout{display:grid;grid-template-columns:minmax(0,2.2fr) minmax(320px,.8fr);gap:22px;align-items:start}.user-admin-layout>.panel{margin:0}.user-table{min-width:1180px}.module-permission-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.module-check{display:inline-flex;align-items:center;gap:6px;margin:0;padding:6px 9px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:12px;font-weight:700;cursor:pointer}.module-check input{width:auto;margin:0}.module-check:has(input:checked){background:var(--primary-soft);border-color:#aac1c6;color:var(--primary-dark)}.module-save{padding:7px 9px;font-size:12px}.module-fieldset{border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin:0 0 16px}.module-fieldset legend{font-weight:750;padding:0 5px}.module-fieldset .check{margin:8px 0}

.keep-pagehead{margin-bottom:18px}.keep-compose{padding:18px 20px}.keep-compose-form{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(260px,.75fr);gap:22px}.keep-compose-form label{margin-bottom:12px}.keep-compose-main textarea{min-height:84px}.keep-compose-meta{display:flex;flex-direction:column}.keep-compose-meta button{margin-top:auto;min-height:42px}
.keep-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;margin:0 0 20px}.keep-tabs,.keep-status-filter{display:flex;gap:6px;flex-wrap:wrap}.keep-tabs a,.keep-status-filter a{display:inline-flex;align-items:center;min-height:38px;padding:7px 11px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--muted);font-size:13px;font-weight:750;text-decoration:none}.keep-tabs a.active,.keep-status-filter a.active{background:var(--primary-soft);border-color:#aac1c6;color:var(--primary-dark)}
.keep-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(285px,1fr));gap:16px;align-items:start}.keep-card{position:relative;display:flex;flex-direction:column;min-height:210px;background:#fff;border:1px solid #d9dee5;border-radius:15px;padding:18px;box-shadow:0 1px 2px rgba(16,24,40,.04);transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.keep-card:hover{border-color:#aac1c6;box-shadow:0 7px 22px rgba(16,24,40,.08);transform:translateY(-1px)}.keep-card.is-done{background:#f8fafb}.keep-card.is-done .keep-card-body h2,.keep-card.is-done .keep-card-body p{color:#667085;text-decoration:line-through;text-decoration-thickness:1px}.keep-card.is-overdue{border-color:#efb5b0}
.keep-card-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.keep-check-form{margin:0}.keep-check{width:34px;height:34px;padding:0;border-radius:50%;background:#fff;border:1.5px solid #b9c1ca;color:transparent;display:grid;place-items:center}.keep-check:hover{background:var(--primary-soft);border-color:var(--primary)}.keep-check.checked{background:var(--primary);border-color:var(--primary);color:#fff}.keep-check svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.keep-card-edit{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;color:var(--muted);font-weight:900;text-decoration:none;letter-spacing:1px}.keep-card-edit:hover{background:#f2f4f7;color:var(--text)}
.keep-card-body{display:block;color:var(--text);text-decoration:none;min-width:0}.keep-card-body h2{font-size:19px;margin:0 0 9px;overflow-wrap:anywhere}.keep-card-body p{margin:0 0 18px;line-height:1.5;overflow-wrap:anywhere}.keep-card-meta{display:flex;flex-direction:column;gap:6px;margin-top:auto;padding-top:14px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}.keep-card-meta strong{color:#475467}.keep-due.today{color:#8a4b00}.keep-due.overdue{color:#b42318;font-weight:700}.keep-done-meta{margin-top:10px;padding-top:10px;border-top:1px dashed var(--line);font-size:12px;color:var(--success)}.keep-empty{text-align:center;padding:38px}.keep-empty h2{margin-bottom:5px}
.keep-edit-panel{max-width:850px}.keep-edit-meta{display:grid;grid-template-columns:1fr 1fr;gap:14px}.keep-delete-form{margin-top:28px;padding-top:20px;border-top:1px solid var(--line)}.danger-button{background:#fff;color:var(--danger);border:1px solid #f0b6b2}.danger-button:hover{background:#fef3f2;color:#912018}

@media(max-width:980px){.user-admin-layout{grid-template-columns:1fr}.keep-compose-form{grid-template-columns:1fr}.keep-compose-meta button{margin-top:0}.module-grid{grid-template-columns:1fr}}
@media(max-width:620px){.module-card{padding:18px}.keep-compose{padding:16px}.keep-grid{grid-template-columns:1fr}.keep-card{min-height:0}.keep-toolbar{align-items:flex-start}.keep-tabs,.keep-status-filter{width:100%}.keep-tabs a,.keep-status-filter a{flex:1 1 auto;justify-content:center;text-align:center}.keep-edit-meta{grid-template-columns:1fr}.keep-compose-meta input[type=date],.keep-edit-meta input[type=date]{min-height:46px}}

/* Update 27: Keep – Uhrzeit, Notiz-Historie und zweispaltige Detailansicht */
.keep-due-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.keep-due-fields label{min-width:0}.keep-due-fields input{min-width:0}.keep-note-count{color:var(--primary-dark)}
.keep-edit-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr);gap:22px;align-items:start}.keep-edit-layout .keep-edit-panel{max-width:none;margin:0}.keep-side{min-width:0}.keep-note-panel{margin:0;position:sticky;top:18px}.keep-note-panel h2{margin-top:0}.keep-note-form{padding-bottom:18px;border-bottom:1px solid var(--line)}.keep-note-form button{width:100%}.keep-note-history{display:flex;flex-direction:column;gap:12px;margin-top:16px}.keep-note-item{padding:13px 14px;border:1px solid var(--line);border-radius:11px;background:var(--surface-soft);color:var(--text);line-height:1.45;overflow-wrap:anywhere}.keep-note-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline;margin-bottom:7px;font-size:12px}.keep-note-head strong{font-size:13px;color:var(--primary-emphasis)}.keep-note-head time{color:var(--muted);white-space:nowrap}
.keep-edit-meta{grid-template-columns:1fr 1fr 1fr}
@media(max-width:980px){.keep-edit-layout{grid-template-columns:1fr}.keep-note-panel{position:static}.keep-edit-meta{grid-template-columns:1fr 1fr}}
@media(max-width:620px){.keep-due-fields,.keep-edit-meta{grid-template-columns:1fr}.keep-compose-meta input[type=time],.keep-edit-meta input[type=time]{min-height:46px;font-size:16px}.keep-note-head{flex-direction:column;gap:2px}}

/* Update 28: Focus detail status / completion */
.keep-detail-status{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 22px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:#f8fafb}.keep-detail-status>div{display:flex;flex-direction:column;gap:2px}.keep-status-label{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.04em}.keep-detail-status strong{font-size:17px}.keep-detail-toggle{margin:0}.keep-complete-button{white-space:nowrap}@media(max-width:620px){.keep-detail-status{align-items:stretch;flex-direction:column}.keep-detail-toggle .button,.keep-detail-toggle button{width:100%;justify-content:center}}

/* Focus: gemeinsame Historie aus Notizen und Statusereignissen */
.keep-history-event{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px 0;
  border-top:1px solid var(--border,#e3e8e9);
  color:var(--text);
}
.keep-history-event:first-child{border-top:0}
.keep-history-event-icon{
  width:30px;
  height:30px;
  flex:0 0 30px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-weight:800;
  background:#eaf1f2;
  color:var(--primary);
}
.keep-history-event.completed .keep-history-event-icon{
  background:#e8f5ec;
  color:#26713d;
}
.keep-history-event.reopened .keep-history-event-icon{
  background:#eef2f3;
  color:var(--primary);
}
.keep-history-event time{
  display:block;
  margin-top:3px;
  color:var(--muted,#6f7f82);
  font-size:.82rem;
}

/* Update 31: vollständige Aufgaben-Änderungshistorie */
.keep-history-event-content{min-width:0;flex:1}
.keep-history-event.created .keep-history-event-icon{background:#eef5f6;color:var(--primary)}
.keep-history-event.changed .keep-history-event-icon{background:#f1f5f5;color:var(--primary)}
.keep-change-values{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:9px}
.keep-change-values>div{min-width:0;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:#f8fafb;overflow-wrap:anywhere;white-space:normal}
.keep-change-values span{display:block;margin-bottom:3px;font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.keep-change-values>div:last-child{background:#f1f7f7;border-color:#ceddde}
@media(max-width:520px){.keep-change-values{grid-template-columns:1fr}}

/* Update 32: Mehrfach-Zuweisung Aufgaben */
.assignee-fieldset{border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:0;min-width:0}
.assignee-fieldset legend{padding:0 6px;font-weight:700;color:var(--text)}
.assignee-checks{display:flex;flex-wrap:wrap;gap:8px;max-height:170px;overflow:auto;padding:2px}
.assignee-check{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:999px;padding:8px 11px;background:#fff;cursor:pointer;font-weight:600;font-size:14px}
.assignee-check:has(input:checked){background:#eef5f5;border-color:#9db9bd;color:#294e56}
.assignee-check input{margin:0;accent-color:var(--primary)}
@media(max-width:600px){.assignee-checks{display:grid;grid-template-columns:1fr;max-height:none}.assignee-check{border-radius:10px;min-height:44px}}
.keep-edit-meta .assignee-fieldset{grid-column:1/-1}

/* Update 35: Aufgaben Benutzer:innen-Auswahl */
.assignee-fieldset{
  padding:14px;
  border-radius:14px;
  background:#fbfcfd;
}
.assignee-fieldset legend{
  padding:0 8px;
  font-size:15px;
  font-weight:750;
}
.assignee-checks{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:9px;
  max-height:210px;
  overflow:auto;
  padding:2px;
}
form label.assignee-check{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-width:0;
  min-height:46px;
  margin:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  font-size:14px;
  font-weight:650;
  line-height:1.25;
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
form label.assignee-check:hover{
  border-color:#b7c9cd;
  background:#f7fafb;
}
form label.assignee-check:has(input:checked){
  border-color:#8faeb4;
  background:var(--primary-soft);
  color:var(--primary-dark);
  box-shadow:inset 0 0 0 1px rgba(var(--primary-rgb),.06);
}
.assignee-check input[type="checkbox"]{
  display:block;
  width:18px;
  height:18px;
  min-width:18px;
  flex:0 0 18px;
  margin:0;
  padding:0;
  accent-color:var(--primary);
  cursor:pointer;
}
.assignee-check span{
  display:block;
  min-width:0;
  overflow-wrap:break-word;
}
.assignee-check:focus-within{
  outline:3px solid rgba(var(--primary-rgb),.14);
  outline-offset:1px;
}
@media(max-width:700px){
  .assignee-checks{grid-template-columns:1fr;max-height:none}
  form label.assignee-check{min-height:48px;padding:11px 12px}
}

/* Update 36: skalierbares Multi-Select-Dropdown für Aufgaben-Zuweisungen */
.assignee-fieldset{overflow:visible;background:transparent;padding:0;border:0}
.assignee-fieldset legend{padding:0;margin:0 0 7px;font-size:15px;font-weight:750}
.assignee-dropdown{position:relative;min-width:0}
.assignee-dropdown-toggle{
  display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:48px;
  padding:11px 14px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--text);
  font:inherit;font-weight:650;text-align:left;cursor:pointer;transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.assignee-dropdown-toggle:hover{border-color:#9db9bd;background:#fbfdfd}
.assignee-dropdown-toggle:focus-visible{outline:3px solid rgba(var(--primary-rgb),.16);outline-offset:1px;border-color:var(--primary)}
.assignee-dropdown-arrow{width:10px;height:10px;flex:0 0 10px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .16s ease}
.assignee-dropdown.is-open .assignee-dropdown-arrow{transform:rotate(225deg) translate(-2px,-2px)}
.assignee-dropdown-menu{
  position:absolute;z-index:30;left:0;right:0;top:calc(100% + 7px);padding:10px;border:1px solid #cbd7da;border-radius:12px;
  background:#fff;box-shadow:0 14px 34px rgba(20,45,51,.14);
}
.assignee-search-label{display:block;margin:0 0 8px}
.assignee-search{width:100%;min-height:42px;margin:0!important;padding:9px 11px!important;border-radius:9px!important;font-size:16px!important}
.assignee-dropdown .assignee-checks{display:grid;grid-template-columns:1fr;gap:4px;max-height:260px;overflow:auto;padding:2px}
.assignee-dropdown form label.assignee-check,.assignee-dropdown label.assignee-check{
  min-height:42px;padding:8px 10px;border-color:transparent;border-radius:8px;background:#fff;font-size:14px;
}
.assignee-dropdown label.assignee-check:hover{background:#f5f9f9;border-color:#e1e9ea}
.assignee-dropdown label.assignee-check:has(input:checked){background:var(--primary-soft);border-color:#b9ced2;box-shadow:none}
.assignee-check.is-filtered-out{display:none!important}
.assignee-dropdown-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;padding:8px 2px 0;border-top:1px solid var(--line)}
.assignee-selected-summary{font-size:12px;color:var(--muted);min-width:0}
.assignee-dropdown-done{min-height:36px;padding:7px 12px;border:0;border-radius:8px;background:var(--primary);color:#fff;font:inherit;font-size:13px;font-weight:750;cursor:pointer}
.assignee-dropdown-done:hover{background:var(--primary-dark)}
@media(max-width:700px){
  .assignee-dropdown-menu{position:static;margin-top:7px;box-shadow:none}
  .assignee-dropdown .assignee-checks{max-height:230px}
  .assignee-dropdown-toggle{min-height:50px}
}

/* Update 37: Aufgaben – mobile Fälligkeitsfelder für Erstellen + Bearbeiten */
@media(max-width:700px){
  .keep-due-fields,
  .keep-edit-meta{
    grid-template-columns:1fr!important;
    gap:12px;
  }

  .keep-due-fields label,
  .keep-edit-meta > label{
    display:block;
    width:100%;
    min-width:0;
    margin:0;
  }

  .keep-due-fields input[type="date"],
  .keep-due-fields input[type="time"],
  .keep-edit-meta input[type="date"],
  .keep-edit-meta input[type="time"]{
    display:block;
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
    min-height:50px;
    margin-top:7px;
    padding:11px 13px;
    font-size:16px;
    line-height:1.2;
    border-radius:10px;
    background:#fff;
    -webkit-appearance:none;
    appearance:none;
  }

  /* Safari/iOS hält bei Date/Time-Inputs sonst teils eine zu große interne Breite fest. */
  .keep-due-fields input[type="date"]::-webkit-date-and-time-value,
  .keep-due-fields input[type="time"]::-webkit-date-and-time-value,
  .keep-edit-meta input[type="date"]::-webkit-date-and-time-value,
  .keep-edit-meta input[type="time"]::-webkit-date-and-time-value{
    text-align:left;
    min-height:1.2em;
  }

  .keep-due-fields input[type="date"]::-webkit-calendar-picker-indicator,
  .keep-due-fields input[type="time"]::-webkit-calendar-picker-indicator,
  .keep-edit-meta input[type="date"]::-webkit-calendar-picker-indicator,
  .keep-edit-meta input[type="time"]::-webkit-calendar-picker-indicator{
    margin:0;
    padding:5px;
  }
}

/* Update 39: Aufgaben – großzügigere mobile Formulare und klarer Abstand zum Submit */
@media(max-width:700px){
  /* Auf Mobilgeräten lieber etwas weniger Inhalt pro Zeile und mehr vertikale Luft. */
  .keep-compose{
    padding:20px 18px;
  }
  .keep-compose-form{
    gap:22px;
  }
  .keep-compose-main label{
    margin-bottom:18px;
  }
  .keep-compose-main label:last-child{
    margin-bottom:0;
  }
  .keep-compose-meta{
    gap:18px;
  }
  .keep-compose-meta .assignee-fieldset{
    margin-bottom:0;
  }
  .keep-due-fields{
    gap:16px!important;
  }
  .keep-due-fields label{
    margin-bottom:0;
  }
  .keep-primary-submit{
    display:flex;
    width:100%;
    min-height:50px!important;
    margin-top:10px!important;
    align-items:center;
    justify-content:center;
    font-size:15px;
  }

  /* Aufgabe bearbeiten: dieselbe entspannte vertikale Rhythmik wie beim Anlegen. */
  .keep-edit-panel{
    padding:20px 18px;
  }
  .keep-edit-form > label{
    margin-bottom:18px;
  }
  .keep-edit-meta{
    gap:16px!important;
    margin-top:2px;
    margin-bottom:0;
  }
  .keep-edit-meta > label,
  .keep-edit-meta > .assignee-fieldset{
    margin-bottom:0;
  }
  .keep-edit-form > .keep-primary-submit{
    margin-top:22px!important;
  }

  /* Auch die Detailseite insgesamt bekommt etwas mehr Abstand zwischen ihren Blöcken. */
  .keep-edit-layout{
    gap:22px;
  }
  .keep-detail-status{
    margin-bottom:24px;
  }
  .keep-note-panel{
    padding:20px 18px;
  }
}

@media(max-width:380px){
  .keep-compose,
  .keep-edit-panel,
  .keep-note-panel{
    padding:18px 16px;
  }
}

/* Update 40: Mobile Branding aus Update 38 + einklappbare neue Aufgabe */
@media (max-width:560px){
  .topbar{padding:11px 14px}
  .brand{gap:9px;max-width:calc(100% - 56px)}
  .brandlogo{width:108px;max-width:34vw;max-height:46px}
  .brandname{font-size:17px;line-height:1.15;padding-left:10px;font-weight:800}
  .nav-toggle{width:44px;height:44px}
  .nav-toggle span{width:23px;height:2.5px}
}
@media (max-width:360px){
  .brandlogo{width:100px;max-width:32vw}
  .brandname{font-size:16px;padding-left:8px}
}

.keep-compose-toggle{display:none}
@media(max-width:700px){
  .keep-compose[data-task-compose]{padding:0;overflow:visible}
  .keep-compose-toggle{
    width:100%;
    min-height:66px;
    padding:14px 18px;
    border:0;
    border-radius:inherit;
    background:transparent;
    color:inherit;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    text-align:left;
    cursor:pointer;
  }
  .keep-compose-toggle:hover{background:rgba(var(--primary-rgb),.06)}
  .keep-compose-toggle:focus-visible{outline:3px solid rgba(var(--primary-rgb),.22);outline-offset:-3px}
  .keep-compose-toggle span:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}
  .keep-compose-toggle strong{font-size:16px;line-height:1.25}
  .keep-compose-toggle small{font-size:13px;color:var(--muted,#64748b);font-weight:500}
  .keep-compose-toggle-icon{
    width:12px;height:12px;flex:0 0 auto;
    border-right:2px solid currentColor;border-bottom:2px solid currentColor;
    transform:rotate(45deg) translateY(-2px);
    transition:transform .18s ease;
  }
  .keep-compose.is-open .keep-compose-toggle-icon{transform:rotate(225deg) translate(-2px,-2px)}
  .keep-compose-body{display:none;border-top:1px solid var(--border,#e5e7eb)}
  .keep-compose.is-open .keep-compose-body{display:block}
  .keep-compose .keep-compose-body .keep-compose-form{padding:20px 18px}
  .keep-compose .keep-compose-body .keep-compose-form{margin:0}
  .keep-compose .keep-compose-body .keep-compose-main,
  .keep-compose .keep-compose-body .keep-compose-meta{min-width:0}
}
@media(max-width:380px){
  .keep-compose-toggle{padding:13px 16px}
  .keep-compose .keep-compose-body .keep-compose-form{padding:18px 16px}
}

/* Update 41: responsive Benutzer:innenverwaltung */
@media(max-width:760px){
  .user-admin-layout{gap:18px}
  .user-admin-layout>.panel{padding:18px}
  .user-admin-layout .tablewrap{overflow:visible;margin:0}
  .user-table{min-width:0;width:100%;border:0;border-collapse:separate;border-spacing:0}
  .user-table thead{display:none}
  .user-table tbody{display:grid;gap:14px}
  .user-table tr{
    display:block;
    padding:16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
  }
  .user-table td{
    display:grid;
    grid-template-columns:minmax(104px,auto) minmax(0,1fr);
    gap:12px;
    align-items:start;
    padding:10px 0;
    border:0;
    border-bottom:1px solid #edf1f2;
    min-width:0;
    overflow-wrap:anywhere;
  }
  .user-table td:first-child{padding-top:0}
  .user-table td:last-child{padding-bottom:0;border-bottom:0}
  .user-table td::before{
    content:attr(data-label);
    color:var(--muted);
    font-size:11px;
    font-weight:800;
    letter-spacing:.045em;
    line-height:1.35;
    text-transform:uppercase;
  }
  .user-table td[data-label="Name"] strong{font-size:16px;line-height:1.35}
  .user-table .module-permission-form{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    align-items:stretch;
    min-width:0;
  }
  .user-table .module-check{
    width:100%;
    min-height:42px;
    justify-content:flex-start;
    border-radius:10px;
    padding:9px 11px;
  }
  .user-table .module-save{width:100%;min-height:42px}
  .user-table .notify-toggle{min-width:0;width:auto;min-height:42px}
  .user-create-panel form>button{width:100%;min-height:46px}
}

@media(max-width:430px){
  .user-table td{grid-template-columns:1fr;gap:5px}
  .user-table td::before{margin-bottom:1px}
  .user-table tr{padding:15px}
}

/* Update 42: Benutzer:in anlegen oben + mobil einklappbar; größeres mobiles Branding */
.user-admin-layout{
  grid-template-columns:1fr;
}
.user-create-panel{
  order:-1;
}
.user-create-toggle{
  display:none;
}
.user-create-body{
  display:block;
}
.user-create-panel form{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0 18px;
}
.user-create-panel form > input[type="hidden"],
.user-create-panel form > .module-fieldset,
.user-create-panel form > .check,
.user-create-panel form > button{
  grid-column:1 / -1;
}
.user-create-panel form > button{
  justify-self:start;
}

@media(max-width:700px){
  .user-create-panel{
    padding:0!important;
    overflow:hidden;
  }
  .user-create-toggle{
    display:flex;
    width:100%;
    min-height:66px;
    padding:14px 18px;
    border:0;
    border-radius:inherit;
    background:transparent;
    color:inherit;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    text-align:left;
  }
  .user-create-toggle:hover{background:rgba(var(--primary-rgb),.06)}
  .user-create-toggle:focus-visible{outline:3px solid rgba(var(--primary-rgb),.22);outline-offset:-3px}
  .user-create-toggle > span:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}
  .user-create-toggle strong{font-size:16px;line-height:1.25}
  .user-create-toggle small{font-size:13px;color:var(--muted);font-weight:500}
  .user-create-toggle-icon{
    width:12px;height:12px;flex:0 0 auto;
    border-right:2px solid currentColor;border-bottom:2px solid currentColor;
    transform:rotate(45deg) translateY(-2px);
    transition:transform .18s ease;
  }
  .user-create-panel.is-open .user-create-toggle-icon{transform:rotate(225deg) translate(-2px,-2px)}
  .user-create-body{display:none;border-top:1px solid var(--line);padding:20px 18px}
  .user-create-panel.is-open .user-create-body{display:block}
  .user-create-desktop-title{display:none}
  .user-create-panel form{display:block}
  .user-create-panel form > button{width:100%;min-height:48px}
}

@media(max-width:560px){
  .topbar{padding:11px 14px}
  .brand{gap:10px;max-width:calc(100% - 58px)}
  .brandlogo{width:124px;max-width:37vw;max-height:50px}
  .brandname{font-size:20px;line-height:1.1;padding-left:11px;font-weight:800}
  .nav-toggle{width:46px;height:46px}
  .nav-toggle span{width:24px;height:2.5px}
}
@media(max-width:380px){
  .brandlogo{width:112px;max-width:35vw}
  .brandname{font-size:18px;padding-left:9px}
  .user-create-toggle{padding:13px 16px}
  .user-create-body{padding:18px 16px}
}

/* Update 43: Kontostatus & Passwort-Reset */
.user-row-locked{opacity:.72;background:rgba(17,24,39,.025)}
.user-status-badge{display:inline-flex;align-items:center;margin-left:8px;padding:3px 7px;border-radius:999px;font-size:11px;font-weight:800;vertical-align:middle;white-space:nowrap}
.user-status-badge.is-locked{background:#f1f3f5;color:#5d6673;border:1px solid #d9dee4}
.user-status-badge.is-reset{background:#fff3d9;color:#8b5a09;border:1px solid #f1d9a7}
.user-account-controls{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:190px}
.account-toggle{min-height:34px;padding:7px 11px;border-radius:9px;font-size:12px;font-weight:800}
.account-toggle.lock{background:#fff;color:#8c2d2d;border:1px solid #e1b6b6}
.account-toggle.lock:hover{background:#fff3f3;border-color:#cf9292}
.account-toggle.unlock{background:var(--primary-soft);color:var(--primary-dark);border:1px solid #aac1c6}
.account-toggle.unlock:hover{background:#dfecef}
.account-toggle:disabled{opacity:.45;cursor:not-allowed}
.password-reset{width:100%;max-width:260px;border:1px solid var(--line);border-radius:10px;background:#fff;overflow:hidden}
.password-reset summary{cursor:pointer;list-style:none;padding:8px 10px;font-size:12px;font-weight:800;color:var(--primary-dark)}
.password-reset summary::-webkit-details-marker{display:none}
.password-reset summary::after{content:'+';float:right;font-size:16px;line-height:1}
.password-reset[open] summary::after{content:'−'}
.password-reset form{padding:10px;border-top:1px solid var(--line);display:grid;gap:9px}
.password-reset form label{margin:0;font-size:12px}
.password-reset form input{margin-top:5px;min-height:38px;padding:8px 9px;font-size:14px}
.password-reset form button{min-height:38px;padding:8px 10px;font-size:12px}
@media (max-width: 760px){
  .user-table td[data-label="Konto"]{align-items:stretch}
  .user-account-controls{width:100%;min-width:0;align-items:stretch}
  .user-account-controls .inline,.user-account-controls .account-toggle{width:100%}
  .password-reset{max-width:none;width:100%}
  .password-reset summary{min-height:44px;display:flex;align-items:center;justify-content:space-between;padding:11px 12px;font-size:14px}
  .password-reset summary::after{float:none}
  .password-reset form{padding:12px;gap:11px}
  .password-reset form input{min-height:44px;font-size:16px}
  .password-reset form button{min-height:44px}
  .user-status-badge{display:flex;width:max-content;margin:7px 0 0}
}

/* Update 44: automatische Zugänge + kompaktes Modul-Dropdown */
.field-caption{display:block;margin:0 0 7px;font-weight:750;color:var(--text)}
.module-selector-wrap{min-width:0}
.module-dropdown{position:relative;min-width:0}
.module-dropdown-toggle{width:100%;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:#fff;color:var(--text);border:1px solid var(--line);border-radius:10px;font:inherit;font-weight:700;text-align:left;cursor:pointer}
.module-dropdown-toggle:hover{border-color:#aac1c6;background:#fbfdfd}
.module-dropdown-toggle:focus-visible{outline:3px solid rgba(var(--primary-rgb),.18);outline-offset:2px;border-color:var(--primary)}
.module-dropdown-arrow{width:9px;height:9px;flex:0 0 9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .15s ease}
.module-dropdown.is-open .module-dropdown-arrow{transform:rotate(225deg) translate(-1px,-1px)}
.module-dropdown-menu{position:absolute;z-index:40;top:calc(100% + 7px);left:0;right:0;min-width:230px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 30px rgba(16,24,40,.12);padding:10px}
.module-dropdown-checks{display:grid;gap:7px}
.module-dropdown-check{display:flex;align-items:center;gap:10px;min-height:42px;padding:9px 10px;border:1px solid transparent;border-radius:9px;cursor:pointer;font-weight:700}
.module-dropdown-check:hover{background:#f5f8f9}
.module-dropdown-check:has(input:checked){background:var(--primary-soft);border-color:#aac1c6;color:var(--primary-dark)}
.module-dropdown-check input{width:18px;height:18px;flex:0 0 18px;margin:0;accent-color:var(--primary)}
.module-dropdown-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:9px;padding-top:9px;border-top:1px solid var(--line)}
.module-selected-summary{min-width:0;color:var(--muted);font-size:12px;line-height:1.3}
.module-dropdown-done,.module-dropdown-save{min-height:36px;padding:7px 12px;border-radius:8px;font-size:12px;font-weight:800;white-space:nowrap}
.module-permission-form{display:block;min-width:190px;max-width:245px}
.module-permission-form .module-dropdown-toggle{min-height:38px;padding:7px 10px;font-size:12px}
.module-permission-form .module-dropdown-menu{min-width:240px}
.user-create-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;align-items:end}
.user-create-form>label{margin:0}
.user-create-form>.module-selector-wrap,.user-create-form>.user-notify-create,.user-create-form>.user-access-note,.user-create-form>.user-create-submit{grid-column:1/-1}
.user-access-note{margin:0;padding:10px 12px;border-radius:9px;background:#f5f8f9;border:1px solid #e1e8eb}
.user-create-submit{justify-self:start}
.user-notify-create.is-disabled{opacity:.5}
.user-notify-create input:disabled{cursor:not-allowed}
.password-reset-mail{width:100%}
.password-reset-button{width:100%;min-height:38px;padding:8px 10px;border-radius:9px;background:#fff;color:var(--primary-dark);border:1px solid var(--line);font-size:12px;font-weight:800;text-align:left}
.password-reset-button:hover{background:var(--primary-soft);border-color:#aac1c6}

@media(max-width:760px){
  .user-create-form{grid-template-columns:1fr;gap:14px}
  .user-create-form>.module-selector-wrap,.user-create-form>.user-notify-create,.user-create-form>.user-access-note,.user-create-form>.user-create-submit{grid-column:auto}
  .user-create-submit{width:100%;min-height:48px}
  .module-permission-form{width:100%;max-width:none;min-width:0}
  .module-permission-form .module-dropdown-toggle{min-height:44px;font-size:14px}
  .module-dropdown-menu{position:static;margin-top:7px;box-shadow:none;min-width:0}
  .module-dropdown-footer{align-items:flex-start}
  .module-dropdown-done,.module-dropdown-save{min-height:42px}
  .password-reset-button{min-height:44px;font-size:14px;text-align:center}
}

/* Update 45: mehr Luft im Benutzer:innen-Anlegeformular */
.user-create-form{
  row-gap:18px;
}
.user-create-form>.module-selector-wrap{
  margin-bottom:2px;
}
.user-create-form>.user-notify-create{
  margin:2px 0 0;
  min-height:28px;
  display:flex;
  align-items:center;
}
.user-create-form>.user-access-note{
  margin-top:2px;
}
.user-create-form>.user-create-submit{
  margin-top:2px;
}

@media(max-width:760px){
  .user-create-form{
    gap:18px;
  }
  .user-create-form>.module-selector-wrap{
    margin-bottom:0;
  }
  .user-create-form>.user-notify-create{
    margin-top:0;
    min-height:32px;
  }
  .user-create-form>.user-access-note{
    margin-top:0;
    padding:12px 14px;
  }
  .user-create-form>.user-create-submit{
    margin-top:2px;
  }
}

/* Update 46: Benutzer:innen-Anlage – klar gruppierter Zugriff/Benachrichtigungsblock */
.user-create-form>.user-access-settings,
.user-create-form>.user-create-footer{
  grid-column:1/-1;
}
.user-access-settings{
  margin-top:4px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fafb;
}
.user-access-settings-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}
.user-access-settings-head strong{
  font-size:15px;
  color:var(--text);
}
.user-access-settings-grid{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);
  gap:18px;
  align-items:end;
}
.user-access-settings .module-selector-wrap,
.user-notify-wrap{
  min-width:0;
}
.user-notify-wrap{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.user-notify-create{
  position:relative;
  display:flex;
  align-items:center;
  gap:11px;
  min-height:54px;
  margin:0;
  padding:9px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  transition:border-color .15s ease,background .15s ease,opacity .15s ease;
}
.user-notify-create:hover{border-color:#aac1c6;background:#fbfdfd}
.user-notify-create input{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
.user-notify-control{
  width:36px;
  height:20px;
  flex:0 0 36px;
  border-radius:999px;
  background:#cbd5d9;
  position:relative;
  transition:background .16s ease;
}
.user-notify-control::after{
  content:"";
  position:absolute;
  width:14px;
  height:14px;
  left:3px;
  top:3px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 3px rgba(16,24,40,.22);
  transition:transform .16s ease;
}
.user-notify-create input:checked + .user-notify-control{background:var(--primary)}
.user-notify-create input:checked + .user-notify-control::after{transform:translateX(16px)}
.user-notify-create:focus-within{outline:3px solid rgba(var(--primary-rgb),.18);outline-offset:2px;border-color:var(--primary)}
.user-notify-create>span:last-child{display:flex;flex-direction:column;gap:1px;min-width:0;line-height:1.25}
.user-notify-create>span:last-child strong{font-size:13px;color:var(--text)}
.user-notify-create>span:last-child small{font-size:11px;color:var(--muted);font-weight:500}
.user-notify-create.is-disabled{opacity:.5;cursor:not-allowed;background:#f5f7f8}
.user-create-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-top:2px;
  padding-top:18px;
  border-top:1px solid var(--line);
}
.user-create-footer .user-access-note{
  flex:1 1 auto;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  max-width:900px;
  line-height:1.45;
}
.user-create-footer .user-create-submit{
  flex:0 0 auto;
  margin:0;
  min-height:44px;
  padding-inline:20px;
  white-space:nowrap;
}

@media(max-width:900px){
  .user-access-settings-grid{grid-template-columns:1fr;align-items:stretch}
}
@media(max-width:760px){
  .user-access-settings{padding:16px 14px;border-radius:12px}
  .user-access-settings-head{display:block;margin-bottom:15px}
  .user-access-settings-head strong{display:block;margin-bottom:3px;font-size:15px}
  .user-access-settings-grid{gap:16px}
  .user-notify-create{min-height:58px;padding:10px 12px}
  .user-create-footer{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:16px;
    padding-top:18px;
  }
  .user-create-footer .user-access-note{line-height:1.5}
  .user-create-footer .user-create-submit{width:100%;min-height:50px;white-space:normal}
}

/* Update 47: Benutzer:innenformular – saubere horizontale Ausrichtung */
.user-create-form > label{
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  min-width:0;
}
.user-create-form > label > input,
.user-create-form > label > select{
  min-height:48px;
}
.user-access-settings-grid{
  align-items:start;
}
.user-access-settings .module-selector-wrap,
.user-access-settings .user-notify-wrap{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.user-access-settings .field-caption{
  display:flex;
  align-items:center;
  min-height:24px;
  margin-bottom:6px;
  line-height:1.2;
}
.user-access-settings .module-dropdown-toggle,
.user-access-settings .user-notify-create{
  min-height:56px;
  height:56px;
}
.user-access-settings .user-notify-create{
  padding-top:8px;
  padding-bottom:8px;
}

@media(max-width:760px){
  .user-create-form > label > input,
  .user-create-form > label > select{
    min-height:48px;
  }
  .user-access-settings .module-dropdown-toggle,
  .user-access-settings .user-notify-create{
    min-height:52px;
    height:auto;
  }
}

/* Update 48: E-Mail und Rolle exakt gleich hoch */
.user-create-form > label > input[type="email"],
.user-create-form > label > select[name="role"]{
  box-sizing:border-box;
  width:100%;
  height:48px;
  min-height:48px;
  max-height:48px;
  margin-top:6px;
  padding:0 12px;
  line-height:46px;
  font:inherit;
}
.user-create-form > label > select[name="role"]{
  line-height:normal;
  padding-top:0;
  padding-bottom:0;
}

@media(max-width:760px){
  .user-create-form > label > input[type="email"],
  .user-create-form > label > select[name="role"]{
    height:48px;
    min-height:48px;
    max-height:48px;
    font-size:16px;
  }
}



/* Update 53: portalweiter Aktivitätsfeed */
.activity-panel{margin-top:28px}
.activity-head{display:flex;align-items:flex-start;justify-content:space-between;gap:22px;margin-bottom:8px}
.activity-head h2{margin:0}
.activity-head p{margin:8px 0 0;max-width:760px}
.activity-heading-line{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.activity-count{display:inline-flex;align-items:center;min-height:26px;padding:3px 9px;border-radius:999px;background:#fff3d6;color:#8a4b00;font-size:12px;font-weight:800}
.activity-read-all{margin:0;flex:0 0 auto}
.activity-list{border-top:1px solid var(--line);margin-top:18px}
.activity-item{display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:14px;align-items:flex-start;padding:18px 4px;border-bottom:1px solid var(--line);transition:background .16s ease,opacity .16s ease}
.activity-item.is-unread{background:linear-gradient(90deg,rgba(var(--primary-rgb),.055),rgba(var(--primary-rgb),0) 62%)}
.activity-item.is-read{opacity:.72}
.activity-marker{width:9px;height:9px;margin-top:8px;border-radius:999px;background:#cbd5d9}
.activity-item.is-unread .activity-marker{background:var(--primary);box-shadow:0 0 0 4px rgba(var(--primary-rgb),.11)}
.activity-content{min-width:0}
.activity-meta-line{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:5px}
.activity-module{display:inline-flex;align-items:center;min-height:24px;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:800;background:#eef2f4;color:#4d5a65}
.activity-module.mahnwesen{background:var(--primary-soft);color:var(--primary-dark)}
.activity-module.keep{background:#eef4ee;color:#3f6643}
.activity-time{font-size:12px;color:var(--muted)}
.activity-content h3{margin:0 0 3px;font-size:16px}
.activity-entity{display:inline-block;color:var(--primary-dark);font-weight:750;text-decoration:none;overflow-wrap:anywhere}
.activity-entity:hover{text-decoration:underline}
.activity-actor{margin:5px 0 0;color:var(--muted);font-size:12px}
.activity-change{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:center;margin-top:12px;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#fafbfc}
.activity-change>div{min-width:0}
.activity-change span:not(.activity-arrow){display:block;margin-bottom:2px;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.activity-change strong{display:block;font-size:13px;font-weight:650;overflow-wrap:anywhere;white-space:pre-wrap}
.activity-arrow{color:var(--muted);font-weight:900}
.activity-note{margin-top:11px;padding:10px 12px;border-left:3px solid #b8c9cd;border-radius:0 8px 8px 0;background:#f8fafb;color:#344054;font-size:13px;white-space:normal;overflow-wrap:anywhere}
.activity-actions{display:flex;align-items:flex-end;flex-direction:column;gap:8px;min-width:150px}
.activity-actions form{margin:0}
.activity-unread-label,.activity-read-label{font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
.activity-unread-label{color:var(--primary-dark)}
.activity-read-label{color:var(--muted)}
.activity-read-button{background:#fff;color:var(--primary-dark);border:1px solid #b8c9cd;padding:7px 10px;font-size:12px;white-space:nowrap}
.activity-read-button:hover{background:var(--primary-soft);color:var(--primary-dark)}
.activity-empty{padding:28px 10px 14px}

@media(max-width:720px){
  .activity-panel{padding:18px 16px}
  .activity-head{flex-direction:column;gap:14px}
  .activity-read-all,.activity-read-all .button{width:100%}
  .activity-item{grid-template-columns:9px minmax(0,1fr);gap:11px;padding:17px 0}
  .activity-actions{grid-column:2;min-width:0;align-items:flex-start;flex-direction:row;justify-content:space-between;width:100%;padding-top:2px}
  .activity-actions form{margin-left:auto}
  .activity-change{grid-template-columns:1fr;gap:7px}
  .activity-arrow{transform:rotate(90deg);width:max-content}
  .activity-read-button{min-height:40px}
}

/* Update 54: Mahnwesen-Aktivitäten und filterbare alphabetische Übersicht */
.activity-note-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:7px 10px;
  border:1px solid var(--primary);
  border-radius:8px;
  background:var(--primary);
  color:#fff;
  font-size:12px;
  font-weight:750;
  text-decoration:none;
  white-space:nowrap;
}
.activity-note-button:hover{background:var(--primary-dark);color:#fff}
.invoice-overview-panel{margin-top:28px}
.invoice-overview-filters{margin:16px 0 18px}
.filter-reset{text-decoration:none}
@media (max-width: 720px){
  .activity-actions{gap:10px;flex-wrap:wrap}
  .activity-note-button{min-height:40px}
  .invoice-overview-filters{display:grid;grid-template-columns:1fr;gap:10px}
  .invoice-overview-filters input,
  .invoice-overview-filters select,
  .invoice-overview-filters button,
  .invoice-overview-filters .button{width:100%}
}

/* Update 55: kompakte Aktivitätsfeeds + direkte Notiz-Popups */
.activity-panel-compact{padding:18px 20px;margin-top:22px}
.activity-head-compact{align-items:center;margin-bottom:0;gap:14px}
.activity-head-compact .activity-heading-line{gap:8px}
.activity-head-compact h2{font-size:18px}
.activity-read-all-button{min-height:34px;padding:6px 10px;font-size:12px}
.activity-list-compact{margin-top:12px}
.activity-item-compact{grid-template-columns:8px minmax(0,1fr) auto;gap:10px;padding:10px 4px;align-items:center}
.activity-item-compact .activity-marker{width:7px;height:7px;margin-top:0}
.activity-item-compact.is-unread .activity-marker{box-shadow:0 0 0 3px rgba(var(--primary-rgb),.10)}
.activity-mainline{display:flex;align-items:baseline;gap:8px;min-width:0;flex-wrap:wrap;font-size:13px;line-height:1.35}
.activity-mainline>strong{font-size:13px}
.activity-mainline .activity-entity{font-size:13px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.activity-compact-meta{display:flex;align-items:center;gap:6px;margin-top:2px;color:var(--muted);font-size:11px;line-height:1.3;flex-wrap:wrap}
.activity-change-compact{display:flex;align-items:center;gap:7px;margin-top:5px;padding:5px 8px;border:0;border-radius:7px;background:#f5f7f8;font-size:11px;color:#4b5563;max-width:100%}
.activity-change-compact span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:none!important;letter-spacing:0!important;font-weight:600}
.activity-change-compact b{color:var(--muted);flex:0 0 auto}
.activity-note-compact{margin-top:5px;padding:5px 8px;border-left-width:2px;border-radius:0 6px 6px 0;font-size:11px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.activity-actions-compact{min-width:0;flex-direction:row;align-items:center;gap:6px}
.activity-actions-compact form{display:flex}
.activity-actions-compact .activity-read-button,
.activity-actions-compact .activity-note-button{min-height:30px;padding:5px 8px;border-radius:7px;font-size:11px;font-weight:750}
.activity-actions-compact .activity-read-label{padding:0 4px;font-size:10px}
.activity-actions-compact .activity-note-button{cursor:pointer}

.activity-modal[hidden]{display:none!important}
.activity-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px}
.activity-modal-backdrop{position:absolute;inset:0;background:rgba(19,35,40,.52)}
.activity-modal-card{position:relative;z-index:1;width:min(560px,100%);padding:20px;border-radius:14px;background:#fff;box-shadow:0 22px 70px rgba(0,0,0,.24)}
.activity-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.activity-modal-head h2{margin:0;font-size:20px}
.activity-modal-head p{margin:4px 0 0}
.activity-modal-close{width:38px;height:38px;display:grid;place-items:center;flex:0 0 auto;border:0;border-radius:9px;background:#f1f4f5;color:#33444a;font-size:26px;line-height:1;cursor:pointer}
.activity-modal-close:hover{background:var(--primary-soft);color:var(--primary-dark)}
.activity-modal-form{display:grid;gap:14px}
.activity-modal-form textarea{width:100%;resize:vertical}
.activity-modal-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap}
body.has-activity-modal{overflow:hidden}

@media(max-width:720px){
  .activity-panel-compact{padding:15px 14px;margin-top:18px}
  .activity-head-compact{flex-direction:row;align-items:center;gap:10px}
  .activity-head-compact h2{font-size:16px}
  .activity-read-all,.activity-read-all .activity-read-all-button{width:auto}
  .activity-read-all-button{min-height:34px;white-space:nowrap}
  .activity-item-compact{grid-template-columns:7px minmax(0,1fr);gap:9px;padding:11px 0;align-items:flex-start}
  .activity-item-compact .activity-marker{margin-top:5px}
  .activity-mainline{display:block;font-size:13px}
  .activity-mainline>strong{display:block;margin-bottom:2px}
  .activity-mainline .activity-entity{display:block;white-space:normal;overflow:visible;text-overflow:clip}
  .activity-actions-compact{grid-column:2;justify-content:flex-start;width:100%;padding-top:3px;gap:7px}
  .activity-actions-compact form{margin-left:0}
  .activity-actions-compact .activity-read-button,
  .activity-actions-compact .activity-note-button{min-height:36px;padding:7px 9px}
  .activity-change-compact{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:5px}
  .activity-note-compact{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .activity-modal{padding:12px}
  .activity-modal-card{padding:17px 15px;border-radius:12px}
  .activity-modal-actions{display:grid;grid-template-columns:1fr 1fr}
  .activity-modal-actions .button,.activity-modal-actions button{width:100%;min-height:44px}
}


/* Update 56: Gelesene Aktivitäten werden ausgeblendet; Antworten sind einmalig. */
.activity-response-label{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 9px;
  border:1px solid #b9d2c0;
  border-radius:7px;
  background:#eef7f0;
  color:#356343;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
@media(max-width:720px){
  .activity-response-label{min-height:36px;padding:7px 10px}
}


/* Update 57: Antworttext direkt an der beantworteten Aktivität anzeigen. */
.activity-response-preview{margin-top:6px;padding:7px 9px;border:1px solid #cbdadd;border-radius:8px;background:#f3f8f8;font-size:11px;line-height:1.4;color:#30464c}
.activity-response-preview span{display:block;margin-bottom:2px;color:var(--primary-dark);font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}
.activity-response-preview p{margin:0;overflow-wrap:anywhere}
@media(max-width:700px){.activity-response-preview{padding:8px 9px;font-size:12px}.activity-response-preview span{font-size:10px}}

/* Update 58: Live-Filter und letzte Änderung */
.invoice-row[hidden]{display:none!important}
.invoice-filter-empty[hidden]{display:none!important}
.filters [hidden]{display:none!important}
@media(max-width:700px){
  .invoice-created{font-variant-numeric:tabular-nums}
}

/* Update 60: kompakter Benutzer:innenfilter für Aufgaben */
.keep-assignee-filter{margin-left:auto;min-width:220px}
.keep-assignee-filter label{display:flex;align-items:center;gap:9px;margin:0;color:var(--muted);font-size:13px;font-weight:750}
.keep-assignee-filter label>span{white-space:nowrap}
.keep-assignee-filter select{min-width:190px;min-height:38px;padding:6px 34px 6px 10px;border-radius:999px;font-size:13px;font-weight:700;background-color:#fff}
@media(max-width:760px){
  .keep-assignee-filter{width:100%;margin-left:0;min-width:0}
  .keep-assignee-filter label{display:block}
  .keep-assignee-filter label>span{display:block;margin:0 0 7px}
  .keep-assignee-filter select{width:100%;min-width:0;min-height:44px;border-radius:12px;font-size:16px}
}

/* Update 61: Aufgaben-Filter komplett clientseitig und Mitarbeiter:innen direkt auswählbar */
.keep-live-filters{display:flex;flex-direction:column;gap:12px;margin:0 0 20px;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:#fff}
.keep-filter-row{display:flex;align-items:flex-start;gap:14px;min-width:0}
.keep-filter-label{flex:0 0 105px;padding-top:8px;color:var(--muted);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.keep-filter-chips{display:flex;gap:7px;flex-wrap:wrap;min-width:0}
.keep-filter-chips button{min-height:38px;padding:7px 12px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--muted);font-size:13px;font-weight:750;cursor:pointer}
.keep-filter-chips button:hover{border-color:#aac1c6;color:var(--primary-dark);background:#f8fbfb}
.keep-filter-chips button.active{background:var(--primary-soft);border-color:#aac1c6;color:var(--primary-dark)}
.keep-user-filter-row{padding-top:10px;border-top:1px solid var(--line)}
.keep-user-chips button{white-space:nowrap}
.keep-card[hidden]{display:none!important}
.keep-live-empty[hidden]{display:none!important}
@media(max-width:700px){
  .keep-live-filters{padding:12px;gap:14px}
  .keep-filter-row{display:block}
  .keep-filter-label{display:block;padding:0;margin:0 0 8px}
  .keep-filter-chips{gap:6px}
  .keep-filter-chips button{min-height:42px;padding:8px 12px;font-size:14px}
  .keep-user-chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:3px;scrollbar-width:thin}
  .keep-user-chips button{flex:0 0 auto}
}




/* Update 63: Wichtig / Angepinnt statt Farbmarkierungen */
.task-priority-fieldset{border:0;padding:0;margin:18px 0 0;min-width:0}
.task-priority-fieldset legend{font-weight:800;margin-bottom:9px}
.task-priority-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.task-priority-option{display:flex;align-items:flex-start;gap:10px;min-height:58px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:#fff;cursor:pointer;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}
.task-priority-option input{width:19px;height:19px;flex:0 0 19px;margin:2px 0 0;accent-color:var(--primary)}
.task-priority-option span{display:flex;flex-direction:column;min-width:0}
.task-priority-option strong{font-size:14px}
.task-priority-option small{font-size:12px;color:var(--muted);font-weight:500;line-height:1.35;margin-top:2px}
.task-priority-option:hover{border-color:#a9bec3;background:#fbfdfd}
.task-priority-option:has(input:checked){border-color:var(--primary);background:var(--primary-soft);box-shadow:0 0 0 2px rgba(var(--primary-rgb),.08)}
.task-priority-option.important:has(input:checked){border-color:#b42318;background:#fff1f0;box-shadow:0 0 0 2px rgba(180,35,24,.10)}
.task-priority-option.important:has(input:checked) strong{color:#9f2017}
.task-priority-edit{margin-top:20px}
.task-flags{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 10px}
.task-flag{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:900;letter-spacing:.02em}
.task-flag.important{background:#b42318;color:#fff;border:1px solid #9f2017;box-shadow:0 1px 2px rgba(180,35,24,.2)}
.task-flag.pinned{background:var(--primary-soft);color:var(--primary-dark);border:1px solid #a9bec3}
.keep-card.is-important{border:3px solid #b42318;background:#fff8f7;box-shadow:0 5px 18px rgba(180,35,24,.12)}
.keep-card.is-important h2{color:#7f1d16}
.keep-card.is-important.is-overdue{border-color:#b42318}
.keep-card.is-pinned:not(.is-important){border-top:4px solid var(--primary)}
.keep-card.is-done.is-important{background:#fbf7f7;border-color:#d6a3a0;box-shadow:none}
@media(max-width:620px){.task-priority-options{grid-template-columns:1fr}.task-priority-option{min-height:54px}.task-priority-fieldset{margin-top:20px}}

/* Update 65: Modul Passwörter */
.password-module-icon{font-size:0;position:relative}
.password-module-icon::before{content:"";position:absolute;box-sizing:border-box;width:20px;height:16px;border:3px solid currentColor;border-radius:4px;left:50%;top:23px;transform:translateX(-50%)}
.password-module-icon::after{content:"";position:absolute;box-sizing:border-box;width:12px;height:13px;border:3px solid currentColor;border-bottom:0;border-radius:9px 9px 0 0;left:50%;top:11px;transform:translateX(-50%)}
.password-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.password-card{min-width:0;display:flex;flex-direction:column;gap:18px}
.password-card-head{display:flex;gap:14px;align-items:flex-start;justify-content:space-between}
.password-card-head h2{margin:0 0 4px;font-size:1.08rem;overflow-wrap:anywhere}
.password-edit-link{flex:0 0 auto}
.password-field{display:grid;gap:7px}
.password-field>span,.password-edit-panel .field-caption{font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#667085}
.password-value-row{display:flex;align-items:center;gap:8px;min-width:0}
.password-value-row code{display:block;min-width:0;flex:1;background:#f7f9fa;border:1px solid #e1e7ea;border-radius:8px;padding:10px 12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.94rem}
.password-mini-action{border:1px solid #cdd9dc;background:#fff;color:var(--primary);border-radius:8px;padding:9px 11px;font-weight:700;cursor:pointer}
.password-mini-action:hover,.password-mini-action:focus-visible{background:#eef4f5;border-color:var(--primary)}
.password-meta{display:flex;gap:8px 18px;flex-wrap:wrap;color:#667085;font-size:.78rem;border-top:1px solid #edf0f2;padding-top:13px}
.password-edit-panel{max-width:860px}
.password-edit-panel form{display:grid;gap:18px}
.password-edit-actions{padding-top:4px;display:flex;justify-content:flex-end}
.password-edit-meta{display:flex;gap:10px 24px;flex-wrap:wrap;border-top:1px solid #e6ebed;margin-top:22px;padding-top:16px;color:#667085;font-size:.82rem}
.password-share-dropdown{max-width:620px}
.password-toast{position:fixed;right:20px;bottom:20px;background:#172033;color:#fff;padding:11px 14px;border-radius:9px;z-index:1000;font-size:.88rem;box-shadow:0 8px 24px rgba(0,0,0,.15)}
@media(max-width:900px){
  .password-grid{grid-template-columns:1fr}
  .password-card-head{align-items:center}
  .password-value-row{flex-wrap:wrap}
  .password-value-row code{flex:1 1 100%}
  .password-mini-action{flex:1 1 auto;min-height:44px}
  .password-edit-actions button{width:100%}
}

/* Update 68: auswählbare Login-Passwortrichtlinie und eigener Passwortwechsel */
.password-policy-fieldset{border:0;padding:0;margin:22px 0 10px;min-width:0}
.password-policy-fieldset legend{font-weight:800;margin-bottom:9px}
.password-policy-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.password-policy-option{display:flex;align-items:flex-start;gap:10px;min-height:74px;padding:12px;border:1px solid var(--line);border-radius:11px;background:#fff;cursor:pointer;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}
.password-policy-option input{width:19px;height:19px;flex:0 0 19px;margin:2px 0 0;accent-color:var(--primary)}
.password-policy-option span{display:flex;flex-direction:column;min-width:0}
.password-policy-option strong{font-size:14px}
.password-policy-option small{margin-top:3px;color:var(--muted);font-size:12px;font-weight:500;line-height:1.4}
.password-policy-option:hover{border-color:#a9bec3;background:#fbfdfd}
.password-policy-option:has(input:checked){border-color:var(--primary);background:var(--primary-soft);box-shadow:0 0 0 2px rgba(var(--primary-rgb),.08)}
.password-change-panel{max-width:620px}
.password-change-panel form{max-width:520px}
.password-policy-current{margin:4px 0 18px;padding:11px 12px;border-radius:9px;background:var(--primary-soft);color:var(--primary-dark);font-size:13px}
@media(max-width:620px){.password-policy-options{grid-template-columns:1fr}.password-change-panel button{width:100%;min-height:46px}}

/* Update 69: Passwortrichtlinie pro Benutzer:in + Löschbereich im Passwort-Modul */
.user-create-form>.user-password-policy-create{grid-column:1/-1;max-width:calc(50% - 8px)}
.user-password-policy-create select,
.user-policy-form select{box-sizing:border-box;width:100%;min-height:42px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--text);font:inherit;padding:8px 34px 8px 10px}
.user-policy-form{min-width:170px;margin:0}
.user-policy-form select{font-size:12px;font-weight:700;cursor:pointer}
.user-policy-form select:focus-visible{outline:3px solid rgba(var(--primary-rgb),.18);outline-offset:2px;border-color:var(--primary)}
.password-danger-zone{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:20px;padding-top:18px;border-top:1px solid #f0c8c5}
.password-danger-zone strong{color:#9f2017}
.password-danger-zone p{margin:4px 0 0}
.password-danger-zone form{margin:0;flex:0 0 auto}
.button.danger{background:#b42318;border-color:#b42318;color:#fff}
.button.danger:hover,.button.danger:focus-visible{background:#8f1d14;border-color:#8f1d14;color:#fff}
@media(max-width:760px){
  .user-create-form>.user-password-policy-create{grid-column:auto;max-width:none}
  .user-policy-form{width:100%;min-width:0}
  .user-policy-form select{min-height:44px;font-size:14px}
  .password-danger-zone{align-items:stretch;flex-direction:column}
  .password-danger-zone .button{width:100%}
}

/* Update 70: Passwortrichtlinie bestehender Benutzer:innen als bewusst speicherbares Dropdown. */
.user-policy-form{min-width:190px;margin:0}
.policy-dropdown{position:relative;min-width:0}
.policy-dropdown-toggle{width:100%;min-height:38px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 10px;background:#fff;color:var(--text);border:1px solid var(--line);border-radius:9px;font:inherit;font-size:12px;font-weight:800;text-align:left;cursor:pointer}
.policy-dropdown-toggle:hover{border-color:#aac1c6;background:#fbfdfd}
.policy-dropdown-toggle:focus-visible{outline:3px solid rgba(var(--primary-rgb),.18);outline-offset:2px;border-color:var(--primary)}
.policy-dropdown-arrow{width:9px;height:9px;flex:0 0 9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .15s ease}
.policy-dropdown.is-open .policy-dropdown-arrow{transform:rotate(225deg) translate(-1px,-1px)}
.policy-dropdown-menu{position:absolute;z-index:45;top:calc(100% + 7px);left:0;min-width:290px;max-width:min(360px,calc(100vw - 32px));background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 30px rgba(16,24,40,.12);padding:10px}
.policy-dropdown-options{display:grid;gap:7px}
.policy-dropdown-option{display:flex;align-items:flex-start;gap:10px;padding:10px;border:1px solid transparent;border-radius:9px;cursor:pointer}
.policy-dropdown-option:hover{background:#f5f8f9}
.policy-dropdown-option:has(input:checked){background:var(--primary-soft);border-color:#aac1c6;color:var(--primary-dark)}
.policy-dropdown-option input{width:18px;height:18px;flex:0 0 18px;margin:2px 0 0;accent-color:var(--primary)}
.policy-dropdown-option span{display:grid;gap:2px;min-width:0}
.policy-dropdown-option strong{font-size:13px}
.policy-dropdown-option small{font-size:11px;font-weight:500;color:var(--muted);line-height:1.35}
.policy-dropdown-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:9px;padding-top:9px;border-top:1px solid var(--line)}
.policy-selected-summary{font-size:11px;color:var(--muted);line-height:1.3}
.policy-dropdown-save{min-height:36px;padding:7px 12px;border-radius:8px;font-size:12px;font-weight:800;white-space:nowrap}
.policy-noscript{display:grid;gap:6px}.policy-noscript select{width:100%}
@media(max-width:760px){
  .user-policy-form{width:100%;min-width:0}
  .policy-dropdown-toggle{min-height:44px;font-size:14px}
  .policy-dropdown-menu{position:static;margin-top:7px;min-width:0;max-width:none;box-shadow:none}
  .policy-dropdown-option{min-height:48px}
  .policy-dropdown-footer{align-items:center}
  .policy-dropdown-save{min-height:42px}
}


/* Update 71: nativer Passwortrichtlinien-Dropdown + zuverlässige Klickbarkeit */
.policy-dropdown-native{position:relative;min-width:0}
.policy-dropdown-native>summary{list-style:none}
.policy-dropdown-native>summary::-webkit-details-marker{display:none}
.policy-dropdown-native[open] .policy-dropdown-arrow{transform:rotate(225deg) translate(-1px,-1px)}
.policy-dropdown-native .policy-dropdown-menu{display:block}
@media(max-width:760px){.policy-dropdown-native .policy-dropdown-menu{position:static;margin-top:7px;min-width:0;max-width:none;box-shadow:none}}

/* Update 73: Portal-/SMTP-Einstellungen */
.smtp-settings-panel{grid-column:1/-1}.smtp-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px}.smtp-settings-grid .span-2{grid-column:1/-1}.smtp-check{display:flex;align-items:flex-start;gap:10px;font-weight:650;margin:4px 0 16px}.smtp-check input{width:auto;margin:3px 0 0}.smtp-secret-note{margin-top:-7px;margin-bottom:15px}.settings-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}@media(max-width:700px){.smtp-settings-grid{grid-template-columns:1fr}.smtp-settings-grid .span-2{grid-column:auto}}

/* Update 74: konfigurierbares Portal-Logo */
.brand{gap:12px}.brandlogo{display:block!important;width:auto!important;height:auto!important;max-width:150px!important;max-height:48px!important;object-fit:contain;flex:0 0 auto}.brandname{padding-left:0!important;border-left:0!important}.portal-logo-preview{display:flex;align-items:center;gap:18px;flex-wrap:wrap;padding:14px;border:1px solid var(--line);border-radius:10px;margin:-4px 0 16px}.portal-logo-preview img{display:block;max-width:220px;max-height:90px;object-fit:contain;background:var(--surface-soft);border:1px solid var(--line);border-radius:8px;padding:8px}.portal-logo-preview .smtp-check{margin:0}.logo-upload-note{margin-top:-8px;margin-bottom:16px}@media(max-width:560px){.brand{gap:8px}.brandlogo{max-width:104px!important;max-height:38px!important}.brandname{font-size:16px!important}.portal-logo-preview{align-items:flex-start;flex-direction:column}.portal-logo-preview img{max-width:100%;max-height:80px}}


/* Update 74 final: mandantenfähiges Portal-Branding */
.branding-color-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.branding-color-grid label{min-width:0}
.branding-color-grid input[type="color"]{height:48px;padding:4px;cursor:pointer;background:#fff}
.branding-color-grid .color-value{display:block;margin-top:5px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-weight:600}
@media(max-width:560px){.branding-color-grid{grid-template-columns:1fr}}

/* Update 75: Navigation, Formular-Polish und ausgewogenes Aufgabenformular */
.nav-home-button{
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  padding:0!important;
  border:1.5px solid rgba(var(--brand-contrast-rgb),.82);
  border-radius:10px;
  background:transparent;
  color:var(--brand-contrast)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 42px;
  transition:background .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.nav-home-button:hover{
  background:var(--brand-contrast)!important;
  color:var(--brand)!important;
  border-color:var(--brand-contrast);
}
.nav-home-button:focus-visible{
  outline:3px solid rgba(var(--brand-contrast-rgb),.3)!important;
  outline-offset:2px!important;
  background:var(--brand-contrast)!important;
  color:var(--brand)!important;
  border-color:var(--brand-contrast);
}
.nav-home-icon{
  width:23px;
  height:23px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2.05;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none;
}
@media(max-width:900px){
  .topbar .main-nav>a.nav-home-button{
    width:48px!important;
    height:48px!important;
    min-width:48px!important;
    min-height:48px!important;
    margin:8px 12px 3px;
    padding:0!important;
    border-color:rgba(var(--brand-contrast-rgb),.72);
  }
  .nav-home-icon{width:26px;height:26px}
}

/* Farbwahl kompakt statt als überbreite native Farbfelder. */
.branding-color-grid{gap:18px}
.branding-color-grid label{display:flex;flex-direction:column;min-width:0}
.branding-color-control{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-height:52px;
  margin-top:6px;
  padding:6px;
  border:1px solid #d0d5dd;
  border-radius:10px;
  background:#fff;
}
.branding-color-grid .branding-color-control input[type="color"]{
  width:58px;
  height:40px;
  min-width:58px;
  margin:0;
  padding:2px;
  border:0;
  border-radius:8px;
  background:#fff;
  cursor:pointer;
}
.branding-color-grid .color-value{
  display:flex;
  align-items:center;
  min-height:40px;
  margin:0;
  padding:0 10px;
  border-left:1px solid var(--line);
  color:var(--text);
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:14px;
  font-weight:750;
  letter-spacing:.02em;
}
.branding-color-control:focus-within{border-color:var(--primary);outline:3px solid rgba(var(--primary-rgb),.12)}

/* Native Selects in den Einstellungen optisch an die Portal-Controls angleichen. */
.settings-select{
  min-height:46px;
  padding:10px 44px 10px 12px;
  appearance:none;
  -webkit-appearance:none;
  background-color:var(--field-bg);
  color:var(--field-text);
  border-color:var(--line-strong);
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 18px) 19px,calc(100% - 13px) 19px;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
  cursor:pointer;
}
.settings-select option{background:var(--field-bg);color:var(--field-text)}

/* Passwortrichtlinie beim Anlegen: derselbe Dropdown-Stil wie bei Modulzuweisungen. */
.user-password-policy-create{display:flex;flex-direction:column;justify-content:flex-end;min-width:0}
.user-password-policy-create .field-caption{margin-bottom:6px}
.policy-dropdown-create .policy-dropdown-toggle{
  min-height:48px;
  padding:10px 12px;
  border-radius:9px;
  font-size:15px;
  font-weight:700;
}
.policy-dropdown-create .policy-dropdown-menu{left:0;right:0;min-width:100%;max-width:none}
.policy-dropdown-done{
  min-height:36px;
  padding:7px 12px;
  border-radius:8px;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
@media(max-width:760px){
  .policy-dropdown-create .policy-dropdown-toggle{min-height:48px;font-size:16px}
  .policy-dropdown-done{min-height:42px}
}

/* Update 76/77: Neue Aufgabe einklappbar; Beschreibung kompakt und frei vertikal skalierbar. */
.keep-compose[data-task-compose]{padding:0;overflow:visible}
.keep-compose-toggle{
  width:100%;
  min-height:66px;
  padding:14px 18px;
  border:0;
  border-radius:inherit;
  background:transparent;
  color:inherit;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  text-align:left;
  cursor:pointer;
}
.keep-compose-toggle:hover{background:rgba(var(--primary-rgb),.06)}
.keep-compose-toggle:focus-visible{outline:3px solid rgba(var(--primary-rgb),.22);outline-offset:-3px}
.keep-compose-toggle span:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}
.keep-compose-toggle strong{font-size:16px;line-height:1.25}
.keep-compose-toggle small{font-size:13px;color:var(--muted,#64748b);font-weight:500}
.keep-compose-toggle-icon{
  width:12px;height:12px;flex:0 0 auto;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transition:transform .18s ease;
}
.keep-compose.is-open .keep-compose-toggle-icon{transform:rotate(225deg) translate(-2px,-2px)}
.keep-compose-body{display:none;border-top:1px solid var(--border,#e5e7eb)}
.keep-compose.is-open .keep-compose-body{display:block}
.keep-compose .keep-compose-body .keep-compose-form{padding:20px 18px;margin:0}
.keep-compose .keep-compose-body .keep-compose-main,
.keep-compose .keep-compose-body .keep-compose-meta{min-width:0}

@media(min-width:981px){
  .keep-compose .keep-compose-body .keep-compose-form{
    grid-template-columns:minmax(0,1.65fr) minmax(260px,.75fr);
    grid-template-areas:
      "main meta"
      ". submit";
    column-gap:22px;
    row-gap:22px;
    align-items:start;
  }
  .keep-compose-main{grid-area:main;display:block;min-height:0}
  .keep-compose-main>label:last-child{margin-bottom:0}
  /* Ausgangshöhe endet ungefähr auf Höhe der Priorisierungsboxen.
     Keine Flex-Streckung: der Browser-Resize-Griff bleibt dauerhaft frei nutzbar. */
  .keep-compose-main>label:last-child textarea{
    display:block;
    height:175px;
    min-height:100px;
    max-height:none;
    resize:vertical;
    flex:none;
  }
  .keep-compose-meta{grid-area:meta}
  .keep-compose-form>.keep-primary-submit{grid-area:submit;width:100%;margin:0;min-height:42px}
}

@media(max-width:980px){
  .keep-compose .keep-compose-body .keep-compose-form{grid-template-columns:1fr;gap:22px}
  .keep-compose-form>.keep-primary-submit{width:100%;margin-top:0}
}

@media(max-width:380px){
  .keep-compose-toggle{padding:13px 16px}
  .keep-compose .keep-compose-body .keep-compose-form{padding:18px 16px}
}

/* Update 80: Benutzerverwaltung als Übersicht + separate Bearbeitungsansicht. */
.user-admin-overview{
  display:grid;
  grid-template-columns:1fr;
  gap:22px;
}
.user-admin-overview>.panel{margin:0}
.user-create-panel{
  order:-1;
  padding:0!important;
  overflow:visible;
}
.user-create-toggle{
  display:flex;
  width:100%;
  min-height:66px;
  padding:14px 18px;
  border:0;
  border-radius:inherit;
  background:transparent;
  color:inherit;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  text-align:left;
  cursor:pointer;
}
.user-create-toggle:hover{background:rgba(var(--primary-rgb),.06)}
.user-create-toggle:focus-visible{outline:3px solid rgba(var(--primary-rgb),.22);outline-offset:-3px}
.user-create-toggle>span:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}
.user-create-toggle strong{font-size:16px;line-height:1.25}
.user-create-toggle small{font-size:13px;color:var(--muted);font-weight:500}
.user-create-toggle-icon{
  width:12px;
  height:12px;
  flex:0 0 auto;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transition:transform .18s ease;
}
.user-create-panel.is-open .user-create-toggle-icon{transform:rotate(225deg) translate(-2px,-2px)}
.user-create-body{display:none;border-top:1px solid var(--line);padding:22px}
.user-create-panel.is-open .user-create-body{display:block}
.user-create-desktop-title{display:none}

.user-overview-panel .panelhead{margin-bottom:12px}
.user-overview-panel .panelhead h2{margin-bottom:4px}
.user-overview-panel .panelhead p{margin:0}
.user-overview-table{min-width:880px}
.user-overview-table th:last-child,.user-overview-table td:last-child{text-align:right}
.user-module-chips{display:flex;gap:6px;flex-wrap:wrap}
.user-module-chips span{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:3px 8px;
  border:1px solid #d7e1e4;
  border-radius:999px;
  background:#f7fafb;
  color:#425466;
  font-size:11px;
  font-weight:750;
  white-space:nowrap;
}
.user-overview-status{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.user-status-badge.is-active{background:#eaf6ee;color:#26713d;border:1px solid #c9e6d2}
.user-overview-action{white-space:nowrap}
.user-edit-link{min-height:36px;padding:7px 12px;font-size:12px;font-weight:800}

.user-edit-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,340px);
  gap:22px;
  align-items:start;
}
.user-edit-main-panel{margin:0;min-width:0}
.user-edit-side{display:grid;gap:16px;min-width:0}
.user-edit-side>.panel{margin:0}
.user-edit-form{display:block}
.user-edit-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.user-edit-section-head h2{margin:0 0 4px;font-size:19px}
.user-edit-section-head p{margin:0}
.user-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 18px}
.user-edit-grid>label{display:flex;flex-direction:column;min-width:0;margin:0}
.user-edit-grid input,.user-edit-grid select{box-sizing:border-box;width:100%;min-height:48px;margin-top:6px}
.user-edit-grid select{height:48px}
.user-edit-field-note{display:block;margin-top:6px;line-height:1.35}
.user-edit-section{margin-top:24px;padding-top:22px;border-top:1px solid var(--line)}
.user-edit-policy-wrap{max-width:520px}
.policy-dropdown-edit .policy-dropdown-toggle{min-height:48px;padding:10px 12px;font-size:14px}
.policy-dropdown-edit .policy-dropdown-menu{left:0;right:auto;min-width:min(390px,calc(100vw - 48px))}
.user-edit-access-settings{margin-top:24px}
.user-edit-savebar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px;
  padding-top:20px;
  border-top:1px solid var(--line);
}
.user-edit-savebar .button,.user-edit-savebar button{min-height:44px}
.user-edit-status-line{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:4px 0 12px}
.user-edit-side h2{margin-top:0;margin-bottom:10px;font-size:18px}
.user-edit-side p{line-height:1.5}
.user-edit-account-panel form,.user-edit-password-panel form{margin:14px 0 0}
.user-edit-account-panel button,.user-edit-password-panel button{width:100%;min-height:42px;text-align:center;justify-content:center}
.user-edit-side-note{margin-bottom:0}
.user-edit-meta{display:grid;gap:10px;margin:0}
.user-edit-meta>div{display:flex;justify-content:space-between;gap:16px;padding-top:10px;border-top:1px solid var(--line)}
.user-edit-meta>div:first-child{padding-top:0;border-top:0}
.user-edit-meta dt{color:var(--muted);font-size:12px;font-weight:700}
.user-edit-meta dd{margin:0;text-align:right;font-size:12px;font-weight:750;color:var(--text)}

@media(max-width:980px){
  .user-edit-layout{grid-template-columns:1fr}
  .user-edit-side{grid-template-columns:repeat(2,minmax(0,1fr))}
  .user-edit-meta-panel{grid-column:1/-1}
}
@media(max-width:760px){
  .user-create-body{padding:20px 18px}
  .user-overview-table{min-width:0}
  .user-overview-table td[data-label="Aktion"]{display:block;padding-top:12px}
  .user-overview-table td[data-label="Aktion"]::before{display:none}
  .user-overview-action{text-align:left!important}
  .user-edit-link{width:100%;min-height:44px;justify-content:center}
  .user-edit-grid{grid-template-columns:1fr}
  .user-edit-side{grid-template-columns:1fr}
  .user-edit-meta-panel{grid-column:auto}
  .user-edit-savebar{align-items:stretch;flex-direction:column-reverse}
  .user-edit-savebar .button,.user-edit-savebar button{width:100%;justify-content:center}
  .policy-dropdown-edit .policy-dropdown-menu{min-width:0;max-width:none}
}
@media(max-width:430px){
  .user-create-toggle{padding:13px 16px}
  .user-create-body{padding:18px 16px}
}

/* Update 82: Einstellungen – Allgemein und SMTP nebeneinander, SMTP-Test integriert */
.settings-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.settings-grid>.panel{height:100%}
.smtp-settings-panel{display:flex;flex-direction:column}
.smtp-test-inline{margin-top:24px;padding-top:22px;border-top:1px solid var(--line)}
.smtp-test-inline-head{margin-bottom:14px}
.smtp-test-inline-head h3{margin:0 0 4px;font-size:17px}
.smtp-test-inline-head p{margin:0}
.smtp-test-inline-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}
.smtp-test-inline-form label{margin:0}
.smtp-test-inline-form button{min-height:44px;white-space:nowrap}
@media(max-width:900px){.settings-grid{grid-template-columns:1fr}.settings-grid>.panel{height:auto}}
@media(max-width:620px){.smtp-test-inline-form{grid-template-columns:1fr}.smtp-test-inline-form button{width:100%}}

/* Update 83: Einstellungen – SMTP-Panel nicht mehr über beide Grid-Spalten ziehen */
.settings-grid > .smtp-settings-panel{grid-column:auto}
@media(max-width:900px){.settings-grid > .smtp-settings-panel{grid-column:auto}}

/* Update 87: persönliche Darstellung – Hell / Dunkel / System. */
:root{
  --surface:#fff;
  --surface-soft:#f8fafb;
  --surface-subtle:#f3f6f8;
  --surface-hover:#eef2f4;
  --field-bg:#fff;
  --field-text:#101828;
  --line-strong:#d0d5dd;
  --shadow-color:rgba(16,24,40,.12);
  --success-surface:#ecfdf3;
  --success-text:#067647;
  --danger-surface:#fef3f2;
  --danger-text:#b42318;
  --warning-surface:#fff3d6;
  --warning-text:#8a4b00;
  --closed-surface:#eaecf0;
  --closed-text:#475467;
}
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0f1419;
  --panel:#171d23;
  --text:#edf2f7;
  --muted:#a7b2bf;
  --line:#303a45;
  --surface:#171d23;
  --surface-soft:#20272f;
  --surface-subtle:#1c232b;
  --surface-hover:#28323c;
  --field-bg:#11171d;
  --field-text:#edf2f7;
  --line-strong:#44515e;
  --shadow-color:rgba(0,0,0,.34);
  --primary-soft:rgba(var(--primary-rgb),.22);
  --brand-soft:rgba(var(--brand-rgb),.20);
  --success-surface:#123426;
  --success-text:#8be0ad;
  --danger-surface:#3a1d1b;
  --danger-text:#ff958d;
  --warning-surface:#3b2d13;
  --warning-text:#f5c96a;
  --closed-surface:#29313a;
  --closed-text:#c2cbd5;
  --danger:#ff8178;
  --success:#68d391;
}
@media(prefers-color-scheme:dark){
  html[data-theme="system"]{
    color-scheme:dark;
    --bg:#0f1419;
    --panel:#171d23;
    --text:#edf2f7;
    --muted:#a7b2bf;
    --line:#303a45;
    --surface:#171d23;
    --surface-soft:#20272f;
    --surface-subtle:#1c232b;
    --surface-hover:#28323c;
    --field-bg:#11171d;
    --field-text:#edf2f7;
    --line-strong:#44515e;
    --shadow-color:rgba(0,0,0,.34);
    --primary-soft:rgba(var(--primary-rgb),.22);
    --brand-soft:rgba(var(--brand-rgb),.20);
    --success-surface:#123426;
    --success-text:#8be0ad;
    --danger-surface:#3a1d1b;
    --danger-text:#ff958d;
    --warning-surface:#3b2d13;
    --warning-text:#f5c96a;
    --closed-surface:#29313a;
    --closed-text:#c2cbd5;
    --danger:#ff8178;
    --success:#68d391;
  }
}
@media(prefers-color-scheme:light){html[data-theme="system"]{color-scheme:light}}

/* Neutrale Flächen verwenden Theme-Variablen statt festem Weiß. */
input,select,textarea,
.button.secondary,
.nav-dropdown-menu,
.module-card,
.module-check,
.keep-tabs a,.keep-status-filter a,
.keep-card,
.keep-check,
.danger-button,
.assignee-check,form label.assignee-check,
.assignee-dropdown-toggle,.assignee-dropdown-menu,.assignee-dropdown label.assignee-check,
.user-notify-create,
.account-toggle.lock,
.password-reset,.password-reset-button,
.module-dropdown-toggle,.module-dropdown-menu,
.activity-read-button,.activity-modal-card,
.keep-live-filters,.keep-filter-chips button,
.task-priority-option,
.password-mini-action,.password-policy-option,
.user-policy-form select,
.policy-dropdown-toggle,.policy-dropdown-menu,
.branding-color-control,.branding-color-grid .branding-color-control input[type="color"],
.invoice-table tr.invoice-row,
.user-table tr{
  background:var(--surface);
  color:var(--text);
  border-color:var(--line);
}
input,select,textarea{background:var(--field-bg);color:var(--field-text);border-color:var(--line-strong)}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:.78}

.keep-card.is-done,
.keep-detail-status,
.keep-change-values>div,
.activity-note,
.user-notify-create.is-disabled,
.user-module-chips span{
  background:var(--surface-soft);
  color:var(--text);
  border-color:var(--line);
}
.keep-change-values>div:last-child,
.assignee-dropdown label.assignee-check:hover,
.assignee-dropdown-toggle:hover,
.user-notify-create:hover,
.keep-card-edit:hover,
.keep-filter-chips button:hover{
  background:var(--surface-hover);
}
.keep-card.is-done .keep-card-body h2,.keep-card.is-done .keep-card-body p,
.activity-note{color:var(--muted)}

.badge.open,.activity-count,.user-status-badge.is-reset{background:var(--warning-surface);color:var(--warning-text)}
.badge.paid,.user-status-badge.is-active{background:var(--success-surface);color:var(--success-text)}
.badge.closed{background:var(--closed-surface);color:var(--closed-text)}
.flash.success{background:var(--success-surface);color:var(--success-text)}
.flash.error{background:var(--danger-surface);color:var(--danger-text)}

html[data-theme="dark"] .task-priority-option.important:has(input:checked),
html[data-theme="dark"] .keep-card.is-important{
  background:#321d1d;
  color:var(--text);
}
@media(prefers-color-scheme:dark){
  html[data-theme="system"] .task-priority-option.important:has(input:checked),
  html[data-theme="system"] .keep-card.is-important{
    background:#321d1d;
    color:var(--text);
  }
}

html[data-theme="dark"] .topbar .nav-dropdown-menu a{color:var(--text)}
html[data-theme="dark"] .topbar .nav-dropdown-menu a:hover{color:var(--text)}
@media(prefers-color-scheme:dark){
  html[data-theme="system"] .topbar .nav-dropdown-menu a{color:var(--text)}
  html[data-theme="system"] .topbar .nav-dropdown-menu a:hover{color:var(--text)}
}
@media(max-width:900px){
  html[data-theme="dark"] .topbar .nav-dropdown-menu a{color:var(--brand-contrast)}
}
@media(max-width:900px) and (prefers-color-scheme:dark){
  html[data-theme="system"] .topbar .nav-dropdown-menu a{color:var(--brand-contrast)}
}

/* Persönliche Darstellung auf der Seite „Meine Einstellungen“. */
.personal-settings-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(320px,.92fr);gap:22px;align-items:start}
.personal-settings-grid>.panel{margin:0}
.appearance-intro{margin:-6px 0 16px}
.theme-options{display:grid;gap:10px;margin-bottom:18px}
.theme-option{
  display:grid;
  grid-template-columns:auto 42px minmax(0,1fr);
  gap:12px;
  align-items:center;
  min-height:78px;
  margin:0;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
.theme-option:hover{background:var(--surface-hover);border-color:#9db9bd}
.theme-option:has(input:checked){background:var(--primary-soft);border-color:var(--primary);box-shadow:inset 0 0 0 1px rgba(var(--primary-rgb),.10)}
.theme-option input[type="radio"]{width:18px;height:18px;margin:0;accent-color:var(--primary)}
.theme-option-icon{display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--line);border-radius:11px;background:var(--surface-subtle);color:var(--text)}
.theme-option-icon svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme-option>span:last-child{display:flex;flex-direction:column;gap:2px;min-width:0}
.theme-option strong{font-size:14px}
.theme-option small{color:var(--muted);font-size:12px;font-weight:500;line-height:1.35}
.appearance-save{width:100%;min-height:44px}
@media(max-width:900px){.personal-settings-grid{grid-template-columns:1fr}}
@media(max-width:480px){.theme-option{grid-template-columns:auto 36px minmax(0,1fr);padding:11px 12px}.theme-option-icon{width:36px;height:36px}.theme-option-icon svg{width:20px;height:20px}}

/* Weitere Theme-Anpassungen für Historien, Statusflächen und Modul-Controls. */
:root{--primary-emphasis:var(--primary-dark)}
html[data-theme="dark"]{--primary-emphasis:var(--primary-light)}
@media(prefers-color-scheme:dark){html[data-theme="system"]{--primary-emphasis:var(--primary-light)}}

.notify-toggle.is-on{background:var(--success-surface);color:var(--success-text);border-color:var(--line)}
.notify-toggle.is-off{background:var(--surface-soft);color:var(--muted);border-color:var(--line)}
.invoice-table tr.invoice-row-link:hover td,.invoice-table tr.invoice-row-link:focus-visible td{background:var(--surface-hover)}
.invoice-table tr.invoice-row-link:active td{background:var(--surface-soft)}
@media(max-width:760px){.invoice-table tr.invoice-row-link:active{background:var(--surface-soft)}}

.user-access-settings,.user-access-note,
.activity-change,.activity-change-compact,
.activity-modal-close,.activity-response-preview,
.password-value-row code{
  background:var(--surface-soft);
  color:var(--text);
  border-color:var(--line);
}
.activity-module{background:var(--surface-soft);color:var(--muted)}
.activity-module.keep,.activity-response-label{background:var(--success-surface);color:var(--success-text);border-color:var(--line)}
.keep-history-event-icon,.keep-history-event.created .keep-history-event-icon,.keep-history-event.changed .keep-history-event-icon{background:var(--surface-soft);color:var(--primary-emphasis)}
.keep-history-event.completed .keep-history-event-icon{background:var(--success-surface);color:var(--success-text)}
.keep-history-event.reopened .keep-history-event-icon{background:var(--surface-soft);color:var(--muted)}

.chips span,
.module-check:has(input:checked),
.keep-tabs a.active,.keep-status-filter a.active,
.assignee-check:has(input:checked),form label.assignee-check:has(input:checked),
.assignee-dropdown label.assignee-check:has(input:checked),
.topbar .nav-dropdown-menu a:hover,
.password-reset-button,
.activity-entity,.activity-unread-label,.activity-read-button,
.keep-filter-chips button:hover,
.password-mini-action,.password-mini-action:hover,.password-mini-action:focus-visible,
.activity-response-preview span{
  color:var(--primary-emphasis);
}

.user-status-badge.is-locked{background:var(--closed-surface);color:var(--closed-text);border-color:var(--line)}
.account-toggle.lock{background:var(--surface);color:var(--danger-text);border-color:var(--line)}
.account-toggle.lock:hover{background:var(--danger-surface);color:var(--danger-text)}
.password-field>span,.password-edit-panel .field-caption,.password-meta,.password-edit-meta{color:var(--muted);border-color:var(--line)}
.password-value-row code{border-color:var(--line)}
.user-module-chips span{color:var(--muted)}

html[data-theme="dark"] .module-card,
html[data-theme="dark"] .keep-card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .auth-card{box-shadow:0 1px 2px var(--shadow-color)}
@media(prefers-color-scheme:dark){
  html[data-theme="system"] .module-card,
  html[data-theme="system"] .keep-card,
  html[data-theme="system"] .stat,
  html[data-theme="system"] .panel,
  html[data-theme="system"] .auth-card{box-shadow:0 1px 2px var(--shadow-color)}
}

/* Dark-Mode-Feinschliff für Hover-Zustände und mobile Navigation. */
.button.secondary{color:var(--primary-emphasis)}
.danger-button:hover{background:var(--danger-surface);color:var(--danger-text);border-color:var(--line)}
.module-dropdown-toggle:hover,.module-dropdown-check:hover,
.policy-dropdown-toggle:hover,.policy-dropdown-option:hover,
.password-policy-option:hover,.task-priority-option:hover,
.password-mini-action:hover,.password-mini-action:focus-visible{
  background:var(--surface-hover);
  color:var(--text);
}
html[data-theme="dark"] .keep-card.is-done.is-important{background:#2b2020;color:var(--text)}
@media(prefers-color-scheme:dark){html[data-theme="system"] .keep-card.is-done.is-important{background:#2b2020;color:var(--text)}}
@media(max-width:900px){
  .topbar .nav-dropdown-menu{background:rgba(var(--brand-contrast-rgb),.07);border:0}
}


/* Update 89: native Einstellungs-Controls vollständig themefähig. */
html[data-theme="dark"] .settings-select,
html[data-theme="dark"] .settings-select option{
  background-color:var(--field-bg);
  color:var(--field-text);
}
@media(prefers-color-scheme:dark){
  html[data-theme="system"] .settings-select,
  html[data-theme="system"] .settings-select option{
    background-color:var(--field-bg);
    color:var(--field-text);
  }
}
.settings-grid input[type="file"]{color:var(--field-text)}
.settings-grid input[type="file"]::file-selector-button{
  color:var(--field-text);
  background:var(--surface-soft);
  border:1px solid var(--line);
  border-radius:7px;
  padding:7px 10px;
  margin-right:10px;
  cursor:pointer;
}
.settings-grid input[type="file"]::file-selector-button:hover{background:var(--surface-hover)}


/* Update 90: Logo-Vorschau folgt dem gewählten Theme statt festem Weiß. */
.portal-logo-preview img{background:var(--surface-soft)}
html[data-theme="dark"] .portal-logo-preview img{background:var(--field-bg)}
@media(prefers-color-scheme:dark){html[data-theme="system"] .portal-logo-preview img{background:var(--field-bg)}}

/* Update 92: Wichtige Aufgabentitel verwenden im Darkmode dieselbe Textfarbe wie normale Aufgaben. */
html[data-theme="dark"] .keep-card.is-important .keep-card-body h2{
  color:var(--text);
}
@media(prefers-color-scheme:dark){
  html[data-theme="system"] .keep-card.is-important .keep-card-body h2{
    color:var(--text);
  }
}


/* Update 93: Aufgaben-Historie im Darkmode + Schloss-Icon auf Startseite. */
.keep-history-event{color:var(--text)}
.keep-note-item{background:var(--surface-soft);color:var(--text);border-color:var(--line)}
.keep-note-head strong{color:var(--primary-emphasis)}
.keep-note-head time,.keep-history-event time{color:var(--muted)}
.password-module-icon::before,.password-module-icon::after{margin:0}

/* Update 94: Web-Push-Einstellungen und persistenter Hinweis auf neue Zuweisungen. */
.nav-task-link{display:inline-flex!important;align-items:center;gap:7px}
.nav-task-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#d92d20;color:#fff;font-size:11px;font-weight:850;line-height:1}
.task-flag.new-assignment{background:#e8f3ff;color:#175cd3;border-color:#b2d4ff}
.keep-card.has-new-assignment{box-shadow:0 0 0 2px rgba(23,92,211,.16),0 1px 2px var(--shadow-color)}
html[data-theme="dark"] .task-flag.new-assignment{background:#17345d;color:#a8ccff;border-color:#315f9d}
@media(prefers-color-scheme:dark){html[data-theme="system"] .task-flag.new-assignment{background:#17345d;color:#a8ccff;border-color:#315f9d}}

.push-settings-panel{grid-column:1/-1}
.push-settings-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.push-settings-head h2{margin:0 0 5px}
.push-settings-head p{margin:0;max-width:720px}
.push-status-badge{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:5px 10px;border:1px solid var(--line);border-radius:999px;background:var(--surface-soft);color:var(--muted);font-size:12px;font-weight:800;white-space:nowrap}
.push-status-badge[data-state="on"]{background:var(--success-surface);color:var(--success-text)}
.push-status-badge[data-state="off"]{background:var(--closed-surface);color:var(--closed-text)}
.push-device-status{display:flex;flex-direction:column;gap:4px;padding:14px 16px;border:1px solid var(--line);border-radius:11px;background:var(--surface-soft);margin-bottom:16px}
.push-device-status strong{font-size:14px}
.push-settings-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.push-settings-actions button{min-height:42px}
.push-settings-note{margin:14px 0 0;line-height:1.45}
@media(max-width:620px){.push-settings-head{flex-direction:column}.push-settings-actions{align-items:stretch}.push-settings-actions button{width:100%}}


/* Update 95: Alle eigenen Browser-Geräte gemeinsam abmelden. */
.push-settings-actions [data-push-disable-all]{margin-left:auto}
@media(max-width:620px){.push-settings-actions [data-push-disable-all]{margin-left:0}}
