*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: linear-gradient(to bottom, #FBF6E8 0%, #EFE4CA 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #111827;
}

:root {
  --app-modal-overlay-bg: rgba(15, 23, 42, 0.68);
  --app-modal-overlay-blur: 6px;
}

a {
  color: #16a34a;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

.view {
  min-height: 100vh;
}

.hidden {
  display: none;
}

.align-left {
  text-align: left;
}

.align-center {
  text-align: center;
}

.align-right {
  text-align: right;
}

/* Header / Top-Bar */
.top-bar {
  background: #ffffff;
  color: #111827;
  padding: 1.6rem 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.top-bar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 768px) {
  .top-bar-inner {
    padding: 0 1rem;
  }
}

.logo-text {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 400;
  background: linear-gradient(90deg, #008FD5, #72BF44);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-text .logo-budget {
  font-weight: 700;
}

.logo-text .logo-rechner {
  font-weight: 300;
  margin-left: 0.12em;
}

.top-logo {
  height: 76px;
  width: auto;
}

@media (max-width: 768px) {
  .top-logo {
    height: 60px;
  }

  /* Mobile: Seitenabstand für Boxen */
  .app-container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .admin-container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Layout */
.auth-container,
.app-container {
  max-width: 1240px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
}


/* Login: Willkommenstext + Bibelzitat ueber der Loginbox */
.auth-welcome,
.auth-verse {
  /* optisch bündig mit den Inhalten in den Boxen (Auth-Card) */
  padding: 0 1.5rem;
  line-height: 1.55;
}

.auth-welcome {
  margin: 0.25rem 0 1.25rem 0;
}

.auth-welcome-title {
  margin: 0 0 0.55rem 0;
  color: #4AA3E3;
  font-weight: 500;
  font-size: 1.5rem;
}

.auth-welcome p {
  margin: 0 0 0.85rem 0;
  font-size: 0.95rem;
  color: #111827;
}

/* Willkommenstext: Überschriften im Admin-HTML sollen wie die restlichen Überschriften wirken */
.auth-welcome-text h1,
.auth-welcome-text h2,
.auth-welcome-text h3,
.auth-welcome-text h4 {
  margin: 0.9rem 0 0.55rem 0;
  color: #4AA3E3;
  font-weight: 500;
  line-height: 1.25;
}

.auth-welcome-text h1 { font-size: 1.35rem; }
.auth-welcome-text h2 { font-size: 1.22rem; color: #4AA3E3; }
.auth-welcome-text h3 { font-size: 1.02rem; color: #4AA3E3; }
.auth-welcome-text h4 { font-size: 1.02rem; }

.auth-welcome-text p {
  margin: 0 0 0.85rem 0;
  font-size: 0.95rem;
  color: #111827;
}

.auth-welcome-text blockquote {
  margin: 0.9rem 0 0.9rem 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid rgba(74, 163, 227, 0.35);
}

.auth-welcome-text blockquote p {
  margin-bottom: 0.75rem;
}

.auth-welcome-text blockquote p:last-child {
  margin-bottom: 0;
}

.auth-welcome-text h1:first-child,
.auth-welcome-text h2:first-child,
.auth-welcome-text h3:first-child,
.auth-welcome-text h4:first-child {
  margin-top: 0;
}

/* Hinweiszeile: nicht fett */
.auth-welcome-lead {
  margin-top: 1rem;
  font-weight: 400;
}

.auth-verse {
  margin: 1.1rem 0 1.6rem 0;
}

/* Bibelzitat: dezent anders (dunkelgrün + fett) */
.auth-verse-text {
  font-size: 0.95rem;
  color: #15803d;
  font-weight: 600;
}

.auth-verse-ref {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #6b7280;
}




/* Login-Seite: 50/50 Split (nur Auth-View) */
#auth-view.auth-split {
  position: relative;
  min-height: 100vh;
}

/* Linke Seite (Inhalte + Footer) */
#auth-view.auth-split .auth-left,
#auth-view.auth-split .auth-footer {
  width: 50vw;
  max-width: 50vw;
  min-width: 0;
}

#auth-view.auth-split .auth-footer {
  box-sizing: border-box;
  padding: 0 1rem 1.5rem;
}

/* Rechte Seite: Bild immer viewport-hoch und ohne Mitscrollen */
#auth-view.auth-split .auth-right {
  position: fixed;
  top: 0;
  right: 0;
  width: 50vw;
  height: 100vh;
  /* Intro-Slideshow: Bilder werden automatisch aus /assets/images/slider/ geladen (nur JPG/JPEG). */
  background: #0b0f1a;
  overflow: hidden;
}

#auth-view.auth-split .auth-right .auth-right-bg {
  position: absolute;
  inset: 0;
  background: center center / cover no-repeat;
  opacity: 0;
  /* Überblendung einstellbar (Admin: Slider) */
  transition: opacity var(--intro-fade, 2s) ease-in-out;
}

#auth-view.auth-split .auth-right .auth-right-bg.is-active {
  opacity: 1;
}

#auth-view.auth-split .auth-right .auth-right-logo {
  z-index: 2;
}

#auth-view.auth-split .auth-right-logo {
  position: absolute;
  top: 30px;
  right: 30px;
  height: 64px;
  width: auto;
}

/* Header im Auth-View bündig zu den Inhalten */
#auth-view.auth-split .top-bar-inner {
  max-width: 1040px;
  margin: 0 auto;
  /* optisch bündig mit den Inhalten in den Karten */
  padding: 0 1rem 0 2.5rem;
  justify-content: flex-start;
}

/* Login: Inputs untereinander */
#auth-view.auth-split .auth-login .row {
  flex-direction: column;
}

#auth-view.auth-split .auth-login .row .field {
  width: 100%;
}

#auth-view.auth-split .auth-login .auth-login-actions {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.auth-reset-link {
  background: none;
  border: none;
  padding: 0.2rem 0;
  color: #16a34a;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1.2;
  margin-left: auto;
  align-self: flex-start;
}

.auth-reset-link:hover {
  text-decoration: underline;
}

.profile-edit-form input[type="password"]::placeholder {
  color: #9ca3af;
}

/* Registrierung: kompakt nebeneinander */
#auth-view.auth-split .auth-register .row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#auth-view.auth-split .auth-register .row .field {
  flex: 1 1 0;
  min-width: 0;
}

#auth-view.auth-split .auth-register .field.w-15 {
  flex: 0 0 15%;
  max-width: 15%;
}

#auth-view.auth-split .auth-register .field.w-50 {
  flex: 0 0 calc(50% - 0.375rem);
  max-width: calc(50% - 0.375rem);
}

#auth-view.auth-split .auth-register .field.w-country {
  flex: 0 0 4.8rem;
  max-width: 4.8rem;
}

.country-code-field input {
  width: 100%;
  max-width: 4.8rem;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.03em;
}

#auth-view.auth-split .beta-inline {
  font-size: 0.8em;
  color: #6b7280;
  font-weight: 400;
  margin-left: 0.35rem;
}

/* Mobile: Bild in den Flow zwischen Karte und Footer (grob quadratisch) */
@media (max-width: 900px) {
  #auth-view.auth-split .auth-left,
  #auth-view.auth-split .auth-footer {
    width: 100%;
    max-width: none;
  }

  #auth-view.auth-split .auth-right {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 260px;
    aspect-ratio: 1 / 1;
  }

  /* Mobile-Header: zentriert */
  #auth-view.auth-split .top-bar-inner {
    justify-content: center;
    padding: 0 1rem;
  }

  #auth-view.auth-split .top-left {
    align-items: center;
    text-align: center;
  }

  /* BUDGETRECHNER: Schriftgroesse responsive zur Handybreite */
  #auth-view.auth-split .logo-text {
    font-size: clamp(1.95rem, 8.2vw, 2.9rem);
    line-height: 1.05;
    white-space: nowrap;
  }

  /* Logo im Bildbereich auf Mobile deutlich kleiner (ca. 25%) */
  #auth-view.auth-split .auth-right-logo {
    width: 25%;
    height: auto;
  }

  /* Mehr Abstand unter dem Impressum (iOS Home-Indicator) */
  #auth-view.auth-split .auth-footer {
    box-sizing: border-box;
    padding: 0 1rem calc(20px + env(safe-area-inset-bottom));
  }

  /* Mobile: Registrierung wieder untereinander */
  #auth-view.auth-split .auth-register .row {
    flex-direction: column;
    gap: 0.6rem;
  }

  #auth-view.auth-split .auth-register .field.w-15,
  #auth-view.auth-split .auth-register .field.w-50,
  #auth-view.auth-split .auth-register .field.w-country {
    flex: 1 1 100%;
    max-width: 100%;
  }

}

/* Rechtstexte im Startseiten-Layout */
#auth-view.auth-split.legal-view .top-bar-inner {
  justify-content: flex-start;
  align-items: flex-start;
}

#auth-view.auth-split.legal-view .legal-logo-link {
  text-decoration: none;
}

#auth-view.auth-split.legal-view .legal-nav-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 0.85rem 0;
}

#auth-view.auth-split.legal-view .legal-back-btn {
  white-space: nowrap;
}

#auth-view.auth-split.legal-view .legal-container {
  margin-top: 1.25rem;
}

#auth-view.auth-split.legal-view .legal-card {
  max-width: 1040px;
  margin-bottom: 0.85rem;
}

#auth-view.auth-split.legal-view .legal-content {
  color: #111827;
  line-height: 1.55;
}

#auth-view.auth-split.legal-view .legal-content h1,
#auth-view.auth-split.legal-view .legal-content h2,
#auth-view.auth-split.legal-view .legal-content h3,
#auth-view.auth-split.legal-view .legal-content h4 {
  color: #4AA3E3;
  line-height: 1.25;
  margin: 1.1rem 0 0.55rem 0;
}

#auth-view.auth-split.legal-view .legal-content h1 {
  margin-top: 0;
  font-size: 1.45rem;
}

#auth-view.auth-split.legal-view .legal-content h2 {
  font-size: 1.2rem;
}

#auth-view.auth-split.legal-view .legal-content h3,
#auth-view.auth-split.legal-view .legal-content h4 {
  font-size: 1rem;
}

#auth-view.auth-split.legal-view .legal-content p,
#auth-view.auth-split.legal-view .legal-content li {
  font-size: 0.95rem;
}

#auth-view.auth-split.legal-view .legal-content ul,
#auth-view.auth-split.legal-view .legal-content ol {
  padding-left: 1.35rem;
}

#auth-view.auth-split.legal-view .legal-extra-content {
  margin-top: 1.1rem;
  padding-top: 0.95rem;
  border-top: 1px solid #d1d5db;
}

#auth-view.auth-split.legal-view .auth-right-logo-link {
  display: inline-block;
}

@media (max-width: 900px) {
  #auth-view.auth-split.legal-view .top-bar-inner {
    justify-content: flex-start;
    align-items: flex-start;
  }

  #auth-view.auth-split.legal-view .top-left {
    align-items: center;
    text-align: center;
  }

  #auth-view.auth-split.legal-view .legal-back-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}


.card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.row {
  display: flex;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.field label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #4b5563;
}

.field input,
.field select,
.input-base,
.layout-input,
.layout-color {
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: #fff;
  color: #111827;
}

.profile-edit-form input,
.profile-edit-form select {
  border-width: 2px;
}

.tips-modal-body h1,
.tips-modal-body h2,
.tips-modal-body h3 {
  color: var(--tips-accent);
}

.tips-modal-body a {
  color: var(--tips-accent);
}

.tips-modal-body a:hover {
  text-decoration: underline;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

/* TinyMCE (minimal, im Admin/Partner) */
.tox.tox-tinymce {
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.tox .tox-editor-header {
  box-shadow: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary {
  background: #fff !important;
}

.tox .tox-tbtn {
  border-radius: 10px !important;
}

.tox .tox-tbtn:hover {
  background: rgba(74, 163, 227, 0.12) !important;
}

.tox .tox-tbtn--enabled,
.tox .tox-tbtn--enabled:hover {
  background: rgba(74, 163, 227, 0.2) !important;
}

.tox .tox-edit-area::before {
  border: 0 !important;
}

/* TinyMCE Dialoge im App-Stil */
.tox.tox-silver-sink .tox-dialog-wrap__backdrop,
.tox.tox-tinymce-aux .tox-dialog-wrap__backdrop,
.tox .tox-dialog-wrap__backdrop {
  background: var(--app-modal-overlay-bg) !important;
  opacity: 1 !important;
  backdrop-filter: blur(var(--app-modal-overlay-blur)) !important;
  -webkit-backdrop-filter: blur(var(--app-modal-overlay-blur)) !important;
}

.tox.tox-silver-sink .tox-dialog {
  border-radius: 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22) !important;
}

.tox.tox-silver-sink .tox-dialog__header,
.tox.tox-silver-sink .tox-dialog__footer {
  background: #fff !important;
}

.tox.tox-silver-sink .tox-dialog__header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.tox.tox-silver-sink .tox-dialog__footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.tox.tox-silver-sink .tox-label,
.tox.tox-silver-sink .tox-dialog__body-content label {
  color: #4b5563 !important;
  font-size: 0.9rem !important;
}

.tox.tox-silver-sink .tox-textfield,
.tox.tox-silver-sink .tox-listboxfield .tox-listbox--select,
.tox.tox-silver-sink .tox-textarea {
  border-radius: 10px !important;
  border: 1px solid #d1d5db !important;
  min-height: 42px !important;
}

.tox.tox-silver-sink .tox-textfield:focus,
.tox.tox-silver-sink .tox-listboxfield .tox-listbox--select:focus,
.tox.tox-silver-sink .tox-textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 1px #3b82f6 !important;
}

.tox.tox-silver-sink .tox-dialog__footer .tox-button {
  border-radius: 999px !important;
  border: 1px solid #ffffff !important;
  padding: 0.5rem 1.2rem !important;
  font-size: 0.9rem !important;
  line-height: 1.2 !important;
}

.tox.tox-silver-sink .tox-dialog__footer .tox-button--secondary {
  background: #e5e7eb !important;
  color: #111827 !important;
}

.tox.tox-silver-sink .tox-dialog__footer .tox-button:not(.tox-button--secondary) {
  background: #16a34a !important;
  color: #fff !important;
}

.tox.tox-silver-sink .tox-dialog__footer .tox-button:not(.tox-button--secondary):hover {
  background: #15803d !important;
}

/* Admin: Layout-Box */
.layout-grid {
  display: grid;
  grid-template-columns: 90px 80px 80px;
  gap: 10px 12px;
  align-items: center;
}

.layout-input {
  width: 80px;
}

.layout-color {
  width: 40px;
  height: 28px;
  padding: 2px;
}

.layout-color::-webkit-color-swatch-wrapper { padding: 0; }
.layout-color::-webkit-color-swatch { border: none; border-radius: 6px; }
.layout-color::-moz-color-swatch { border: none; border-radius: 6px; }

.layout-head {
  font-size: 0.85rem;
  color: #4b5563;
}

.layout-label {
  font-weight: 400;
  font-size: 0.85rem;
  color: #4b5563;
}

.layout-popup-block {
  margin-top: 10px;
}

.layout-popup-title {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0 0 6px 0;
}

.layout-popup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: center;
}

.layout-popup-grid .layout-head {
  margin: 0;
}

.layout-popup-grid .layout-input {
  width: 100%;
  max-width: 100%;
}

.layout-popup-grid .layout-color {
  width: 100%;
  max-width: 64px;
  height: 36px;
  justify-self: start;
}

@media (max-width: 700px) {
  .layout-grid { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .layout-grid .layout-head { display: none; }
  .layout-grid .layout-label { grid-column: 1 / -1; }
  .layout-input { width: 100%; }
  .layout-popup-grid { gap: 8px; }
  .layout-popup-grid .layout-head { font-size: 0.8rem; }
  .layout-popup-grid .layout-color { max-width: 56px; }
}

.button-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.app-actions {
  justify-content: space-between;
  margin-top: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.app-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

/* CSV Export Icon (unten links) */
.footer-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #16a34a; /* dunkelgrau */
  cursor: pointer;
  border-radius: 999px;
}

.footer-icon-btn:hover {
  background: rgba(17, 24, 39, 0.06);
}

.footer-doc-icon {
  width: 26px;
  height: 26px;
}

/* Export Dropdown (unten links) */
.export-menu{
  position:relative;
  display:inline-flex;
  align-items:center;
}
.export-dropdown{
  position:absolute;
  left:0;
  bottom:48px;
  min-width:170px;
  padding:0.35rem;
  background:#ffffff;
  border:1px solid rgba(17,24,39,0.12);
  border-radius:0.85rem;
  box-shadow:0 14px 40px rgba(17,24,39,0.14);
  z-index:50;
}
.export-item{
  display:block;
  width:100%;
  border:none;
  background:transparent;
  padding:0.55rem 0.65rem;
  border-radius:999px;
  text-align:left;
  font-size:0.9rem;
  cursor:pointer;
  color:#111827;
}
.export-item:hover{
  background:rgba(17,24,39,0.06);
}
.footer-icon-btn svg * {
  fill: currentColor;
  stroke: none;
}

/* Wenn ein Element explizit fill="none" hat, nicht füllen */
.footer-icon-btn svg [fill="none"] {
  fill: none;
}

/* Wenn ein Element einen Stroke definiert (Outline-Icons), Stroke einfärben und standardmäßig nicht füllen */
.footer-icon-btn svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
}


.btn {
  border: 1px solid #ffffff;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
  margin: 3px;
  text-decoration: none;
  display: inline-block;
}

.btn-blue {
  background: #4AA3E3;
  color: #ffffff;
}

.btn-blue:hover {
  background: #2f8acb;
}

.btn.small {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.btn-green {
  background: #16a34a;
  color: white;
}

.btn-green:hover {
  background: #15803d;
}

.btn-orange {
  background: #f97316;
  color: white;
}

.btn-orange:hover {
  background: #ea580c;
}

.btn-red {
  background: #dc2626;
  color: white;
}

.btn-red:hover {
  background: #b91c1c;
}

.btn-purple {
  background: #a855f7;
  color: white;
}

.btn-purple:hover {
  background: #9333ea;
}

.btn-teal {
  background: #21888f;
  color: white;
}

.btn-teal:hover {
  background: #1b7379;
}

.btn-brown {
  background: #a06500;
  color: white;
}

.btn-brown:hover {
  background: #8b5700;
}

.message {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.message.error {
  color: #b91c1c;
  border: 1px solid #b91c1c;
  background: rgba(185, 28, 28, 0.08);
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
}

.message.success {
  color: #16a34a;
  border: 1px solid #16a34a;
  background: rgba(22, 163, 74, 0.10);
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
}

/* Lizenz-Sperrhinweis (wenn keine gültige Lizenz vorliegt) */
.license-locked-message {
  max-width: 780px;
  margin: 60px auto 40px;
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
  background: linear-gradient(145deg, #ffffff 0%, #f3faff 100%);
  border: 1px solid rgba(74, 163, 227, 0.2);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(31, 80, 115, 0.1);
}
.license-locked-title {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 12px;
  color: #4AA3E3;
}
.license-locked-text {
  max-width: 640px;
  margin: 0 auto 28px;
  font-size: 17px;
  color: rgba(17, 24, 39, 0.72);
  line-height: 1.6;
}
.license-trial-offer {
  max-width: 560px;
  margin: 0 auto 22px;
  padding: 22px;
  background: #ffffff;
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(22, 163, 74, 0.09);
}
.license-trial-label {
  margin-bottom: 15px;
  color: #166534;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.1px;
}
.license-choice-form {
  margin: 0;
}
.license-trial-start.btn {
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 0.85rem 1.5rem;
  font-size: 1.08rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.2);
}
.license-secondary-actions {
  display: flex;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.license-secondary-actions-single {
  justify-content: flex-end;
}
.license-secondary-actions .btn {
  min-width: 210px;
  min-height: 52px;
  margin: 0;
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.license-logout-form {
  margin: 0;
}
.license-logout-button {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}
.license-logout-button:hover {
  background: #f1f5f9;
  color: #1f2937;
}
.license-choice-message {
  margin: 0 auto 18px;
  max-width: 620px;
}
.app-actions.app-actions-locked {
  justify-content: center;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .license-locked-message {
    margin: 30px auto 24px;
    padding: 26px 18px;
    border-radius: 18px;
  }
  .license-locked-text {
    font-size: 16px;
  }
  .license-trial-offer {
    padding: 18px;
  }
  .license-secondary-actions {
    gap: 10px;
  }
  .license-secondary-actions .btn {
    min-width: 0;
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
  }
  .license-shop-button,
  .license-logout-form {
    flex: 1 1 0;
  }
}

/* Auth: Bestaetigungsbox (Account bestaetigt) */
#auth-view .auth-confirm {
  margin: 0 1.5rem 1.4rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  /* Unser Gruen als sehr helle Toenueng (10% + 5% kraeftiger = 15%) */
  background: rgba(22, 163, 74, 0.15);
  border: 1px solid #16a34a;
  color: #111827;
  text-align: center;
  position: relative;
  line-height: 1.4;
}

/* Auth: Hinweis nach erfolgreicher Registrierung (gruen hinterlegt, Text schwarz) */
#auth-view .auth-register .message.success {
  background: rgba(22, 163, 74, 0.10);
  border: 1px solid #16a34a;
  color: #111827;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
}

/* Auth: "Login" und "Registrieren" wie App-Ueberschriften (eingeloggt) */
#auth-view .auth-section-title,
#auth-view .auth-register-toggle,
#auth-view .auth-register-toggle span:first-child {
  color: #4AA3E3;
  font-weight: 500;
  font-size: 1.5rem;
}

#auth-view .auth-confirm.success::after {
  content: "i";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.user-profile-trigger {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  width: 100%;
}

.user-profile-row {
  display: flex;
  align-items: flex-start;
  gap: var(--user-avatar-gap, 0.9rem);
  width: 100%;
}

.user-profile-trigger:focus-visible {
  outline: 2px solid #4AA3E3;
  outline-offset: 4px;
  border-radius: 0.6rem;
}

.user-avatar {
  width: var(--user-avatar-size, 58px);
  height: var(--user-avatar-size, 58px);
  border-radius: 50%;
  background: #4AA3E3;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-avatar::before,
.user-avatar::after {
  content: "";
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.user-avatar::before {
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
}

.user-avatar::after {
  width: 22px;
  height: 22px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: url("icons/pencil.svg") center/contain no-repeat;
}

.user-profile-trigger:hover .user-avatar::before,
.user-profile-trigger:hover .user-avatar::after,
.user-profile-trigger:focus-visible .user-avatar::before,
.user-profile-trigger:focus-visible .user-avatar::after {
  opacity: 1;
}

.user-summary-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.user-main {
  flex: 0 0 50%;
  --user-avatar-size: 58px;
  --user-avatar-gap: 0.9rem;
}

.user-weekly-verse {
  flex: 0 0 50%;
  padding-right: 0.6rem;
}

.user-info .user-name,
.weekly-verse-heading {
  font-size: 1.5rem;
  font-weight: 500;
  color: #4AA3E3;
  margin: 0;
  margin-bottom: 0.25rem;
}

.weekly-verse-text {
  font-size: 0.9rem;
  color: #111827;
  margin-bottom: 0.25rem;
}

.weekly-verse-reference {
  font-size: 0.9rem;
}

.weekly-verse-link {
  color: #16a34a;
  text-decoration: none;
}

.weekly-verse-link:hover {
  text-decoration: none;
}

.weekly-verse-external {
  display: inline-block;
  margin-left: 0.3em;
  font-size: 0.75em;
  line-height: 1;
  transform: translateY(-0.05em);
}

.weekly-verse-external::before {
  content: "→";
}
.weekly-verse-empty {
  font-size: 0.9rem;
  color: #4b5563;
  font-style: italic;
}

.user-profile-actions {
  margin-top: 0.5rem;
}

.profile-save-link {
  font-size: 0.8rem;
  color: #72BF44;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.profile-save-link:hover {
  text-decoration: underline;
}
.profile-edit-link {
  font-size: 0.8rem;
  color: #72BF44;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.profile-edit-link:hover {
  text-decoration: underline;
}

.profile-edit-panel {
  margin-top: 0.5rem;
}

.profile-edit-panel.is-collapsed {
  display: none;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem 0.75rem;
}

.profile-edit-form .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1rem;
}

.profile-edit-form .row.row-city-country {
  grid-template-columns: minmax(0, 1fr) minmax(4.8rem, 5.2rem) minmax(0, 1fr);
}


.profile-modal-header {
  border-bottom: 1px solid var(--profile-accent);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.profile-modal-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0;
  padding-right: 2.25rem;
}

.modal-profile .modal-close-btn {
  color: var(--profile-accent);
}

.modal-profile .modal-close-btn:hover {
  color: #15803d;
}

.profile-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.profile-avatar-control {
  display: flex;
  align-items: flex-start;
}

.profile-avatar-block {
  align-items: center;
}

.profile-avatar-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
}

.profile-avatar-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.1rem;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4AA3E3;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  border: 2px solid #ffffff;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-title {
  font-size: 0.85rem;
  color: #4b5563;
  font-weight: 600;
  white-space: nowrap;
}

.profile-avatar-hint {
  font-size: 0.65rem;
  color: #6b7280;
}

.profile-avatar-remove {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--profile-accent);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}

.profile-avatar-remove:hover {
  text-decoration: none;
}

.profile-avatar-remove.placeholder {
  opacity: 1;
  font-weight: 400;
  color: var(--profile-accent);
  cursor: default;
  pointer-events: none;
}

.profile-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-license-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-license-block .field {
  margin-bottom: 0;
}

.profile-license-block .field input {
  width: 100%;
}

.modal-profile .profile-license-hint {
  margin-bottom: 10px;
}

.profile-license-block .input-inline {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.profile-license-block .input-inline input {
  width: 100%;
  min-width: 0;
}

.profile-license-block .input-inline button {
  width: auto;
}

.profile-license-status {
  font-size: 0.85rem;
  margin: 0;
}

.profile-visual-grid {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.profile-visual-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-visual-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

.profile-visual-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.profile-visual-option input[type="checkbox"] {
  margin: 0;
}

.profile-language-col {
  gap: 0.5rem;
}

.profile-language-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-language-option {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.profile-language-flag {
  width: 35px;
  height: 35px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0;
  overflow: hidden;
  flex: 0 0 35px;
}

.profile-language-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.profile-language-option.is-selected .profile-language-flag {
  outline: 2px solid #111827;
  outline-offset: 3px;
}

.profile-language-option:focus-visible .profile-language-flag {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .profile-visual-grid {
    grid-template-columns: 1fr;
  }
}

.license-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0;
}

.license-status-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  white-space: nowrap;
}

.license-status-label {
  color: #6b7280;
}

.license-status-value {
  font-weight: 600;
}

.license-status-value.status-active { color: #16a34a; }
.license-status-value.status-inactive { color: #6b7280; }
.license-status-value.status-expired { color: #dc2626; }

.profile-license-hint:empty {
  display: none;
}

.profile-edit-form input.sync-same {
  border-color: #16a34a;
  box-shadow: 0 0 0 1px #16a34a;
}

.admin-lang-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
}

.admin-lang-chip {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.admin-lang-chip-flag {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0;
  overflow: hidden;
}

.admin-lang-chip-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.admin-lang-chip.is-active .admin-lang-chip-flag {
  outline: 2px solid #111827;
  outline-offset: 3px;
}

.admin-lang-chip:focus-visible .admin-lang-chip-flag {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.admin-ui-languages {
  gap: 8px;
}

.admin-ui-lang-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.admin-ui-lang-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-ui-lang-text {
  font-size: 0.92rem;
  color: #374151;
}

.admin-ui-lang-mini {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  padding: 0;
  overflow: hidden;
  flex: 0 0 20px;
}

.admin-ui-lang-edit {
  margin-left: auto;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
}

.admin-ui-lang-edit-circle {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #4AA3E3;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-ui-lang-edit svg {
  width: 12px;
  height: 12px;
  display: block;
}

.admin-ui-lang-edit svg * {
  fill: #fff;
}

.admin-ui-lang-edit:focus-visible .admin-ui-lang-edit-circle {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.admin-ui-lang-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.admin-ui-lang-input:checked ~ .admin-ui-lang-mini {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.admin-ui-lang-input:focus-visible ~ .admin-ui-lang-mini {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.lang-edit-modal-content {
  max-width: 1280px;
  width: min(1280px, 96vw);
}

.lang-edit-modal .tips-modal-content {
  max-width: 1280px !important;
  width: min(1280px, 96vw) !important;
}

.lang-edit-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  margin-bottom: 12px;
}

.lang-edit-tab {
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-edit-tab.is-active {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.lang-edit-section {
  margin-top: 4px;
}

.lang-help-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lang-help-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: color-mix(in srgb, var(--help-color, #4AA3E3) 5%, #ffffff);
  padding: 10px 12px 12px;
  position: relative;
}

.lang-help-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
  background: var(--help-color, #4AA3E3);
}

.lang-help-card-title {
  font-weight: 600;
  color: var(--help-color, #4AA3E3);
  margin: 2px 0 10px 0;
}

.lang-help-row {
  border-bottom: none;
  padding: 0;
  align-items: stretch;
  background: transparent;
}

.lang-help-row .lang-edit-ref {
  align-self: stretch;
  white-space: normal;
  padding-top: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: #111827;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px;
}

.lang-help-ref h1,
.lang-help-ref h2,
.lang-help-ref h3 {
  color: var(--help-color, #4AA3E3);
  font-weight: 600;
  line-height: 1.25;
  margin: 0.9rem 0 0.5rem 0;
}

.lang-help-ref h1 { font-size: 1.35rem; }
.lang-help-ref h2 { font-size: 1.15rem; }
.lang-help-ref h3 { font-size: 1.02rem; }

.lang-help-ref p {
  margin: 0 0 0.85rem 0;
}

.lang-help-ref ul,
.lang-help-ref ol {
  margin: 0 0 0.85rem 1.1rem;
  padding: 0;
}

.lang-help-ref li {
  margin: 0.15rem 0;
}

.lang-help-ref a {
  color: #16a34a;
  text-decoration: none;
}

.lang-help-ref blockquote {
  margin: 0.9rem 0 0.9rem 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid rgba(74, 163, 227, 0.35);
}

.lang-help-card .tox-tinymce {
  border: 1px solid var(--help-color, #4AA3E3);
  box-shadow: 0 0 0 1px var(--help-color, #4AA3E3);
  background: #fff;
}

.lang-help-card .tox-editor-header {
  border-bottom: 1px solid var(--help-color, #4AA3E3);
}

.lang-help-card .tox-edit-area,
.lang-help-card .tox-editor-container {
  background: #fff;
}

.lang-help-input {
  min-height: 140px;
}

.lang-edit-grid {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 12px;
}

.lang-edit-head {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
}

.lang-edit-rows {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}

.lang-edit-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.lang-edit-row:last-child {
  border-bottom: none;
}

.lang-edit-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: #6b7280;
  word-break: break-all;
}

.lang-edit-ref {
  font-size: 0.85rem;
  color: #374151;
  white-space: pre-wrap;
  padding-top: 4px;
}

.lang-edit-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
  background: #fff;
}

.lang-edit-rows .lang-edit-input {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.lang-edit-rows .lang-edit-input {
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .lang-edit-grid,
  .lang-edit-row {
    grid-template-columns: 1fr;
  }
}

.profile-edit-form input.sync-diff {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b;
}

@media (max-width: 640px) {
  .user-header {
    flex-direction: column;
  }
  .user-weekly-verse {
    order: -1;
  }
  .profile-edit-form .row {
    grid-template-columns: 1fr;
  }
  .profile-edit-form .row.row-city-country {
    grid-template-columns: 1fr;
  }

  .profile-modal-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-right: 0;
  }
  .profile-avatar-meta {
    align-items: flex-start;
    text-align: left;
  }
  .profile-top-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile: Monatszeilen – Income/Expense kompakt untereinander */
  .details-month-sub {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem; /* weniger Abstand zwischen den 2 Zeilen */
  }
  .details-month-sep { display: none; }
  .details-month-item {
    padding-bottom: calc(0.35rem + 3px); /* 3px mehr unter dem Monat */
  }
}
.field-compact {
  margin-bottom: 0.25rem;
}

.field-compact label {
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}

.field-compact input {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: none;
  background: #FBF6E8;
  width: 100%;
}

.profile-edit-actions {
  margin-top: 0.5rem;
}

.user-email-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.05rem;
}

.user-license-row {
  margin-top: 0.35rem;
  font-size: 0.7rem;
}

.user-license-label {
  color: #6b7280;
  margin-right: 0.35rem;
}

.user-license-value.is-placeholder {
  color: #9ca3af;
}

.beta-inline {
  font-size: 0.8em;
  color: #6b7280;
  font-weight: 400;
  margin-left: 0.35rem;
}


.user-email {
  font-size: 0.9rem;
  color: #4b5563;
}

.user-tithe-hint {
  margin-top: 0.4rem;
  margin-left: calc(var(--user-avatar-size, 58px) + var(--user-avatar-gap, 0.9rem));
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  font-size: 0.7rem;
  color: #a06500;
  width: fit-content;
  max-width: calc(100% - (var(--user-avatar-size, 58px) + var(--user-avatar-gap, 0.9rem)));
}

.user-tithe-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-start;
}

.user-tithe-label {
  opacity: 0.85;
}

.user-tithe-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.user-visual-boxes {
  margin-top: 0;
  margin-left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  justify-content: start;
}

/* Kacheln bleiben gleich groß; bei weniger aktiven Bereichen rutschen sie nur nach links */
.user-visual-boxes[data-count="1"],
.user-visual-boxes[data-count="2"],
.user-visual-boxes[data-count="3"],
.user-visual-boxes[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.user-visual-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  background: transparent;
  --visual-accent: #374151;
  --visual-accent-dark: #1f2937;
  --visual-ring-size: 120px;
}

.user-visual-ring {
  position: relative;
  width: 100%;
  max-width: var(--visual-ring-size);
  aspect-ratio: 1 / 1;
  margin-left: auto;
  margin-right: auto;
}

.user-visual-ring-svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.user-visual-track,
.user-visual-progress,
.user-visual-progress-overflow {
  fill: none;
  stroke-width: 10;
}

.user-visual-track {
  stroke: rgba(17, 24, 39, 0.1);
}

.user-visual-progress {
  stroke: var(--visual-accent);
  stroke-linecap: round;
  opacity: 0;
}

.user-visual-progress-overflow {
  stroke: var(--visual-accent-dark);
  stroke-linecap: round;
  opacity: 0;
}

.user-visual-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--visual-accent);
  line-height: 1.15;
  width: calc(100% - 20px);
  max-width: calc(100% - 20px);
  padding: 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.user-visual-value-tithe {
  position: absolute;
}

.user-visual-factor-suffix {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 16px);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: var(--visual-accent);
  white-space: nowrap;
}

.user-visual-text {
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.2;
  color: #6b7280;
  width: 100%;
  max-width: 100%;
  word-break: break-word;
}

.user-visual-line {
  display: block;
}

.user-visual-line-small {
  font-size: 0.9rem;
  color: #6b7280;
}

.user-visual-text > #visual-tithe-line1,
.user-visual-text > #visual-donation-line1,
.user-visual-text > #visual-saving-line1,
.user-visual-text > #visual-available-line1 {
  color: var(--visual-accent);
  font-weight: 700;
  font-size: 1.2rem;
}

.user-visual-line-percent {
  font-size: 1rem;
  color: var(--visual-accent);
}

.user-visual-percent {
  font-weight: 700;
  font-size: 1.28rem;
  color: var(--visual-accent);
}

.user-visual-box-tithe { --visual-accent: #a06500; --visual-accent-dark: #704700; --visual-accent-light: #d8b779; }
.user-visual-box-donation { --visual-accent: #21888f; --visual-accent-dark: #175f64; }
.user-visual-box-saving { --visual-accent: #f97316; --visual-accent-dark: #ae510f; }
.user-visual-box-available { --visual-accent: #16a34a; --visual-accent-dark: #0f7234; }

.user-visual-box-tithe.is-overfull .user-visual-progress {
  stroke: var(--visual-accent-light);
}

.user-visual-box-tithe.is-overfull .user-visual-progress-overflow {
  stroke: var(--visual-accent);
}

@media (max-width: 1024px) {
  .user-visual-boxes[data-count="1"],
  .user-visual-boxes[data-count="2"],
  .user-visual-boxes[data-count="3"],
  .user-visual-boxes[data-count="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .user-visual-boxes {
    width: 100%;
  }

  .user-profile-trigger {
    gap: 15px;
  }

  .user-visual-box {
    width: 100%;
    align-items: center;
  }

  .user-visual-box {
    --visual-ring-size: 86px;
  }

  .user-visual-text {
    line-height: 1.1;
  }

  .user-visual-line-small,
  .user-visual-line-percent {
    font-size: 0.88rem;
  }

  .user-visual-percent {
    font-size: 1.02rem;
  }

  .user-visual-text > #visual-tithe-line1,
  .user-visual-text > #visual-donation-line1,
  .user-visual-text > #visual-saving-line1,
  .user-visual-text > #visual-available-line1 {
    font-size: 0.95rem;
  }

  .user-visual-factor-suffix {
    transform: translate(-50%, 13px);
    font-size: 0.68rem;
  }

}

.user-visual-box.is-placeholder {
  display: none;
}

.user-contact-lines {
  margin-top: 0.15rem;
}

.user-edit-link-row {
  margin-top: 0.6rem;
}

.user-contact-line {
  font-size: 0.9rem;
  color: #4b5563;
}
.icon-button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #4b5563; /* Default: dunkelgrau, wird je Bereich überschrieben */
}

.icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.icon-button svg * {
  fill: currentColor;
  stroke: none;
}

/* Wenn ein Element explizit fill="none" hat, nicht füllen */
.icon-button svg [fill="none"] {
  fill: none;
}

/* Wenn ein Element einen Stroke definiert (Outline-Icons), Stroke einfärben und standardmäßig nicht füllen */
.icon-button svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
}

/* Fallback (falls irgendwo noch <img> genutzt wird) */
.icon-button img {
  width: 18px;
  height: 18px;
  display: block;
}

/* Summary */
.summary-grid {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.summary {
  flex: 1 1 50%;
  position: relative;
  padding-bottom: 2.4rem;
}

.category-card {
  flex: 1 1 50%;
}

.year-nav-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0 0.45rem;
  margin-bottom: 0.35rem;
}

.year-nav-title {
  margin: 0;
  font-size: 1.55rem;
  color: #4AA3E3;
  font-weight: 600;
}

.year-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.year-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #eef0f4;
  color: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.year-nav-btn .year-nav-arrow {
  font-size: 0.9rem;
  line-height: 1;
}

.year-nav-btn.is-disabled,
.year-nav-btn:disabled {
  color: #9ca3af;
  cursor: default;
  opacity: 1;
}

.year-modal-content {
  max-width: 560px;
}

.year-modal-action-row {
  margin: 0.35rem 0 0.85rem;
  padding: 0.35rem 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.year-modal-target {
  font-size: 0.95rem;
  color: #111827;
}

.year-delete-highlight {
  color: #dc2626;
  font-weight: 700;
}

.category-card .category-title-income {
  color: #4AA3E3;
}

.category-card .category-title-expense {
  color: #dc2626;
}

.category-card .category-title-saving {
  color: #f97316;
}

.category-card .category-title-donation {
  color: #21888f;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin: 0.3rem 0;
  font-size: 0.95rem;
}

.sum-value {
  font-variant-numeric: tabular-nums;
}

.summary-row-month-net span {
  font-weight: 700;
}

/* Farbige Labels */
.label-expense {
  color: #dc2626;
}

.label-net {
  color: #16a34a;
}

.label-tithe {
  color: #a06500;
}

.label-mandatory {
  color: #a855f7;
}

.label-income {
  color: #4AA3E3;
}

.label-saving {
  color: #f97316;
}

.label-donation {
  color: #21888f;
}

.value-income {
  color: #4AA3E3;
}

.label-budget {
  color: #6b7280;
}

.value-budget {
  color: #6b7280;
}

/* Balken für Nettobudget / Zehnter / Ausgaben */
.dual-bar-wrapper {
  position: relative;
  height: 0.9rem;
  /* etwas mehr Abstand zur Überschrift */
  margin: 1.05rem 0 1rem;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: visible;
}


/* Skala-Markierungen über dem Balken (0/25/50/75/100) */
.dual-bar-ticks {
  position: absolute;
  left: 0;
  right: 0;
  /* näher am Balken, weiter weg von der Überschrift */
  top: -0.35rem;
  height: 0.6rem;
  pointer-events: none;
}

.dual-bar-ticks .tick {
  position: absolute;
  top: 0;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #9ca3af; /* mittleres Grau */
}

.dual-bar-ticks .tick-0   { left: 0%;   transform: translateX(0); }
.dual-bar-ticks .tick-25  { left: 25%;  transform: translateX(-50%); }
.dual-bar-ticks .tick-50  { left: 50%;  transform: translateX(-50%); }
.dual-bar-ticks .tick-75  { left: 75%;  transform: translateX(-50%); }
.dual-bar-ticks .tick-100 { left: 100%; transform: translateX(-100%); }


.dual-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  border-right: 1px solid #ffffff; /* 1px Trennlinie zwischen Farben */
}

.dual-bar-income {
  background: #16a34a; /* Nettobudget (grün) */
}

.dual-bar-tithe {
  background: #a06500; /* Zehnter (braun) */
}

.dual-bar-mandatory {
  background: #a855f7; /* Pflichtabzüge (lila) */
}

.dual-bar-expense {
  background: #dc2626; /* Ausgaben (rot) */
}

.dual-bar-saving {
  background: #f97316; /* Sparen (orange) */
}

.dual-bar-donation {
  background: #21888f; /* Spenden (tuerkis) */
}

.dual-bar-leftmost {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.dual-bar-rightmost {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
  border-right: none;
}

@keyframes dualBarWarnBlink {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(0.5); /* 50% dunkler */
  }
  100% {
    filter: brightness(1);
  }
}

.dual-bar-wrapper.dual-bar-negative .dual-bar {
  animation: dualBarWarnBlink 1.6s ease-in-out infinite;
}

/* Mittelmarkierung */
.dual-bar-center {
  position: absolute;
  top: -0.2rem;
  bottom: -0.2rem;
  left: 50%;
  width: 0;
  background: transparent; /* Linie weg, Pfeil bleibt */
  transform: translateX(-50%);
  pointer-events: none;
}

.dual-bar-center::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #9ca3af;
}

/* Kategorie-Auswertung */
.category-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.category-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.9rem 0;
}

.cat-row {
  font-size: 0.9rem;
}

.cat-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.cat-name {
  font-weight: 500;
}

.cat-value {
  font-size: 0.9rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.cat-saldo {
  font-variant-numeric: tabular-nums;
}

.cat-details {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  margin-top: 0.1rem;
  font-size: 0.8rem;
}

/* Balken für Kategorien */

.cat-bar-wrap {
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  height: calc(0.6rem - 2px);
  margin-bottom: 0.25rem;
  position: relative;
}

.cat-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  transition: width 0.25s ease-out;
}

.cat-bar-income {
  background: #4AA3E3; /* Einnahmen (blau) */
}

.cat-bar-mandatory {
  background: #a855f7; /* Pflichtabzüge (lila) */
}

.cat-bar-expense {
  background: #dc2626; /* Ausgaben (rot) */
}

.cat-bar-saving {
  background: #f97316; /* Sparen (orange) */
}

.cat-bar-donation {
  background: #21888f; /* Spenden (tuerkis) */
}

.cat-bar-empty {
  display: none;
}

/* Tabellen */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 3px; /* 3px Platz zwischen Zeilen */
}

.table th,
.table td {
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
}

.table thead tr {
  border-bottom: 1px solid var(--tips-accent);
}

@media (min-width: 641px) {
  .table thead th {
    font-weight: 700;
  }
}

.table tbody tr {
  background: #f3f4f6;
}

.table tbody tr.dragging {
  background: var(--drag-color, rgba(249, 115, 22, 0.5)); /* aktiver Eintrag beim Verschieben */
  color: #111827;
  opacity: 1;
  box-shadow: none;
  transform: none;
  z-index: 2;
}

/* Beim Verschieben sollen auch die Zellen & Eingabefelder sichtbar „orange“ sein,
   sonst sieht man bei Desktop/Touch oft nur die Inputs (weiß) und „kein Orange“. */
.table tbody tr.dragging td {
  background: var(--drag-color, rgba(249, 115, 22, 0.5));
}

.table tbody tr.dragging td input,
.table tbody tr.dragging td select,
.table tbody tr.dragging td button {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(255, 255, 255, 0.85);
  color: #111827;
}

.table tbody tr.dragging td input::placeholder {
  color: rgba(17, 24, 39, 0.6);
}

.table tbody tr.dragging .drag-handle {
  color: #111827;
}

/* Desktop Drag&Drop: im Table nur ein cleanes Marker-„Feld“ anzeigen (ohne Inhalt & ohne Schatten) */
.drag-marker td {
  background: var(--drag-color, rgba(249, 115, 22, 0.5));
}

.drag-marker td * {
  visibility: hidden;
}

.drag-marker td:first-child {
  border-top-left-radius: 0.75rem;
  border-bottom-left-radius: 0.75rem;
}

.drag-marker td:last-child {
  border-top-right-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

.table tbody tr td input,
.table tbody tr td select {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  padding: 0.35rem 0.45rem;
}

.table tbody tr td input:focus,
.table tbody tr td select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.icon-col {
  width: 3.7rem;
  text-align: center;
  padding-right: 0.1rem !important;
}

.drag-col {
  width: 1.55rem;
  text-align: left;
  padding-left: 0 !important;
  padding-right: 0.45rem !important;
}

.row-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  width: 100%;
}

.drag-handle {
  cursor: grab;
  user-select: none;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 1.45rem;
  height: 2rem;
}

.drag-handle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.drag-handle svg * {
  fill: currentColor;
  stroke: none;
}

/* Wenn ein Element explizit fill="none" hat, nicht füllen */
.drag-handle svg [fill="none"] {
  fill: none;
}

/* Wenn ein Element einen Stroke definiert (Outline-Icons), Stroke einfärben und standardmäßig nicht füllen */
.drag-handle svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
}
@media (min-width: 768px) {
  /*
    Desktop-Layout: prozentualer Seitenaufbau, aber mit STABILEN Minimalbreiten.

    Spaltenbreiten (wie gewünscht):
    - Name: flexibel (Restbreite)
	    - Euro: 175px
	    - Rhythmus: 150px
	    - Zeitraum: 2×120px + "bis" + Gap
	    - Kategorie: dynamisch (mit Mindestbreite)
    + 2 Icon-Spalten à 2rem
  */
  .table {
    table-layout: fixed;
  }

  .table thead th {
    white-space: nowrap;
  }

  /* Keine Clipping-Probleme bei Selects (z.B. Quartal/HJ "bis") */
  .table tbody td {
    overflow: visible;
  }

  /* Fixe Spalten */
  .table thead th:nth-child(2),
  .table tbody td:nth-child(2) {
    width: 90px;
  }

  .table thead th:nth-child(3),
  .table tbody td:nth-child(3) {
    width: 140px;
  }

  .table thead th:nth-child(4),
  .table tbody td:nth-child(4) {
    /* 2×120px + Label + Gaps */
    width: 340px;
  }

  .table thead th:nth-child(5),
  .table tbody td:nth-child(5) {
    /* Dynamisch, aber nicht zu klein */
    width: clamp(200px, 20vw, 300px);
  }

  .table thead th:nth-child(1),
  .table tbody td:nth-child(1) {
    /* Restbreite (Name flexibel) */
    width: auto;
  }
}

/* Zeitraum-Controls: kompakt, aber nicht "zu eng" (Q/HJ bleibt bedienbar) */
.due-controls{
  display:flex;
  align-items:center;
  gap:0.4rem;
}

.due-range{
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  flex: 1 1 auto;
}

.due-controls select.due-small,
.due-controls select.due-mid{
  width: 100%;
  min-width: 140px;
  flex: 1 1 0;
}

/* Zeitraum-Controls: niemals Zeilenbreite "springend" machen */
.due-controls{justify-content:flex-start;}
.due-controls select{max-width:100%;}

.due-controls .due-label{
  white-space:nowrap;
  opacity:0.85;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: var(--app-modal-overlay-bg);
  backdrop-filter: blur(var(--app-modal-overlay-blur));
  -webkit-backdrop-filter: blur(var(--app-modal-overlay-blur));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

#confirm-modal,
#confirm-row-modal {
  z-index: 70;
}

.modal-content {
  max-width: 360px;
}

.lang-edit-modal .modal-content,
.lang-edit-modal-content {
  max-width: 1280px !important;
  width: min(1280px, 96vw) !important;
}

@media (max-width: 768px) {
  .modal,
  .modal-details,
  .modal-profile,
  .modal-tips {
    padding: 15px;
    box-sizing: border-box;
  }

  .modal-content,
  .modal-details .details-modal-content,
  .modal-profile .profile-modal-content,
  .tips-modal-content {
    width: calc(100% - 30px);
    max-width: calc(100% - 30px);
    margin: 0 auto;
    box-sizing: border-box;
  }
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-header h2 {
  margin: 0;
}

.card-collapsible .section-header {
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
}

.card-collapsible .section-body {
  margin-top: 0.6rem;
}

.card-collapsible.is-collapsed .section-body {
  display: none;
}


.collapse-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  flex: 1 1 auto;
}

.collapse-toggle h2 {
  margin: 0;
}

.collapse-chevron {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  transition: transform 0.2s ease;
}

.card-collapsible:not(.is-collapsed) .collapse-chevron {
  transform: rotate(90deg);
}

/* Überschriften der farbigen Erfassungs-Boxen in Button-Farbe */
.card-income .section-header h2 { color: #4AA3E3; }
.card-expense .section-header h2 { color: #dc2626; }
.card-mandatory .section-header h2 { color: #a855f7; }
.card-saving .section-header h2 { color: #f97316; }
.card-donation .section-header h2 { color: #21888f; }
.card-tithe .section-header h2 { color: #a06500; }

.card-income .section-header { background: rgba(74, 163, 227, 0.05); }
.card-expense .section-header { background: rgba(220, 38, 38, 0.05); }
.card-mandatory .section-header { background: rgba(168, 85, 247, 0.05); }
.card-saving .section-header { background: rgba(249, 115, 22, 0.05); }
.card-donation .section-header { background: rgba(33, 136, 143, 0.05); }
.card-tithe .section-header { background: rgba(160, 101, 0, 0.05); }

.card-income { --drag-color: rgba(74, 163, 227, 0.5); }
.card-expense { --drag-color: rgba(220, 38, 38, 0.5); }
.card-mandatory { --drag-color: rgba(168, 85, 247, 0.5); }
.card-saving { --drag-color: rgba(249, 115, 22, 0.5); }
.card-donation { --drag-color: rgba(33, 136, 143, 0.5); }
.card-tithe { --drag-color: rgba(160, 101, 0, 0.5); }

.card h2 {
  color: #4AA3E3;
  font-weight: 500;
  font-size: 1.5rem;
}

.card .auth-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--tips-accent);
}

.tip-button {
  border: none;
  background: var(--tip-color, #f97316);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
}

.tip-button:hover {
  filter: brightness(0.96);
}

.tip-button:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

.tip-button {
  border: none;
  background: var(--tip-color, #f97316);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
}

.tip-button svg {
  width: 22px;
  height: 22px;
  display: block;
}

.tip-button svg * {
  fill: currentColor !important;
  stroke: none !important;
}

/* Wenn ein Element explizit fill="none" hat, nicht füllen */
.tip-button svg [fill="none"] {
  fill: none !important;
}

/* Wenn ein Element einen Stroke definiert (Outline-Icons), Stroke einfärben und standardmäßig nicht füllen */
.tip-button svg [stroke]:not([stroke="none"]) {
  stroke: currentColor !important;
  fill: none !important;
  vector-effect: non-scaling-stroke !important;
}

.tip-button.tip-income { --tip-color: #4AA3E3; }
.tip-button.tip-expense { --tip-color: #dc2626; }
.tip-button.tip-mandatory { --tip-color: #a855f7; }
.tip-button.tip-saving { --tip-color: #f97316; }
.tip-button.tip-donation { --tip-color: #21888f; }
.tip-button.tip-tithe { --tip-color: #a06500; }
.tip-button.tip-admin { --tip-color: #4AA3E3; }
.tip-button.tip-income:focus-visible { outline-color: #4AA3E3; }
.tip-button.tip-expense:focus-visible { outline-color: #dc2626; }
.tip-button.tip-mandatory:focus-visible { outline-color: #a855f7; }
.tip-button.tip-saving:focus-visible { outline-color: #f97316; }
.tip-button.tip-donation:focus-visible { outline-color: #21888f; }
.tip-button.tip-tithe:focus-visible { outline-color: #a06500; }
.tip-button.tip-admin:focus-visible { outline-color: #4AA3E3; }

/* Fallback: Farbe aus der Kartenfarbe ableiten (falls Klassen fehlen) */
.card-income .tip-button { --tip-color: #4AA3E3; }
.card-expense .tip-button { --tip-color: #dc2626; }
.card-mandatory .tip-button { --tip-color: #a855f7; }
.card-saving .tip-button { --tip-color: #f97316; }
.card-donation .tip-button { --tip-color: #21888f; }
.card-tithe .tip-button { --tip-color: #a06500; }


/* Einfarbige Row-Icons (Papierkorb + Drag) je Bereich */
.card-income .icon-button,
.card-income .drag-handle { color: #4AA3E3; }

.card-expense .icon-button,
.card-expense .drag-handle { color: #dc2626; }

.card-mandatory .icon-button,
.card-mandatory .drag-handle { color: #a855f7; }

.card-saving .icon-button,
.card-saving .drag-handle { color: #f97316; }
.card-donation .icon-button,
.card-donation .drag-handle { color: #21888f; }
.card-tithe .icon-button,
.card-tithe .drag-handle { color: #a06500; }


.modal-tips {
  --tips-accent: #72BF44;
  background: var(--app-modal-overlay-bg);
}

.modal-tips.tips-income { --tips-accent: #4AA3E3; }
.modal-tips.tips-expense { --tips-accent: #dc2626; }
.modal-tips.tips-mandatory { --tips-accent: #a855f7; }
.modal-tips.tips-saving { --tips-accent: #f97316; }
.modal-tips.tips-donation { --tips-accent: #21888f; }
.modal-tips.tips-tithe { --tips-accent: #a06500; }
.modal-tips.tips-admin { --tips-accent: #4AA3E3; }

/* Tipps-Modal: Headings immer in der Lampen-Farbe */
.modal-tips .tips-modal-body h1,
.modal-tips .tips-modal-body h2,
.modal-tips .tips-modal-body h3 {
  color: var(--tips-accent);
}


.tips-modal-content {
  max-width: 640px;
  max-height: 80vh;
  position: relative;
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--tips-accent);
}

.tips-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--tips-accent);
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.tips-modal-body {
  overflow: auto;
}

.modal-close-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #111827;
}

.tips-modal-body {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* Monats-Details Modal */
.modal-details .details-modal-content {
  max-width: 820px; /* kompakter, weniger breit */
  max-height: 82vh;
  width: min(820px, calc(100vw - 2rem));
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 4px solid var(--details-accent);
}

.modal-details {
  --details-accent: #16a34a;
  background: var(--app-modal-overlay-bg);
  overflow: auto;
  padding: 1rem;
}

/* Profil-Modal (wie Hilfelampe, ohne PDF) */
.modal-profile {
  --profile-accent: #16a34a;
  background: var(--app-modal-overlay-bg);
  overflow: auto;
  padding: 1rem;
}

.modal-profile .profile-modal-content {
  max-width: 780px;
  max-height: 82vh;
  width: min(780px, calc(100vw - 2rem));
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 4px solid var(--profile-accent);
  padding: calc(1.25rem - 10px) calc(1.5rem - 10px);
}

.profile-modal-body {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 10px;
}

.profile-modal-body .message {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
  align-self: stretch;
  flex: 0 0 auto;
}

.profile-modal-body .message.hidden,
.profile-modal-body .message[hidden] {
  display: none !important;
}

.profile-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--profile-accent);
}

.profile-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.profile-modal-actions .btn {
  white-space: nowrap;
}

.details-modal-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.details-modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--details-accent); /* dünne Linie über der Überschrift */
}

.details-modal-header .modal-close-btn {
  position: static;
  top: auto;
  right: auto;
  font-size: 1.7rem;
  color: var(--details-accent);
}

.details-modal-header-row .modal-icon-btn,
.details-modal-header-row .modal-close-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}


.details-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--details-accent); /* Grün */
  text-align: center;
}


.details-toggle {
  display: inline-flex;
  /* In einem Flex-Container würden Kinder standardmäßig gestreckt werden.
     Wir wollen hier nur so breit wie nötig sein. */
  align-self: center;
  width: fit-content;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.08);
  padding: 4px;
  margin: 0.25rem 0 0.25rem 0;
}

.details-toggle-btn {
  border: none;
  background: transparent;
  padding: 6px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: #6b7280;
  border-radius: 999px;
}

.details-toggle-btn.active {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.details-toggle-hint {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #6b7280;
  text-align: center;
  padding: 0 0.9rem;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
  max-width: 100%;
}


.details-modal-body {
  margin-top: 0.9rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.details-month-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}


.details-month-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem; /* kompakter (ca. 50% Höhe) */
  background: #f3f4f6;
  border-radius: 0.75re

.details-month-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.details-month-sub {
  font-size: 0.78rem;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem; /* kompakter */
  line-height: 1.25;
  white-space: normal;
}

.details-month-sep {
  color: #9ca3af;
  opacity: 0.9;
}

.details-month-sub-income,
.details-month-sub-expense {
  white-space: normal;
}

m;
}


.details-month-name {
  font-weight: 400;
  color: #111827;
  line-height: 1.2;
}


.details-month-value {
  font-weight: 400;
  color: #111827;
  line-height: 1.2;
  opacity: 0.95;
  text-align: right;
  white-space: nowrap;
}

.details-month-value.is-pos { color: var(--details-accent); }
.details-month-value.is-neg { color: #dc2626; }
.details-month-value.is-zero { color: #111827; }

@media (max-width: 640px) {
  /* Mobile: Toggle-Pille sauber sichtbar + Hint darf umbrechen */
  .modal-details { padding: 0.75rem; }
  .modal-details .details-modal-content { width: 100%; margin: 0.75rem 0; }
  .details-modal-title { font-size: 1.15rem; }
  .details-toggle {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 2px;
    gap: 2px;
    overflow: visible; /* verhindert Abschneiden auf Mobile */
  }
  .details-toggle-btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
    line-height: 1.2;
    flex: 1 1 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    white-space: nowrap;
  }
  .details-toggle-hint {
    font-size: 0.75rem;
    padding: 0 0.8rem;
  }
}


/* Monatsdetails: bewusst EINSPALTIG (Monate untereinander) */

/* Details-Header: PDF-Icon wie bei den Lampen-Hinweisen */
.details-modal-header .modal-icon-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--details-accent);
}
.details-modal-header .modal-icon-btn svg {
  width: 22px;
  height: 22px;
}
.details-modal-header .modal-icon-btn svg * {
  fill: currentColor;
  stroke: none;
}

/* Wenn ein Element explizit fill="none" hat, nicht füllen */
.details-modal-header .modal-icon-btn svg [fill="none"] {
  fill: none;
}

/* Wenn ein Element einen Stroke definiert (Outline-Icons), Stroke einfärben und standardmäßig nicht füllen */
.details-modal-header .modal-icon-btn svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
}

/* Responsive */

@media (min-width: 768px) {
  .table {
    border-spacing: 0 6px; /* etwas mehr Abstand zwischen Zeilen auf Desktop */
  }

  .table tbody tr {
    background: transparent;
    border-radius: 0.75rem;
  }

  .table tbody tr td {
    background: #f3f4f6;
  }

  .table tbody tr td:first-child {
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
  }

  .table tbody tr td:last-child {
    border-top-right-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
  }
}

@media (max-width: 640px) {
  .row {
    flex-direction: column;
  }

  .top-bar-inner {
    flex-direction: row;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .top-logo {
    height: 52px;
  }

  .logo-text {
    font-size: 1.3rem;
    line-height: 1.1;
  }

  .summary-grid {
    flex-direction: column;
  }

  .tips-modal-content {
    width: 100%;
    margin: 1.5rem 15px;
  }
}

.summary-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin-top: 0.8rem;
  margin-bottom: 0.2rem;
}

.nobr { white-space: nowrap; }

.app-footer {
  text-align: center;
  color: #333;
  margin-top: 2rem;
  padding: 1.5rem 0;
  font-size: 0.85rem;
}

.admin-footer {
  margin-top: 1.5rem;
  padding: 1.2rem 0 2rem;
  font-size: 0.8rem;
  text-align: center;
  color: #333;
}

.footer-inner a,
.auth-footer a,
.app-footer a,
.admin-footer a {
  color: #16a34a;
  text-decoration: none;
}

.footer-inner a:hover,
.auth-footer a:hover,
.app-footer a:hover,
.admin-footer a:hover {
  text-decoration: none;
}

.required-star {
  color: #f97316;
  margin-left: 0.15rem;
  font-size: 0.8em;
  vertical-align: top;
}

.field-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}
.auth-hint {
  margin-top: 0.4rem;
  font-size: 0.7rem;
  color: #6b7280;
  max-width: 480px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.reset-modal-content {
  max-width: 520px;
}

.reset-modal-hint {
  margin: 0.2rem 0 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.reset-modal-actions {
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
}

.summary-row-small {
  font-size: 0.85rem;
}

.summary-row-small span:first-child {
  padding-left: 0.75rem;
}

.summary-year-delete-row {
  position: absolute;
  right: 1.5rem;
  bottom: 1rem;
}

.summary-year-delete-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  color: #16a34a;
  text-decoration: none;
  cursor: pointer;
}

.summary-year-delete-link:hover {
  text-decoration: none;
}

.deficit-prayer-box {
  /* etwas mehr Abstand zur Tabelle */
  margin-top: calc(0.9rem + 10px);
  padding: 0.85rem 0.95rem;
  border-radius: 0.65rem;
  background: rgba(249, 115, 22, 0.10); /* wie Zehnter */
  border: none;
}

.hint-rule-boxes {
  margin-top: calc(0.9rem + 10px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hint-rule-box {
  padding: 0.85rem 0.95rem;
  border-radius: 0.65rem;
  background: var(--hint-bg, rgba(22, 163, 74, 0.08));
  border-top: 2px solid var(--hint-accent, #16a34a);
}

.hint-rule-box .hint-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.hint-rule-box .hint-rule-title {
  color: var(--hint-accent, #16a34a);
  font-weight: 700;
  margin: 0;
}

.hint-rule-box .hint-rule-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--hint-accent, #16a34a);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  line-height: 1;
  flex: 0 0 auto;
}

.hint-rule-box .hint-rule-text {
  color: #111827;
  font-size: 0.85rem;
  line-height: 1.35;
}

.hint-rule-box .hint-rule-text p {
  margin: 0 0 0.55rem;
}

.hint-rule-box .hint-rule-text p:last-child {
  margin-bottom: 0;
}

.hint-rule-box.hint-color-tithe {
  --hint-accent: #a06500;
  --hint-bg: rgba(160, 101, 0, 0.10);
}

.hint-rule-box.hint-color-donation {
  --hint-accent: #21888f;
  --hint-bg: rgba(33, 136, 143, 0.10);
}

.hint-rule-box.hint-color-saving {
  --hint-accent: #f97316;
  --hint-bg: rgba(249, 115, 22, 0.10);
}

.hint-rule-box.hint-color-budget {
  --hint-accent: #16a34a;
  --hint-bg: rgba(22, 163, 74, 0.10);
}

.hint-rule-box.hint-color-red {
  --hint-accent: #dc2626;
  --hint-bg: rgba(220, 38, 38, 0.10);
}

.hint-rule-box.hint-color-gray {
  --hint-accent: #6b7280;
  --hint-bg: rgba(107, 114, 128, 0.10);
}

.hint-rule-box.hint-color-black {
  --hint-accent: #111827;
  --hint-bg: rgba(17, 24, 39, 0.10);
}

.hint-rule-box.hint-color-darkyellow {
  --hint-accent: #b46e00;
  --hint-bg: rgba(180, 110, 0, 0.10);
}

.hint-rule-box.hint-color-pink {
  --hint-accent: #ec4899;
  --hint-bg: rgba(236, 72, 153, 0.10);
}

.hint-rule-box.hint-color-rose {
  --hint-accent: #f43f5e;
  --hint-bg: rgba(244, 63, 94, 0.10);
}

.hint-rule-box.hint-color-cobalt {
  --hint-accent: #2563eb;
  --hint-bg: rgba(37, 99, 235, 0.10);
}

.deficit-prayer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.deficit-prayer-title {
  color: #dc2626;
  font-weight: 700;
  margin: 0;
}

.deficit-prayer-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  line-height: 1;
  flex: 0 0 auto;
}

.deficit-prayer-text {
  color: #111827;
  font-size: 0.85rem;
  line-height: 1.35;
}

.deficit-prayer-text p {
  margin: 0 0 0.55rem;
}

.deficit-prayer-text p:last-child {
  margin-bottom: 0;
}

.deficit-prayer-text-gap {
  margin-top: 0.55rem;
}

.deficit-prayer-link {
  color: #dc2626;
  text-decoration: underline;
  font-weight: 600;
}

.deficit-prayer-link:hover {
  opacity: 0.85;
}

.user-count-hint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
}

.top-left {
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--tips-accent);
  align-items: flex-start;
}


.logo-claim {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: #008FD5;
}

@media (max-width: 900px) {
  #auth-view.auth-split .logo-claim {
    font-size: clamp(0.9rem, 3.6vw, 1.1rem);
  }
}

.logo-version {
  margin-top: 0.1rem;
  font-size: 0.7rem;
  color: #6b7280;
}

@media (max-width: 640px) {
  .table thead {
    display: none;
  }

  .table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.6rem;
    border-radius: 0.9rem;
    background: #f3f4f6;
  }

  .table tbody tr td {
    padding: 0.15rem 0;
  }

  .table tbody tr td:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .table tbody tr td:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .table tbody tr td:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 3;
  }

  .table tbody tr td:nth-child(4) {
    grid-column: 1 / 2;
    grid-row: 4;
  }

  .table tbody tr td:nth-child(5) {
    grid-column: 1 / 2;
    grid-row: 5;
  }

  .table tbody tr td.drag-col {
    grid-column: 2 / 3;
    grid-row: 1;
    text-align: right;
  }

  .table tbody tr td.icon-col {
    grid-column: 2 / 3;
    grid-row: 5;
    text-align: right;
  }
  .table tbody tr td.icon-col,
  .table tbody tr td.drag-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 0;
    padding-right: 0.2rem;
  }

}

.label-net,
.value-net {
  font-weight: 700;
}

.tips-modal-header .modal-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--tips-accent);
}

.tips-modal-header .modal-icon-btn:hover {
  color: var(--tips-accent);
}

.tips-modal-header .modal-icon-download {
  width: 22px;
  height: 22px;
}

.tips-modal-header .modal-icon-download * {
  fill: currentColor;
  stroke: currentColor;
}

#app-message.message {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

#app-message.message.success {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border: 1px solid #16a34a;
}

.profile-edit-panel .message {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

.profile-edit-panel .message.success {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border: 1px solid #16a34a;
}

.profile-edit-panel .message.error {
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
  border: 1px solid #b91c1c;
}

#app-message.message.error {
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid #b91c1c;
}

.footer-link-danger {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #b91c1c;
  text-decoration: none;
}

.footer-link-danger:hover {
  text-decoration: underline;
}

.tips-modal-header .modal-close-btn {
  position: static;
  top: auto;
  right: auto;
  font-size: 1.7rem;
  color: var(--tips-accent);
}

.modal-icon-download {
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
}

.tips-modal-body h1 {
  color: var(--tips-accent);
}

.auth-footer {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  text-align: center;
  color: #333;
}

.auth-footer .footer-inner {
  display: inline-block;
}

.auth-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--tips-accent);
}

.auth-login .auth-section-title,
.auth-register-toggle span:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tips-accent);
}
.auth-section {
  margin-bottom: 0.75rem;
}

.auth-register {
  margin-top: 1.25rem;
}

.auth-register-toggle {
  width: 100%;
  padding: 0.4rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-register-toggle:hover {
  background: #f9fafb;
}

.auth-toggle-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.auth-register-panel {
  margin-top: 1.25rem;
}

.auth-register-panel.is-collapsed {
  display: none;
}

.checkbox-field {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.checkbox-field label {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.checkbox-field input[type="checkbox"] {
  margin-top: 0.15rem;
}

.auth-semiyas-notice .auth-notice-label {
  font-weight: 700;
}

.auth-card {
  padding: 1.75rem 1.75rem 1.5rem;
}

.auth-lang-switch-wrap {
  margin-top: 0.3rem;
  display: flex;
  justify-content: center;
}

.auth-lang-switch-form {
  margin: 0;
}

.auth-lang-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
}

.auth-lang-chip {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  line-height: 0;
  cursor: pointer;
  color: inherit;
}

.auth-lang-chip-flag {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  padding: 0;
  overflow: hidden;
}

.auth-lang-chip-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.auth-lang-chip.is-active .auth-lang-chip-flag {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.auth-lang-chip:focus-visible .auth-lang-chip-flag {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.auth-section {
  margin-bottom: 1.25rem;
}

.auth-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.auth-login .row .field,
.auth-register .row .field {
  flex: 1;
}

.auth-register {
  margin-top: 1.25rem;
}

.auth-register-toggle {
  width: 100%;
  padding: 0.4rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-register-toggle:hover {
  background: #f9fafb;
}

.auth-toggle-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.auth-register-panel {
  margin-top: 1.25rem;
}

.auth-register-panel.is-collapsed {
  display: none;
}

.checkbox-field {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.checkbox-field label {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.checkbox-field input[type="checkbox"] {
  margin-top: 0.15rem;
}

.auth-register-toggle span:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tips-accent);
}

.value-expense {
  color: #dc2626;
}

.value-mandatory {
  color: #a855f7;
}

.value-tithe {
  color: #a06500;
}

.value-saving {
  color: #f97316;
}

.value-donation {
  color: #21888f;
}

.value-net {
  color: #16a34a;
  font-weight: 700;
}

.summary-row-gap-top {
  margin-top: 0.4rem;
}

/* Highlight rows (rounded) */
.summary-row-tithe,
.summary-row-donation,
.summary-row-saving,
.summary-row-year-net,
.summary-row-month-net { position: relative; }

.summary-row-tithe::before,
.summary-row-donation::before,
.summary-row-saving::before,
.summary-row-year-net::before,
.summary-row-month-net::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0.5rem;
  pointer-events: none;
}

/* Tithe: no background highlight */
.summary-row-tithe::before { background: transparent; }

/* Tithe main: brown highlight */
.summary-row-tithe-main::before { background: rgba(160, 101, 0, 0.10); }

/* Saving: orange highlight */
.summary-row-saving::before { background: rgba(249, 115, 22, 0.10); }

/* Donation: teal highlight */
.summary-row-donation::before { background: rgba(33, 136, 143, 0.10); }

/* Net: green highlight by default */
.summary-row-year-net::before,
.summary-row-month-net::before { background: rgba(22, 163, 74, 0.10); }

/* Net: negative -> orange highlight + red text */
.summary-row-year-net.is-negative::before,
.summary-row-month-net.is-negative::before { background: rgba(249, 115, 22, 0.10); }

.summary-row-year-net.is-negative .label-net,
.summary-row-year-net.is-negative .value-net,
.summary-row-month-net.is-negative .label-net,
.summary-row-month-net.is-negative .value-net { color: #dc2626; }
.summary-row-tithe > *,
.summary-row-donation > *,
.summary-row-saving > *,
.summary-row-year-net > *,
.summary-row-month-net > * {
  position: relative;
  z-index: 1;
}

/* Zehnter: Label + Zahl fett wie Nettobudget */
.summary-row-tithe span {
  font-weight: 700;
}

.summary-row-donation span {
  font-weight: 700;
}

.summary-row-saving span {
  font-weight: 700;
}

.summary-row-tithe-hint span {
  font-weight: 400;
  color: #a06500;
}

.summary-row-year-net span {
  font-weight: 700;
}

.summary-row-year-net {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-row-month-net {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 20px; /* Abstand zur Button-Zeile darunter */
}

.summary-row-month-net span {
  font-weight: 700;
}

.button-row-split {
  width: 100%;
}

.profile-delete-link {
  font-size: 0.8rem;
  color: rgba(17, 24, 39, 0.5);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-left: auto;
}

.profile-delete-link:hover {
  text-decoration: underline;
}


/* FIX27: Login-Willkommen Block wieder bündig + farbige Überschrift */
#auth-view .auth-welcome,
#auth-view .auth-verse {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

#auth-view .auth-welcome-title {
  color: #4AA3E3;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 0.55rem 0;
}

#auth-view .auth-welcome-lead {
  font-weight: 400;
}


/* Admin */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.admin-login-card {
  max-width: 420px;
  width: 100%;
}

.admin-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.admin-header-right .top-logo {
  height: 70px;
}

.admin-right-column .admin-card {
  position: relative;
}

.admin-right-column .admin-right-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
}

.admin-right-column .admin-card.is-collapsed-lite {
  padding-top: 14px;
  padding-bottom: 14px;
}

.admin-right-column .admin-right-card-head .admin-title {
  margin: 0;
}

.admin-right-column .admin-right-card-body {
  padding-top: 6px;
}

.admin-right-column .admin-right-card-toggle {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
  border-radius: 999px;
  flex: 0 0 22px;
}

.admin-right-column .admin-right-card-toggle:hover {
  background: rgba(17, 24, 39, 0.08);
}

.admin-right-column .admin-right-card-toggle:focus-visible {
  outline: 2px solid #4AA3E3;
  outline-offset: 2px;
}

.admin-right-column .admin-right-card-toggle-triangle {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid currentColor;
  transition: transform 0.16s ease;
}

.admin-right-column .admin-card.is-collapsed .admin-right-card-toggle-triangle {
  transform: rotate(-90deg);
}

.admin-right-column .admin-card.is-collapsed .admin-right-card-body {
  display: none;
}

.admin-dashboard-head-right .tip-button {
  --tip-color: #4AA3E3;
  color: #ffffff;
}

.admin-dashboard-head-right .tip-button svg,
.admin-dashboard-head-right .tip-button svg * {
  fill: #ffffff !important;
  stroke: none !important;
}

.admin-logout {
  font-size: 0.85rem;
  color: #4AA3E3;
  text-decoration: none;
}

.admin-logout:hover {
  text-decoration: underline;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Admin-Dashboard: Tabellen als Karten */
.admin-table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 10px !important;
  font-size: 13px;
  color: #1f2937;
}

.admin-table thead th {
  font-weight: 600;
  opacity: 0.75;
  padding: 6px 8px;
  font-size: 12px;
  text-align: left;
}

.admin-table tbody td {
  padding: 10px 8px;
  vertical-align: top;
  background: rgba(17, 24, 39, 0.03);
  border-top: 1px solid rgba(107, 114, 128, 0.35);
  border-bottom: 1px solid rgba(107, 114, 128, 0.35);
  background-clip: padding-box;
}

.admin-table tbody td:first-child {
  border-left: 1px solid rgba(107, 114, 128, 0.35);
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

.admin-table tbody td:last-child {
  border-right: 1px solid rgba(107, 114, 128, 0.35);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.admin-table tbody td:nth-child(2) {
  font-weight: 600;
}

.admin-col-avatar {
  width: 56px;
}

.admin-user-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  background: #4AA3E3;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
}

.admin-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-user-company {
  display: none;
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 2px;
}

.admin-user-phone {
  opacity: 0.75;
  font-size: 12px;
  margin-top: 2px;
}

.admin-user-time {
  opacity: 0.75;
  font-size: 12px;
  margin-top: 2px;
}

.admin-status-detail {
  opacity: 0.75;
  font-size: 12px;
  margin-top: 2px;
}

.admin-status-detail-delete {
  color: #b91c1c;
}

.admin-brand-inline-icon {
  display: none;
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-bottom: 4px;
  align-self: flex-end;
}

.admin-table .admin-brand-inline {
  display: none !important;
}

@media (max-width: 1100px) {
  .admin-table thead {
    display: none;
  }

  .admin-table tbody tr {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1.35fr) minmax(0, 0.9fr) 34px;
    grid-template-areas:
      "avatar name status brand"
      "avatar contact status brand"
      "avatar date date ."
      "avatar valid valid ."
      "avatar license license trash";
    gap: 6px 12px;
    padding: 12px 10px;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(107, 114, 128, 0.35);
    border-radius: 14px;
    margin-bottom: 10px;
  }

  .admin-table tbody td {
    background: transparent;
    border: none;
    padding: 0;
  }

  .admin-table tbody td:first-child,
  .admin-table tbody td:last-child {
    border: none !important;
    border-radius: 0 !important;
  }

  .admin-table tbody td:nth-child(1) { grid-area: avatar; }
  .admin-table tbody td:nth-child(2) { grid-area: name; font-weight: 600; }
  .admin-table tbody td:nth-child(3) { grid-area: contact; }
  .admin-table tbody td:nth-child(4) {
    grid-area: date;
    font-size: 12px;
    opacity: 0.85;
    display: block;
    justify-self: start;
    text-align: left;
  }
  .admin-table tbody td:nth-child(4)::before {
    content: attr(data-label) ":";
    display: inline;
    font-weight: 600;
    opacity: 0.75;
    white-space: nowrap;
    margin-right: 4px;
  }
  .admin-table tbody td:nth-child(4) .admin-user-time {
    display: inline;
    margin-top: 0;
    font-size: inherit;
    opacity: inherit;
  }
  .admin-table tbody td:nth-child(4) > div:first-child {
    display: inline;
  }
  .admin-table tbody td:nth-child(4) .admin-user-time::before {
    content: " \00b7 ";
  }
  .admin-table tbody td:nth-child(5) {
    grid-area: status;
    justify-self: start;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 2px;
  }
  .admin-table tbody td:nth-child(5) .admin-brand-inline-icon { display: none !important; }
  .admin-table tbody td:nth-child(6) {
    grid-area: brand;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    justify-self: end;
    text-align: right;
  }
  .admin-table tbody td:nth-child(7) {
    grid-area: license;
    font-size: 12px;
    opacity: 0.85;
  }
  .admin-table tbody td:nth-child(8) {
    grid-area: valid;
    font-size: 12px;
    opacity: 0.85;
  }
  .admin-table tbody td:nth-child(8)::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    opacity: 0.75;
    margin-right: 4px;
  }
  .admin-table tbody td:nth-child(9) {
    grid-area: trash;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    justify-self: end;
  }

  .admin-table tbody td:nth-child(3) a,
  .admin-table tbody td:nth-child(3) div {
    display: block;
  }

  .admin-user-company {
    display: none;
  }

  .admin-user-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 0.78rem;
  }

  .admin-brand-inline-icon { display: none !important; }

}

@media (max-width: 700px) {
  .admin-table tbody tr {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "avatar name status"
      "avatar contact status"
      "avatar date status"
      "avatar valid status"
      "avatar license trash";
    gap: 6px 10px;
    padding: 12px 10px;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(107, 114, 128, 0.35);
    border-radius: 14px;
    margin-bottom: 10px;
  }

  .admin-table tbody td {
    background: transparent;
    border: none;
    padding: 0;
  }

  .admin-table tbody td:nth-child(1) { grid-area: avatar; }
  .admin-table tbody td:nth-child(2) { grid-area: name; font-weight: 600; }
  .admin-table tbody td:nth-child(3) { grid-area: contact; font-size: 13px; }
  .admin-table tbody td:nth-child(4) {
    grid-area: date;
    display: block;
    font-size: 12px;
    opacity: 0.85;
    text-align: left;
  }
  .admin-table tbody td:nth-child(4)::before {
    content: attr(data-label) ":";
    display: inline;
    font-weight: 600;
    opacity: 0.75;
    margin-right: 6px;
  }
  .admin-table tbody td:nth-child(4) .admin-user-time {
    display: inline;
    margin-top: 0;
    font-size: inherit;
    opacity: inherit;
  }
  .admin-table tbody td:nth-child(4) > div:first-child {
    display: inline;
  }
  .admin-table tbody td:nth-child(4) .admin-user-time::before {
    content: " \00b7 ";
  }
  .admin-table tbody td:nth-child(5) {
    grid-area: status;
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
  }
  .admin-table tbody td:nth-child(6) { display: none; }
  .admin-table tbody td:nth-child(7) { grid-area: license; font-size: 12px; opacity: 0.85; }
  .admin-table tbody td:nth-child(8) { grid-area: valid; font-size: 12px; opacity: 0.85; }
  .admin-table tbody td:nth-child(9) {
    grid-area: trash;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    justify-self: end;
  }

  .admin-table tbody td:nth-child(3) a,
  .admin-table tbody td:nth-child(3) div {
    display: block;
  }

  .admin-user-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    font-size: 0.85rem;
  }

  .admin-table tbody td[data-label="Gültig bis"]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    opacity: 0.75;
    margin-right: 6px;
  }

  .admin-brand-inline-icon {
    display: block !important;
  }
  .admin-table tbody td:nth-child(5) .admin-brand-inline-icon {
    display: block !important;
  }
}

.admin-table .admin-col-trash {
  width: 42px;
  text-align: center;
}

.admin-row-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.admin-delete-user-btn {
  width: 20px;
  height: 20px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #4AA3E3;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.admin-export-user-btn {
  width: 20px;
  height: 20px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #4AA3E3;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.admin-delete-user-btn:hover {
  background: transparent;
}

.admin-export-user-btn:hover {
  background: transparent;
}

.admin-delete-user-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.admin-export-user-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.admin-table .pill {
  padding: 0 6px;
  line-height: 18px;
}

.admin-delete-user-btn svg * {
  fill: currentColor;
}

.admin-export-user-btn svg * {
  fill: currentColor;
  stroke: currentColor;
}

@media (max-width: 1100px) {
  .admin-row-actions {
    gap: 9px;
  }

  .admin-delete-user-btn,
  .admin-export-user-btn {
    width: 28px;
    height: 28px;
  }

  .admin-delete-user-btn svg,
  .admin-export-user-btn svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 700px) {
  .admin-delete-user-btn,
  .admin-export-user-btn {
    width: 26px;
    height: 26px;
  }

  .admin-delete-user-btn svg,
  .admin-export-user-btn svg {
    width: 22px;
    height: 22px;
  }

  .admin-brand-inline-icon {
    width: 28px;
    height: 28px;
  }
}

.admin-export-targets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}

.admin-export-target {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(107, 114, 128, 0.25);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.03);
}

.admin-export-target input[type="checkbox"] {
  margin-top: 2px;
}

.admin-export-mail {
  font-size: 12px;
  opacity: 0.75;
  word-break: break-word;
}

.admin-export-meta-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(107, 114, 128, 0.2);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.02);
}

.admin-export-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) 1fr;
  gap: 10px;
  align-items: start;
  margin: 0 0 8px 0;
}

.admin-export-meta-row:last-of-type {
  margin-bottom: 6px;
}

.admin-export-meta-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}

.admin-export-meta-value {
  font-size: 14px;
  color: #111827;
  word-break: break-word;
}

.admin-export-password-code {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px 8px;
  word-break: break-all;
}

.admin-export-meta-hint {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #6b7280;
}

@media (max-width: 700px) {
  .admin-export-meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 980px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
}

.admin-inline {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.admin-inline > * {
  flex: 1 1 220px;
}

.admin-pagination {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-pagination a {
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  background: rgba(17, 24, 39, 0.06);
}

.admin-pagination a.is-current {
  background: rgba(74, 163, 227, 0.18);
}

/* Zeitraum-Controls in Tabellen (von/bis + Zahlmonat) */
.due-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Von/Bis-Gruppe soll immer nebeneinander bleiben */
.due-controls .due-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Dropdowns in der Zeitraum-Spalte: stabile Breiten, ohne Layout-Springen */
.due-controls select {
  width: auto;
  min-width: 0;
  max-width: 100%;
}

/* Monatlich: 1–12 / 1–12 */
.due-controls select.due-from,
.due-controls select.due-to {
  width: 80px;
  min-width: 80px;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

/* Jährlich/Einmalig: Monatsauswahl */
.due-controls select.due-single {
  width: 160px;
  min-width: 160px;
}

.due-controls .due-sep {
  font-size: 0.85rem;
  color: #6b7280;
  padding: 0 2px;
}

/* Falls künftig wieder ein extra „Zahlmonat“-Feld genutzt wird: nie über die Spalte hinausziehen */
.due-controls select.due-offset {
  width: 160px;
  min-width: 140px;
  max-width: 160px;
}
@media (max-width: 640px) {
  /* Auf Mobile darf es umbrechen, damit nichts überläuft */
  .due-controls {
    flex-wrap: wrap;
  }
  .due-controls select.due-offset {
    min-width: 0;
    width: 100% !important;
  }
}


.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  position: relative;
  top: 1px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: br-spin 0.8s linear infinite;
}

@keyframes br-spin {
  to { transform: rotate(360deg); }
}

/* Kompakte Erfassungszeilen + Bearbeiten per Popup */
.table {
  border-spacing: 0 2px;
}

.table th,
.table td {
  padding: 0.32rem 0.45rem;
}

.icon-col {
  width: 5.4rem;
}

.drag-col {
  width: 1.8rem;
}

.row-action-group {
  gap: 0.1rem;
}

.row-readonly-input,
.row-readonly-select {
  width: 100%;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.14rem 0.05rem !important;
  color: #111827 !important;
  pointer-events: none;
  cursor: default;
}

.row-readonly-input:focus,
.row-readonly-select:focus {
  outline: none;
}

.row-readonly-select,
.row-readonly-select:disabled {
  -webkit-appearance: none;
  appearance: none;
  opacity: 1;
  -webkit-text-fill-color: #111827;
}

.table tbody tr.draggable-row td.cell-amount {
  text-align: right;
  white-space: nowrap;
}

.row-readonly-amount-inline {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  gap: 0.22rem;
  max-width: 100%;
}

.row-readonly-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.table tbody tr.draggable-row td.cell-amount .row-readonly-amount {
  width: auto !important;
  min-width: 0;
  flex: 1 1 12ch;
  white-space: nowrap;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1.2;
}

.row-readonly-currency {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 400;
  color: #111827;
  line-height: 1;
}

/* Row-Editor Modal */
.row-editor-modal-content {
  width: min(760px, 96vw);
}

.row-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.row-editor-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
}

.row-editor-header .modal-close-btn {
  position: static;
  top: auto;
  right: auto;
}

.row-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 0.65rem 0.85rem;
}

.row-editor-grid .field:nth-child(3),
.row-editor-grid .field:nth-child(4),
.row-editor-category-field {
  grid-column: 1 / -1;
}

#row-editor-rhythm,
#row-editor-category select,
#row-editor-due select,
#row-editor-name,
#row-editor-amount {
  width: 100%;
}

.row-editor-actions {
  margin-top: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .table thead th:nth-child(2),
  .table tbody td:nth-child(2) {
    width: 120px;
  }

  .table thead th:nth-child(3),
  .table tbody td:nth-child(3) {
    width: 150px;
  }

  .table thead th:nth-child(4),
  .table tbody td:nth-child(4) {
    width: 300px;
  }

  .table thead th:nth-child(5),
  .table tbody td:nth-child(5) {
    width: clamp(180px, 18vw, 280px);
  }
}

@media (max-width: 640px) {
  .row-editor-grid {
    grid-template-columns: 1fr;
  }

  .row-editor-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .row-editor-actions .btn {
    width: 100%;
  }
}

/* Row-Editor + Tabellen-Feintuning (Popup pro Bereich + kompakte Zeilen) */
#row-editor-modal {
  --row-editor-accent: #16a34a;
  --row-editor-accent-soft: rgba(22, 163, 74, 0.10);
}

#row-editor-modal.row-editor-income {
  --row-editor-accent: #4AA3E3;
  --row-editor-accent-soft: rgba(74, 163, 227, 0.10);
}

#row-editor-modal.row-editor-expense {
  --row-editor-accent: #dc2626;
  --row-editor-accent-soft: rgba(220, 38, 38, 0.10);
}

#row-editor-modal.row-editor-mandatory {
  --row-editor-accent: #a855f7;
  --row-editor-accent-soft: rgba(168, 85, 247, 0.10);
}

#row-editor-modal.row-editor-saving {
  --row-editor-accent: #f97316;
  --row-editor-accent-soft: rgba(249, 115, 22, 0.10);
}

#row-editor-modal.row-editor-donation {
  --row-editor-accent: #21888f;
  --row-editor-accent-soft: rgba(33, 136, 143, 0.10);
}

#row-editor-modal.row-editor-tithe {
  --row-editor-accent: #a06500;
  --row-editor-accent-soft: rgba(160, 101, 0, 0.10);
}

#row-editor-modal .row-editor-modal-content {
  border-top: 4px solid var(--row-editor-accent);
}

#row-editor-modal .row-editor-header {
  margin: -0.15rem -0.15rem 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.65rem 0.65rem 0 0;
  background: var(--row-editor-accent-soft);
}

#row-editor-modal .row-editor-title {
  color: var(--row-editor-accent);
  font-weight: 700;
}

#row-editor-modal .row-editor-header .modal-close-btn {
  color: var(--row-editor-accent);
}

#row-editor-modal .row-editor-grid {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 0.65rem 0.85rem;
}

#row-editor-modal .row-editor-grid .field:nth-child(1),
#row-editor-modal .row-editor-grid .field:nth-child(4),
#row-editor-modal .row-editor-category-field {
  grid-column: 1 / -1;
}

#row-editor-modal .row-editor-grid .field:nth-child(2) {
  grid-column: 1;
}

#row-editor-modal .row-editor-grid .field:nth-child(3) {
  grid-column: 2;
}

#row-editor-modal .row-editor-grid .field label {
  display: block;
  margin-bottom: 0.2rem;
}

#row-editor-modal #row-editor-due .due-controls,
#row-editor-modal #row-editor-due .due-range {
  gap: 0.35rem;
}

#row-editor-modal #row-editor-due .due-controls .due-sep {
  padding: 0;
}

#row-editor-modal #row-editor-due .due-controls select.due-from,
#row-editor-modal #row-editor-due .due-controls select.due-to {
  width: 88px;
  min-width: 88px;
}

#row-editor-modal #row-editor-due .due-controls select.due-mid.due-from {
  width: 210px;
  min-width: 210px;
}

#row-editor-modal #row-editor-due .due-controls select.due-single {
  width: 180px;
  min-width: 180px;
}

#row-editor-modal .row-editor-actions #row-editor-save-new {
  background: var(--row-editor-accent);
  color: #ffffff;
}

#row-editor-modal .row-editor-actions #row-editor-save-new:hover {
  filter: brightness(0.94);
}

#row-editor-modal .row-editor-actions #row-editor-save {
  background: #e5e7eb;
  color: #111827;
  border: 1px solid #d1d5db;
}

#row-editor-modal .row-editor-actions #row-editor-save:hover {
  background: #d1d5db;
}

.table tbody tr.row-type-income {
  background: rgba(74, 163, 227, 0.08);
}

.table tbody tr.row-type-expense {
  background: rgba(220, 38, 38, 0.08);
}

.table tbody tr.row-type-mandatory {
  background: rgba(168, 85, 247, 0.08);
}

.table tbody tr.row-type-saving {
  background: rgba(249, 115, 22, 0.08);
}

.table tbody tr.row-type-donation {
  background: rgba(33, 136, 143, 0.08);
}

.table tbody tr.row-type-tithe {
  background: rgba(160, 101, 0, 0.08);
}

.table thead th:nth-child(2),
.table tbody td:nth-child(2) {
  text-align: right;
}

.table thead th:nth-child(3),
.table thead th:nth-child(4),
.table thead th:nth-child(5),
.table tbody td:nth-child(3),
.table tbody td:nth-child(4),
.table tbody td:nth-child(5) {
  text-align: left;
}

.table tbody td:nth-child(4) .due-controls,
.table tbody td:nth-child(4) .due-range {
  gap: 0.2rem;
}

.table tbody td:nth-child(4) .due-controls .due-sep {
  padding: 0;
  font-size: 0.78rem;
}

.table tbody td:nth-child(4) .due-controls select.due-from,
.table tbody td:nth-child(4) .due-controls select.due-to {
  width: 72px;
  min-width: 72px;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.table tbody td:nth-child(4) .due-controls select.due-mid.due-from {
  width: 132px;
  min-width: 132px;
}

.table tbody td:nth-child(4) .due-controls select.due-single {
  width: 120px;
  min-width: 120px;
}

@media (min-width: 768px) {
  .table {
    table-layout: fixed;
  }

  .table thead th:nth-child(2),
  .table tbody td:nth-child(2) {
    width: 120px;
  }

  .table thead th:nth-child(3),
  .table tbody td:nth-child(3) {
    width: 150px;
  }

  .table thead th:nth-child(4),
  .table tbody td:nth-child(4) {
    width: 250px;
  }

  .table thead th:nth-child(5),
  .table tbody td:nth-child(5) {
    width: clamp(170px, 16vw, 240px);
  }

  .table tbody tr.row-type-income td {
    background: rgba(74, 163, 227, 0.08);
  }

  .table tbody tr.row-type-expense td {
    background: rgba(220, 38, 38, 0.08);
  }

  .table tbody tr.row-type-mandatory td {
    background: rgba(168, 85, 247, 0.08);
  }

  .table tbody tr.row-type-saving td {
    background: rgba(249, 115, 22, 0.08);
  }

  .table tbody tr.row-type-donation td {
    background: rgba(33, 136, 143, 0.08);
  }

  .table tbody tr.row-type-tithe td {
    background: rgba(160, 101, 0, 0.08);
  }
}

.table tbody tr.dragging td {
  background: var(--drag-color, rgba(249, 115, 22, 0.5)) !important;
}

@media (max-width: 640px) {
  #row-editor-modal .row-editor-grid {
    grid-template-columns: 1fr;
  }

  #row-editor-modal .row-editor-grid .field {
    grid-column: 1 / -1 !important;
  }

  #row-editor-modal .row-editor-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #row-editor-modal .row-editor-actions .btn {
    width: 100%;
  }
}

/* Row editor + table fine tuning (2026-04-18) */
.table {
  border-spacing: 0 3px;
}

.table thead th:nth-child(1),
.table thead th:nth-child(2) {
  text-align: left;
}

.table tbody td:nth-child(2) {
  text-align: right;
}

.table tbody td:nth-child(4) .due-controls,
.table tbody td:nth-child(4) .due-range {
  gap: 0.12rem;
}

.table tbody td:nth-child(4) .due-controls {
  justify-content: flex-start;
}

.table tbody td:nth-child(4) .due-range {
  width: auto;
  flex: 0 1 auto;
}

.table tbody td:nth-child(4) .due-controls .due-sep {
  font-size: 0.74rem;
}

.table tbody td:nth-child(4) .due-controls select.due-from,
.table tbody td:nth-child(4) .due-controls select.due-to {
  width: 66px;
  min-width: 66px;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.table tbody td:nth-child(4) .due-controls select.due-mid.due-from {
  width: 122px;
  min-width: 122px;
}

.table tbody td:nth-child(4) .due-controls select.due-single {
  width: 112px;
  min-width: 112px;
}

.table tbody tr.row-type-income {
  --row-type-bg: rgba(74, 163, 227, 0.05);
  --row-type-border: rgba(74, 163, 227, 0.34);
}

.table tbody tr.row-type-expense {
  --row-type-bg: rgba(220, 38, 38, 0.05);
  --row-type-border: rgba(220, 38, 38, 0.34);
}

.table tbody tr.row-type-mandatory {
  --row-type-bg: rgba(168, 85, 247, 0.05);
  --row-type-border: rgba(168, 85, 247, 0.34);
}

.table tbody tr.row-type-saving {
  --row-type-bg: rgba(249, 115, 22, 0.05);
  --row-type-border: rgba(249, 115, 22, 0.34);
}

.table tbody tr.row-type-donation {
  --row-type-bg: rgba(33, 136, 143, 0.05);
  --row-type-border: rgba(33, 136, 143, 0.34);
}

.table tbody tr.row-type-tithe {
  --row-type-bg: rgba(160, 101, 0, 0.05);
  --row-type-border: rgba(160, 101, 0, 0.34);
}

.table tbody tr.row-type-income td,
.table tbody tr.row-type-expense td,
.table tbody tr.row-type-mandatory td,
.table tbody tr.row-type-saving td,
.table tbody tr.row-type-donation td,
.table tbody tr.row-type-tithe td {
  background: var(--row-type-bg);
  border-top: 1px solid var(--row-type-border);
  border-bottom: 1px solid var(--row-type-border);
}

.table tbody tr.row-type-income td:first-child,
.table tbody tr.row-type-expense td:first-child,
.table tbody tr.row-type-mandatory td:first-child,
.table tbody tr.row-type-saving td:first-child,
.table tbody tr.row-type-donation td:first-child,
.table tbody tr.row-type-tithe td:first-child {
  border-left: 1px solid var(--row-type-border);
}

.table tbody tr.row-type-income td:last-child,
.table tbody tr.row-type-expense td:last-child,
.table tbody tr.row-type-mandatory td:last-child,
.table tbody tr.row-type-saving td:last-child,
.table tbody tr.row-type-donation td:last-child,
.table tbody tr.row-type-tithe td:last-child {
  border-right: 1px solid var(--row-type-border);
}

#row-editor-modal .row-editor-header {
  margin: 0 0 0.65rem;
  padding: 0 0 0.5rem;
  border-bottom: 1px solid var(--row-editor-accent);
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
}

#row-editor-modal .row-editor-header .modal-close-btn {
  color: var(--row-editor-accent);
  font-size: 1.7rem;
}

/* Table fine tuning (2026-04-18, follow-up) */
.table {
  border-spacing: 0 4px;
}

.table th,
.table td {
  padding-top: 0.20rem;
  padding-bottom: 0.20rem;
}

.table thead th:nth-child(2),
.table tbody td:nth-child(2) {
  text-align: right;
}

.row-readonly-input,
.row-readonly-select {
  padding-top: 0.01rem !important;
  padding-bottom: 0.01rem !important;
}

.table tbody tr.row-type-income {
  --row-type-bg: rgba(74, 163, 227, 0.035);
  --row-type-border: rgba(74, 163, 227, 0.38);
}

.table tbody tr.row-type-expense {
  --row-type-bg: rgba(220, 38, 38, 0.035);
  --row-type-border: rgba(220, 38, 38, 0.38);
}

.table tbody tr.row-type-mandatory {
  --row-type-bg: rgba(168, 85, 247, 0.035);
  --row-type-border: rgba(168, 85, 247, 0.38);
}

.table tbody tr.row-type-saving {
  --row-type-bg: rgba(249, 115, 22, 0.035);
  --row-type-border: rgba(249, 115, 22, 0.38);
}

.table tbody tr.row-type-donation {
  --row-type-bg: rgba(33, 136, 143, 0.035);
  --row-type-border: rgba(33, 136, 143, 0.38);
}

.table tbody tr.row-type-tithe {
  --row-type-bg: rgba(160, 101, 0, 0.035);
  --row-type-border: rgba(160, 101, 0, 0.38);
}

.card-collapsible .section-body > .btn.small {
  margin-left: 0;
}

/* Table polish (2026-04-18, euro alignment + lighter row fills) */
.table thead th:nth-child(2),
.table tbody td:nth-child(2) {
  text-align: right;
}

.table thead th:nth-child(2) {
  padding-right: 0.45rem;
}

.table tbody td:nth-child(2) .row-readonly-amount {
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: right;
}

.table tbody tr.row-type-income,
.table tbody tr.row-type-expense,
.table tbody tr.row-type-mandatory,
.table tbody tr.row-type-saving,
.table tbody tr.row-type-donation,
.table tbody tr.row-type-tithe {
  background: transparent;
}

.table tbody tr.row-type-income {
  --row-type-bg: rgba(74, 163, 227, 0.024);
  --row-type-border: rgba(74, 163, 227, 0.32);
}

.table tbody tr.row-type-expense {
  --row-type-bg: rgba(220, 38, 38, 0.024);
  --row-type-border: rgba(220, 38, 38, 0.32);
}

.table tbody tr.row-type-mandatory {
  --row-type-bg: rgba(168, 85, 247, 0.024);
  --row-type-border: rgba(168, 85, 247, 0.32);
}

.table tbody tr.row-type-saving {
  --row-type-bg: rgba(249, 115, 22, 0.024);
  --row-type-border: rgba(249, 115, 22, 0.32);
}

.table tbody tr.row-type-donation {
  --row-type-bg: rgba(33, 136, 143, 0.024);
  --row-type-border: rgba(33, 136, 143, 0.32);
}

.table tbody tr.row-type-tithe {
  --row-type-bg: rgba(160, 101, 0, 0.024);
  --row-type-border: rgba(160, 101, 0, 0.32);
}

/* Table compact period + euro header alignment (2026-04-18, follow-up 2) */
.table tbody td:nth-child(4) {
  white-space: nowrap;
}

.table tbody td:nth-child(4) .row-readonly-period {
  display: block;
  width: 100%;
  padding: 0.14rem 0.05rem;
  color: #111827;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table tbody td:nth-child(4) .row-due-meta {
  display: none !important;
}

.table thead th:nth-child(2) {
  padding-right: 0.1rem !important;
}

/* Euro column hard align (2026-04-18, follow-up 3) */
.table thead th:nth-child(2),
.table tbody td:nth-child(2) {
  text-align: right;
}

.table thead th:nth-child(2),
.table tbody td:nth-child(2) {
  padding-right: 0.45rem !important;
  min-width: 9.2rem;
}

.table tbody td:nth-child(2) .row-readonly-amount {
  width: auto !important;
  min-width: 0;
  flex: 1 1 12ch;
  margin-right: 0 !important;
  padding-right: 0 !important;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.table tbody td:nth-child(2) .row-readonly-amount::-webkit-outer-spin-button,
.table tbody td:nth-child(2) .row-readonly-amount::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Mobile row cards + compact row editor (2026-04-18, follow-up 4) */
@media (max-width: 640px) {
  .table {
    border-spacing: 0 6px !important;
  }

  .table thead {
    display: none;
  }

  .table tbody tr.draggable-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 2.15rem;
    grid-template-areas:
      "name actions"
      "amount actions"
      "rhythm actions"
      "period actions"
      "category drag";
    column-gap: 0.55rem;
    row-gap: 0.15rem;
    padding: 0.42rem 0.5rem !important;
    margin: 0 !important;
    border: 1px solid var(--row-type-border, rgba(148, 163, 184, 0.35)) !important;
    border-radius: 0.72rem;
    background: var(--row-type-bg, rgba(241, 245, 249, 0.9)) !important;
  }

  .table tbody tr.draggable-row td {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    min-width: 0;
    width: auto !important;
  }

  .table tbody tr.draggable-row td.cell-name {
    grid-area: name;
  }

  .table tbody tr.draggable-row td.cell-amount {
    grid-area: amount;
  }

  .table tbody tr.draggable-row td.cell-rhythm {
    grid-area: rhythm;
  }

  .table tbody tr.draggable-row td.cell-period {
    grid-area: period;
  }

  .table tbody tr.draggable-row td.cell-category {
    grid-area: category;
  }

  .table tbody tr.draggable-row td.icon-col {
    grid-area: actions;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.02rem !important;
  }

  .table tbody tr.draggable-row td.drag-col {
    grid-area: drag;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: 0.12rem !important;
  }

  .table tbody tr.draggable-row .row-action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.2rem;
    width: auto;
  }

  .table tbody tr.draggable-row .icon-button,
  .table tbody tr.draggable-row .drag-handle {
    width: 1.86rem;
    height: 1.86rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .table tbody tr.draggable-row .drag-handle {
    margin-right: 0;
  }

  .table tbody tr.draggable-row .row-readonly-input,
  .table tbody tr.draggable-row .row-readonly-select,
  .table tbody tr.draggable-row .row-readonly-period {
    padding-top: 0.06rem !important;
    padding-bottom: 0.06rem !important;
    line-height: 1.18;
  }

  .table tbody tr.draggable-row td.cell-period .row-readonly-period {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .table tbody tr.draggable-row .row-due-meta {
    display: none !important;
  }

  #row-editor-modal .row-editor-modal-content {
    width: min(98vw, 640px);
    padding: 0.75rem 0.7rem 0.8rem;
  }

  #row-editor-modal .row-editor-header {
    margin: 0 0 0.4rem;
    padding: 0 0 0.35rem;
  }

  #row-editor-modal .row-editor-grid {
    grid-template-columns: 1fr !important;
    gap: 0.34rem !important;
  }

  #row-editor-modal .row-editor-grid .field,
  #row-editor-modal .row-editor-category-field {
    grid-column: 1 / -1 !important;
    display: grid;
    grid-template-columns: 6.4rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.45rem;
    margin-bottom: 0;
  }

  #row-editor-modal .row-editor-grid .field label {
    margin: 0 !important;
    width: 6.4rem;
    font-size: 0.79rem;
    line-height: 1.15;
  }

  #row-editor-modal .row-editor-grid .field > input,
  #row-editor-modal .row-editor-grid .field > select,
  #row-editor-modal #row-editor-due,
  #row-editor-modal #row-editor-category {
    width: 100%;
    min-width: 0;
  }

  #row-editor-modal #row-editor-due .due-controls,
  #row-editor-modal #row-editor-due .due-range {
    gap: 0.22rem;
    flex-wrap: nowrap;
  }

  #row-editor-modal #row-editor-due .due-controls select.due-from,
  #row-editor-modal #row-editor-due .due-controls select.due-to {
    width: 4.5rem;
    min-width: 4.5rem;
  }

  #row-editor-modal #row-editor-due .due-controls select.due-mid.due-from {
    width: min(100%, 8rem);
    min-width: 0;
  }

  #row-editor-modal #row-editor-due .due-controls select.due-single {
    width: min(100%, 7.2rem);
    min-width: 0;
  }

  #row-editor-modal .row-editor-actions {
    margin-top: 0.6rem;
    gap: 0.45rem;
  }

  #row-editor-modal .row-editor-actions .btn {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }
}

/* Mobile/Drag follow-up fixes (2026-04-18, follow-up 5) */
.table tbody tr.row-type-income {
  --drag-color: rgba(74, 163, 227, 0.36);
}

.table tbody tr.row-type-expense {
  --drag-color: rgba(220, 38, 38, 0.36);
}

.table tbody tr.row-type-mandatory {
  --drag-color: rgba(168, 85, 247, 0.36);
}

.table tbody tr.row-type-saving {
  --drag-color: rgba(249, 115, 22, 0.36);
}

.table tbody tr.row-type-donation {
  --drag-color: rgba(33, 136, 143, 0.36);
}

.table tbody tr.row-type-tithe {
  --drag-color: rgba(160, 101, 0, 0.36);
}

@media (max-width: 640px) {
  .table {
    border-spacing: 0 8px !important;
  }

  .table tbody {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .table tbody tr.draggable-row {
    position: relative;
    border: 0 !important;
    width: 100%;
    padding: 0.44rem 0.52rem !important;
    border-radius: 0.72rem;
    background: var(--row-type-bg, rgba(241, 245, 249, 0.88)) !important;
  }

  .table tbody tr.draggable-row::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--row-type-border, rgba(148, 163, 184, 0.35));
    border-radius: inherit;
    pointer-events: none;
  }

  .table tbody tr.draggable-row td {
    background: transparent !important;
  }

  .table tbody tr.draggable-row td.cell-amount,
  .table tbody tr.draggable-row td.cell-amount .row-readonly-amount,
  .table tbody tr.draggable-row td.cell-amount .row-readonly-amount-inline {
    text-align: left !important;
  }

  .table tbody tr.draggable-row td.cell-amount {
    display: flex;
    justify-content: flex-start !important;
    align-items: center;
  }

  .table tbody tr.draggable-row td.cell-amount .row-readonly-amount-inline {
    justify-content: flex-start;
    flex-wrap: nowrap !important;
    width: 100%;
  }

  .table tbody tr.draggable-row td.cell-amount .row-readonly-amount {
    flex: 1 1 auto;
    width: auto !important;
    max-width: none;
    min-width: 0;
    margin-right: 0 !important;
    padding-right: 0 !important;
  }

  .table thead th:nth-child(2),
  .table tbody td:nth-child(2) {
    min-width: 0;
  }

  .table tbody tr.draggable-row.dragging {
    background: var(--drag-color, rgba(249, 115, 22, 0.36)) !important;
  }

  .table tbody tr.draggable-row.dragging::after {
    border-color: rgba(17, 24, 39, 0.22);
  }

  .table tbody tr.draggable-row.dragging td {
    background: transparent !important;
  }

  #row-editor-modal {
    align-items: flex-start !important;
    padding: 40px 12px 12px !important;
  }

  #row-editor-modal .row-editor-modal-content {
    margin: 0 auto !important;
    max-height: calc(100vh - 52px);
    max-height: calc(100dvh - 52px);
    overflow: auto;
  }
}

/* Country/PLZ axis + admin country manager (2026-04-19) */
#auth-view.auth-split .auth-register .row.row-country-postal-city {
  display: grid;
  grid-template-columns: minmax(4.8rem, 5.2rem) minmax(0, calc(50% - 5.2rem - 1.125rem)) minmax(0, 1fr);
  column-gap: 0.75rem;
  row-gap: 0.75rem;
  align-items: end;
}

#auth-view.auth-split .auth-register .row.row-country-postal-city .field {
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
}

#auth-view.auth-split .auth-register .row.row-country-postal-city .field.w-country,
#auth-view.auth-split .auth-register .row.row-country-postal-city .field.w-postal,
#auth-view.auth-split .auth-register .row.row-country-postal-city .field.w-city {
  max-width: none;
}

.profile-edit-form .row.row-country-postal-city {
  grid-template-columns: minmax(4.8rem, 5.2rem) minmax(0, calc(50% - 5.2rem - 1.5rem)) minmax(0, 1fr);
}

.profile-edit-form .row.row-country-postal-city .field {
  min-width: 0;
}

.row-country-postal-city .country-code-field input {
  max-width: none;
}

.admin-country-manager {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-country-select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
}

.admin-country-editor-row {
  display: grid;
  grid-template-columns: minmax(4.8rem, 5.6rem) minmax(0, 1fr);
  gap: 0.75rem;
}

.admin-country-name-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
}

.admin-country-name-wrap input {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-country-delete {
  border: none;
  background: transparent;
  color: #16a34a;
  width: 2rem;
  height: 2rem;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2rem;
}

.admin-country-delete svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.admin-country-delete:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.admin-country-actions {
  justify-content: space-between;
  margin-top: 0.2rem;
}

.admin-country-manager.is-locked input {
  background: #f3f4f6;
  color: #6b7280;
}

@media (max-width: 900px) {
  #auth-view.auth-split .auth-register .row.row-country-postal-city {
    grid-template-columns: 1fr;
    row-gap: 0.6rem;
  }
}

@media (max-width: 700px) {
  .admin-country-editor-row {
    grid-template-columns: 1fr;
  }

  .admin-country-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .profile-edit-form .row.row-country-postal-city {
    grid-template-columns: 1fr;
  }
}

/* Amount column final consistency (2026-04-19) */
@media (min-width: 641px) {
  .table thead th:nth-child(2),
  .table tbody td:nth-child(2) {
    width: clamp(10.5rem, 14vw, 14rem);
    min-width: 10.5rem;
  }
}

.table tbody tr.draggable-row td.cell-amount {
  white-space: nowrap;
}

.table tbody tr.draggable-row td.cell-amount .row-readonly-amount-inline {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.22rem;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
}

.table tbody tr.draggable-row td.cell-amount .row-readonly-amount {
  width: auto !important;
  min-width: 0;
  flex: 1 1 14ch;
  text-align: right;
  line-height: 1.2;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.table tbody tr.draggable-row td.cell-amount .row-readonly-currency {
  flex: 0 0 auto;
  align-self: baseline;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .table tbody tr.draggable-row td.cell-amount {
    display: block;
    text-align: left !important;
    min-width: 0;
  }

  .table tbody tr.draggable-row td.cell-amount .row-readonly-amount-inline {
    justify-content: flex-start;
  }

  .table tbody tr.draggable-row td.cell-amount .row-readonly-amount {
    flex: 1 1 13ch;
  }

  .table thead th:nth-child(2),
  .table tbody td:nth-child(2) {
    width: auto;
    min-width: 0;
  }
}
