:root {
  font-family: "Segoe UI", "Tahoma", "Noto Kufi Arabic", sans-serif;

  /* Farbpalette: Smaragd-Teal + Gold */
  --brand: #0e7c66;
  --brand-2: #12a184;
  --brand-dark: #0a5c4c;
  --brand-light: #e9f6f2;
  --gold: #e0a72e;
  --gold-dark: #c98f1e;
  --ink: #14312a;
  --muted: #5b7a72;

  --shadow-sm: 0 4px 14px rgba(20,49,42,.06);
  --shadow-md: 0 10px 28px rgba(20,49,42,.10);
  --radius: 1rem;

  /* Bootstrap-Variablen anpassen */
  --bs-primary: var(--brand);
  --bs-primary-rgb: 14, 124, 102;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 14, 124, 102;
  --bs-link-hover-color: var(--brand-dark);
  --bs-body-color: var(--ink);
  --bs-border-color: #e3ece9;
}

* { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(18,161,132,.10), transparent),
    radial-gradient(1000px 400px at -10% 110%, rgba(224,167,46,.10), transparent),
    #f4f7f6 !important;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cde0da; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-2); }

/* ---- Buttons ---- */
.btn { border-radius: .65rem; font-weight: 600; transition: transform .12s ease, box-shadow .2s ease; }
.btn:active { transform: translateY(1px); }
.btn-lg { border-radius: .8rem; }
.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  box-shadow: 0 6px 16px rgba(14,124,102,.25);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(14,124,102,.34); }
.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}
.btn-success {
  --bs-btn-bg: var(--gold);
  --bs-btn-border-color: var(--gold);
  --bs-btn-hover-bg: var(--gold-dark);
  --bs-btn-hover-border-color: var(--gold-dark);
  --bs-btn-active-bg: var(--gold-dark);
  --bs-btn-active-border-color: var(--gold-dark);
  --bs-btn-color: #4a3405;
  --bs-btn-hover-color: #4a3405;
  box-shadow: 0 6px 16px rgba(224,167,46,.28);
}
.btn-outline-success {
  --bs-btn-color: var(--gold-dark);
  --bs-btn-border-color: var(--gold);
  --bs-btn-hover-bg: var(--gold);
  --bs-btn-hover-color: #4a3405;
  --bs-btn-hover-border-color: var(--gold);
}

/* ---- Flächen / Farben ---- */
.bg-primary { background-color: var(--brand) !important; }
.bg-success { background-color: var(--gold) !important; color: #4a3405 !important; }
.text-primary { color: var(--brand) !important; }
.text-success { color: var(--gold-dark) !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* Verlaufs-Überschrift */
h1.h4, .page-title {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* ---- Navbar ---- */
.navbar.bg-primary {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand)) !important;
  backdrop-filter: saturate(1.2);
}
.navbar-brand { letter-spacing: .2px; }
.navbar-brand img { height: 36px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.brand-logo {
  height: 40px !important; width: 40px; object-fit: contain;
  border-radius: 11px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); filter: none !important;
}
.navbar .nav-link { border-radius: .55rem; padding-inline: .7rem !important; transition: background .15s ease; }
.navbar .nav-link:hover { background: rgba(255,255,255,.12); }
.navbar .dropdown-menu { border: none; box-shadow: var(--shadow-md); border-radius: .8rem; }

/* ---- Karten ---- */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.stat-card { border-radius: 1.1rem; position: relative; overflow: hidden; }
.stat-card:hover { transform: translateY(-4px); }
.stat-card .display-6 { font-weight: 800; }

/* Icon-Chip in Karten */
.icon-chip {
  width: 3rem; height: 3rem; border-radius: .9rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex: 0 0 auto;
}
.icon-chip.teal { background: rgba(14,124,102,.12); color: var(--brand); }
.icon-chip.gold { background: rgba(224,167,46,.16); color: var(--gold-dark); }
.icon-chip.rose { background: rgba(220,53,69,.12); color: #c02a3a; }
.icon-chip.blue { background: rgba(20,110,180,.12); color: #146eb4; }

/* farbige Statistik-Karten mit dekorativem Kreis */
.stat-card.bg-primary { background: linear-gradient(135deg, var(--brand-2), var(--brand-dark)) !important; }
.stat-card.bg-success {
  background: linear-gradient(135deg, #f2c65a, var(--gold)) !important;
  color: #4a3405 !important;
}
.stat-card::after {
  content: ""; position: absolute; inset-inline-start: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.stat-card .stat-icon {
  position: absolute; inset-inline-end: 1rem; top: 1rem;
  font-size: 2rem; opacity: .35;
}

/* ---- Tabellen ---- */
.table-responsive { border-radius: .85rem; overflow: hidden; box-shadow: var(--shadow-sm); }
.table { margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .85rem .8rem; }
.table thead th {
  color: #fff; font-weight: 600; border: none;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--brand-light); }
.table a { color: var(--brand-dark); font-weight: 600; }
.table a:hover { text-decoration: underline; }

/* ---- Badges ---- */
.badge { font-weight: 600; letter-spacing: .2px; padding: .45em .7em; border-radius: .5rem; }
.badge.bg-secondary { background-color: var(--muted) !important; }

/* ---- Listengruppen ---- */
.list-group-item { border-color: #eef3f1; }
.list-group-item-action:hover { background: var(--brand-light); }

/* ---- Formulare ---- */
.form-control, .form-select { border-radius: .6rem; border-color: #dce7e3; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .22rem rgba(14,124,102,.18);
}
.form-label { font-weight: 600; color: var(--brand-dark); }
.input-group-text {
  background: var(--brand-light); color: var(--brand); border-color: #dce7e3;
}

/* ---- Alerts ---- */
.alert { border: none; border-radius: .8rem; box-shadow: var(--shadow-sm); }

/* ---- Login-Marke ---- */
.brand-hero img { height: 96px; width: auto; filter: drop-shadow(0 8px 16px rgba(14,124,102,.25)); }
.brand-hero h1 {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* Leere-Zustände */
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty-state i { font-size: 2.6rem; opacity: .5; display: block; margin-bottom: .5rem; }

/* Footer */
footer { border-top: 1px solid #e6efec; }

/* ---- Toasts ---- */
.toast-container { z-index: 1100; }

/* Einblend-Animation */
main > * { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Login / Auth (isoliert, zentriert – Systemfarben) ============ */
body.auth-page {
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(18,161,132,.16), transparent),
    radial-gradient(700px 400px at 100% 120%, rgba(224,167,46,.12), transparent),
    #f4f7f6 !important;
}
body.auth-page main.container {
  max-width: 100%;
  padding: 0 !important;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
body.auth-page footer { display: none; }
body.auth-page .alert { text-align: center; }

.auth-box { width: min(390px, 92vw); text-align: center; color: var(--ink); }

.auth-logo {
  width: 78px; height: 78px; margin: 0 auto .9rem;
  border-radius: 1.15rem;
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(14,124,102,.28);
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }

.auth-box h1 {
  font-weight: 800; font-size: 1.55rem; margin: 0; letter-spacing: .3px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-sub { color: var(--muted); font-size: .88rem; margin-bottom: 1.5rem; }

.auth-card {
  background: #fff;
  border: 1px solid #e3ece9;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1rem;
}
.auth-card .input-group { border: 0; border-radius: 0; }
.auth-card .input-group + .input-group { border-top: 1px solid #eef3f1; }
.auth-card .input-group-text {
  background: transparent; border: 0; color: var(--brand); padding-inline: 1rem;
}
.auth-card .form-control {
  background: transparent !important; border: 0; color: var(--ink);
  box-shadow: none !important; padding-block: .9rem;
}
.auth-card .form-control::placeholder { color: #9db2ac; opacity: 1; }
.auth-card .form-control:focus { color: var(--ink); }
.auth-eye {
  background: transparent; border: 0; color: #9db2ac; padding-inline: 1rem;
}
.auth-eye:hover { color: var(--brand); }

.btn-auth {
  width: 100%; padding-block: .85rem; font-weight: 700; border: 0;
  border-radius: .95rem; color: #fff;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  box-shadow: 0 14px 28px rgba(14,124,102,.32);
  transition: filter .15s ease, transform .15s ease;
}
.btn-auth:hover { filter: brightness(1.06); color: #fff; transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }

.auth-divider {
  display: flex; align-items: center; gap: .8rem;
  color: var(--muted); font-size: .78rem; margin: 1.1rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: #e0e9e6;
}

.btn-auth-ghost {
  width: 100%; padding-block: .78rem; font-weight: 600; border-radius: .95rem;
  color: var(--brand-dark); background: var(--brand-light);
  border: 1px solid rgba(14,124,102,.18);
  transition: background .15s ease;
}
.btn-auth-ghost:hover { background: #ddf0ea; color: var(--brand-dark); }

.auth-box .auth-link { color: var(--muted); text-decoration: none; }
.auth-box .auth-link:hover { color: var(--brand-dark); }

/* Standard-Django-Felder (Reset-Seiten) in der Auth-Karte */
.auth-box .card { border: 1px solid #e3ece9; box-shadow: var(--shadow-md); }
.auth-box .card .form-label { color: var(--brand-dark); font-weight: 600; }
.auth-box .card input:not([type=checkbox]):not([type=radio]) {
  width: 100%;
  padding: .72rem .9rem;
  border: 1px solid #dce7e3;
  border-radius: .7rem;
  color: var(--ink);
  background: #fff;
  margin-bottom: .2rem;
}
.auth-box .card input:not([type=checkbox]):not([type=radio]):focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(14,124,102,.18);
}
.auth-box .card .btn-auth { margin-top: .4rem; }
.auth-box .card .form-text { color: var(--muted); font-size: .8rem; }

/* ==================================================================
   iOS-Style: untere Tab-Leiste (Footer-Buttons)
   ================================================================== */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: .25rem;
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(20, 49, 42, .08);
  box-shadow: 0 -6px 24px rgba(20, 49, 42, .06);
}
.tabbar-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: .3rem .2rem;
  text-decoration: none;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  border-radius: .8rem;
  transition: color .18s ease, background .18s ease, transform .12s ease;
  /* Button-Standardstile zurücksetzen (für den „المزيد“-Button) */
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.tabbar-item i { font-size: 1.35rem; line-height: 1; }
.tabbar-item span:last-child { line-height: 1; white-space: nowrap; }
.tabbar-item:active { transform: scale(.94); }
.tabbar-item.active { color: var(--brand); background: var(--brand-light); }

.tabbar-icon-wrap { position: relative; display: inline-flex; }
.tabbar-badge {
  position: absolute;
  top: -6px;
  inset-inline-start: 100%;
  transform: translateX(-40%);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: .62rem;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: #e5484d;
  border-radius: 999px;
}

/* Platz für die Tab-Leiste schaffen (nur auf kleinen Bildschirmen sichtbar) */
@media (max-width: 991.98px) {
  .tabbar { display: flex; }
  main.container { padding-top: .6rem !important; padding-bottom: 5.5rem !important; }
  .app-copyright { margin-bottom: 4.5rem; }
  /* Menü im oberen Navbar auf Mobil ausblenden – es steckt jetzt in der Fußleiste */
  .navbar .navbar-toggler,
  .navbar .navbar-collapse { display: none !important; }
}
@media (min-width: 992px) {
  .tabbar { display: none; }
  .sheet-backdrop { display: none !important; }
}

/* ---- iOS-Style Bottom-Sheet („المزيد“) ---- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 49, 42, .45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.sheet-backdrop.open { opacity: 1; visibility: visible; }
.sheet {
  width: 100%;
  max-width: 640px;
  max-height: 82vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: .8rem 1rem calc(1rem + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(20, 49, 42, .18);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-handle {
  width: 44px; height: 5px; border-radius: 999px;
  background: #d3e0db; margin: .2rem auto 1rem;
}
.sheet-title {
  font-size: 1.05rem; font-weight: 800; color: var(--brand-dark);
  text-align: center; margin: 0 0 .9rem;
}
.sheet-group {
  font-size: .72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin: .9rem .2rem .4rem;
}
.sheet-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; margin-bottom: .5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 13px; background: #f7fbfa;
  color: var(--ink); font-weight: 600; font-size: .95rem;
  text-decoration: none; text-align: start;
  transition: background .18s ease, transform .12s ease;
}
.sheet-link:active { transform: scale(.98); }
.sheet-link .sheet-ico {
  width: 26px; flex: 0 0 auto; color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.sheet-link.active { background: var(--brand-light); border-color: #bfe3d9; }
.sheet-link .sheet-zahl {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: #e5484d; color: #fff;
  font-size: .72rem; font-weight: 800;
  display: grid; place-items: center; margin-inline-start: auto;
}
.sheet-link.logout {
  color: #fff; background: linear-gradient(135deg, #d65a48, #b23a25);
  border: none; justify-content: center; margin-top: .6rem;
}
.sheet-link.logout .sheet-ico { color: #fff; }
body.sheet-open { overflow: hidden; }

/* ---- iOS-Feinschliff ---- */
.card { border-radius: var(--radius); }
.navbar.sticky-top {
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  /* Notch/Safe-Area oben mit der Markenfarbe füllen (iOS Standalone) */
  padding-top: calc(.5rem + env(safe-area-inset-top));
  padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
}

/* ==================================================================
   iOS-Style: Benachrichtigungsliste
   ================================================================== */
.ios-page { max-width: 640px; margin: 0 auto; }
.ios-title {
  font-size: 1.5rem; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; gap: .5rem; margin: .2rem 0 1rem;
}
.ios-title i { color: var(--brand); }

.ios-list {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ios-notif {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  border-bottom: 1px solid #eef4f2;
  transition: background .15s ease;
}
.ios-notif:last-child { border-bottom: 0; }
.ios-notif:active { background: #f1f7f5; }
.ios-notif.unread { background: linear-gradient(90deg, rgba(14,124,102,.06), transparent 60%); }

.ios-notif-ico {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-size: 1.2rem;
  background: var(--brand);
  box-shadow: 0 4px 10px rgba(14,124,102,.25);
}
/* Farben je Kategorie */
.cat-loan       .ios-notif-ico { background: #e0a72e; box-shadow: 0 4px 10px rgba(224,167,46,.3); }
.cat-guarantee  .ios-notif-ico { background: #3a86ff; box-shadow: 0 4px 10px rgba(58,134,255,.3); }
.cat-investment .ios-notif-ico { background: #8338ec; box-shadow: 0 4px 10px rgba(131,56,236,.3); }
.cat-contribution .ios-notif-ico { background: #12a184; box-shadow: 0 4px 10px rgba(18,161,132,.3); }
.cat-profit     .ios-notif-ico { background: #e5484d; box-shadow: 0 4px 10px rgba(229,72,77,.3); }

.ios-notif-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.ios-notif-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.ios-notif-title { font-weight: 700; font-size: .96rem; color: var(--ink); }
.ios-notif-time { flex: 0 0 auto; font-size: .74rem; color: var(--muted); }
.ios-notif-msg {
  font-size: .85rem; color: var(--muted); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ios-notif-dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.15);
}

.ios-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.ios-empty i { font-size: 2.4rem; opacity: .5; }
.ios-empty p { margin: .6rem 0 0; }

/* Hero-Betragskarte (Beitragssatz) */
.ios-rate-hero {
  text-align: center;
  padding: 1.6rem 1rem;
  margin-bottom: 1.1rem;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-dark));
  box-shadow: 0 12px 30px rgba(14,124,102,.28);
}
.ios-rate-label { display: block; font-size: .82rem; opacity: .9; }
.ios-rate-amount { display: block; font-size: 2.6rem; font-weight: 800; line-height: 1.1; margin: .3rem 0; }
.ios-rate-amount small { font-size: 1.1rem; font-weight: 700; opacity: .9; }
.ios-rate-since { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; opacity: .95; }
.ios-row.is-current { background: var(--brand-light); }

/* iOS-Schalter (Benachrichtigungen aktivieren) */
.ios-toggle-row { display: flex; align-items: center; gap: .85rem; }
.ios-toggle-ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-size: 1.15rem;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
}
.ios-toggle-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ios-toggle-title { font-weight: 700; font-size: .98rem; color: var(--ink); }
.ios-toggle-sub { font-size: .8rem; color: var(--muted); }
.ios-card-hint { margin: .8rem 0 .9rem; font-size: .82rem; color: var(--brand-dark); min-height: 1rem; }

.ios-switch { position: relative; flex: 0 0 auto; width: 52px; height: 31px; display: inline-block; }
.ios-switch input { opacity: 0; width: 0; height: 0; }
.ios-switch-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #d5ded9; border-radius: 999px; transition: background .25s ease;
}
.ios-switch-slider::before {
  content: ""; position: absolute; height: 27px; width: 27px; top: 2px; inset-inline-start: 2px;
  background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,.25);
  transition: transform .25s cubic-bezier(.32,.72,0,1);
}
.ios-switch input:checked + .ios-switch-slider { background: var(--brand-2); }
.ios-switch input:checked + .ios-switch-slider::before { transform: translateX(-21px); }
.ios-switch input:disabled + .ios-switch-slider { opacity: .5; cursor: not-allowed; }


.ios-subtitle {
  font-size: .95rem; font-weight: 700; color: var(--muted);
  margin: 1.6rem .2rem .6rem;
}
.ios-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 1.1rem;
  margin-bottom: 1.1rem;
}
.ios-card-lead { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }

/* Eingabefelder im iOS-Look (innerhalb der Karten) */
.ios-card .form-label { font-weight: 600; color: var(--brand-dark); font-size: .88rem; margin-bottom: .35rem; }
.ios-card .form-control,
.ios-card .form-select {
  border-radius: 12px;
  border: 1px solid #dce7e3;
  padding: .7rem .9rem;
  background: #f7fbfa;
  font-size: .95rem;
}
.ios-card .form-control:focus,
.ios-card .form-select:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 .22rem rgba(14,124,102,.16);
}
.ios-card .form-text { color: var(--muted); font-size: .8rem; }

/* Primärer iOS-Button */
.btn-ios-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  width: 100%;
  padding: .8rem 1rem;
  border: 0; border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; font-weight: 700; font-size: .98rem;
  box-shadow: 0 8px 20px rgba(14,124,102,.28);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease;
}
.btn-ios-primary:active { transform: translateY(1px) scale(.99); }
.ios-add-btn { text-decoration: none; margin-bottom: 1rem; }

/* Sekundärer (Ghost-)Button im iOS-Stil */
.btn-ios-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.2rem; border-radius: 13px;
  background: var(--brand-light); color: var(--brand-dark);
  font-weight: 700; font-size: .95rem; text-decoration: none;
  border: 0; cursor: pointer;
}
.btn-ios-ghost:active { transform: translateY(1px) scale(.99); }

/* Kopf + Aktionen der Bearbeiten-Seite */
.ios-edit-head {
  display: flex; align-items: center; gap: .8rem;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid #eef4f2;
}
.ios-edit-name { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.ios-edit-sub { font-size: .82rem; color: var(--muted); }
.ios-edit-actions { display: flex; gap: .6rem; margin-top: .4rem; }
.ios-edit-actions .btn-ios-primary { width: auto; flex: 1 1 auto; }

/* Kopier-Feld (Einladungslink) */
.ios-copy { display: flex; gap: .5rem; }
.ios-copy input {
  flex: 1 1 auto; min-width: 0;
  border-radius: 12px; border: 1px solid #dce7e3;
  padding: .7rem .9rem; background: #f7fbfa;
  font-size: .85rem; color: var(--ink);
}
.ios-copy-btn {
  flex: 0 0 auto;
  border: 0; border-radius: 12px;
  padding: .7rem 1rem;
  background: var(--brand-light); color: var(--brand-dark);
  font-weight: 700; font-size: .88rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
  transition: background .18s ease;
}
.ios-copy-btn:active { background: #d5ede6; }

/* Zeilenliste (z. B. frühere Einladungen) */
.ios-row {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid #eef4f2;
}
.ios-row:last-child { border-bottom: 0; }
.ios-row-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.05rem;
  background: var(--brand-light); color: var(--brand);
}
.ios-row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ios-row-title { font-weight: 700; font-size: .93rem; color: var(--ink); }
.ios-row-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-paid-stack { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.ios-paid-date { font-size: .68rem; color: var(--muted); }
.ios-badge-stack { display: inline-flex; flex-direction: column; align-items: center; gap: .05rem; padding: .35rem .7rem; line-height: 1.15; text-align: center; border-radius: 14px; }
.ios-badge-date { font-size: .68rem; font-weight: 700; opacity: .9; }
.ios-badge {
  flex: 0 0 auto; padding: .28rem .7rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700;
}
.ios-badge.ok    { background: #e3f5ee; color: #0a7a54; }
.ios-badge.info  { background: #e4f0ff; color: #2563c9; }
.ios-badge.muted { background: #eef2f0; color: #6b7c77; }
.ios-badge.dark  { background: #14312a; color: #fff; }
.ios-badge.danger { background: #fde5e5; color: #c0362f; }
.ios-badge.warning { background: #fff3d6; color: #9a6b00; }

/* Kopfzeile mit Titel + Aktionsbutton (z. B. Investitionen) */
.ios-head-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.ios-head-btn { width: auto; flex: 0 0 auto; padding: .55rem .9rem; font-size: .85rem; }

/* Investment-Zeilen (wie Mitgliedskarten) */
.ios-invest {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid #eef4f2; transition: background .15s ease;
}
.ios-invest:last-child { border-bottom: 0; }
.ios-invest:active { background: #f1f7f5; }
.ios-invest-ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-size: 1.15rem;
  background: var(--brand);
}
.ios-invest-ico.status-closed { background: linear-gradient(135deg, #17b981, #0a7a54); }
.ios-invest-ico.status-rejected { background: linear-gradient(135deg, #f2555a, #c0362f); }
.ios-invest-ico.status-active, .ios-invest-ico.status-approved { background: linear-gradient(135deg, #4a90ff, #2563c9); }
.ios-invest-ico.status-pending_committee { background: linear-gradient(135deg, #f0b429, #c98f1e); }
.ios-invest-ico.status-repaid { background: linear-gradient(135deg, #17b981, #0a7a54); }
.ios-invest-ico.status-overdue { background: linear-gradient(135deg, #f2555a, #c0362f); }
.ios-invest-ico.status-pending_guarantors,
.ios-invest-ico.status-pending_admin { background: linear-gradient(135deg, #f0b429, #c98f1e); }

/* Investment-Detail: Hero + Zweck + Danger-Button */
.ios-detail-hero {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem 1rem; margin-bottom: 1.1rem;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm);
}
.ios-detail-info { flex: 1 1 auto; min-width: 0; }
.ios-invest-ico.lg { width: 60px; height: 60px; font-size: 1.6rem; border-radius: 18px; margin: 0 auto .7rem; }
.ios-detail-amount { font-size: 1.3rem; font-weight: 800; color: var(--ink); line-height: 1.15; }
.ios-detail-amount small { font-size: .85rem; font-weight: 700; color: var(--muted); }
.ios-detail-sub { font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.ios-detail-purpose { color: var(--ink); font-size: .95rem; line-height: 1.5; }
.btn-ios-ghost.ios-btn-danger { background: #fde5e5; color: #c0362f; }

/* Verlauf als Schritte (Timeline) */
.ios-steps {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm);
  padding: 1rem 1.1rem;
}
.ios-step { position: relative; display: flex; gap: .8rem; padding-bottom: 1.1rem; }
.ios-step.last { padding-bottom: 0; }
.ios-step::before {
  content: ""; position: absolute; top: 26px; bottom: 0;
  inset-inline-start: 12px; width: 2px; background: #e3ece9;
}
.ios-step.last::before { display: none; }
.ios-step-dot {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; z-index: 1;
  background: #e3ece9; color: var(--muted);
}
.ios-step.done .ios-step-dot { background: linear-gradient(135deg, #17b981, #0a7a54); color: #fff; }
.ios-step.pending .ios-step-dot { background: #fff3d6; color: #9a6b00; }
.ios-step.rejected .ios-step-dot { background: #fde5e5; color: #c0362f; }
.ios-step-body { display: flex; flex-direction: column; gap: .1rem; padding-top: .1rem; }
.ios-step-title { font-weight: 700; font-size: .92rem; color: var(--ink); }
.ios-step-date { font-size: .8rem; color: var(--muted); display: block; }
.ios-step-date i { color: var(--brand); }
.ios-step-sub { margin-top: .4rem; display: flex; flex-direction: column; gap: .3rem; }
.ios-substep {
  display: flex; align-items: center; gap: .4rem;
  background: #f5f9f7; border-radius: 9px; padding: .35rem .6rem; font-size: .78rem;
}
.ios-substep-name { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--ink); }
.ios-substep-date { flex: 0 0 auto; font-size: .72rem; color: var(--muted); }
.text-ok { color: #0a7a54; }
.text-danger { color: #c0362f; }
.text-warn { color: #9a6b00; }
.text-info { color: #2563c9; }

/* Typ-Auswahl (ربح / رأس المال) als iOS-Segment */
.ios-kind-choice { display: flex; gap: .5rem; margin-bottom: .7rem; }
.ios-kind { flex: 1 1 0; margin: 0; cursor: pointer; }
.ios-kind input { position: absolute; opacity: 0; pointer-events: none; }
.ios-kind span {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .6rem; border-radius: 12px; font-weight: 700; font-size: .9rem;
  background: #f2f6f4; color: var(--muted); border: 1.5px solid transparent;
  transition: all .15s ease;
}
.ios-kind input:checked + span { background: var(--brand-light); color: var(--brand-dark); border-color: var(--brand-2); }


/* iOS-Style: Audit-Log-Karten */
.ios-audit {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .85rem 1rem; border-bottom: 1px solid #eef4f2;
}
.ios-audit:last-child { border-bottom: 0; }
.ios-audit-ico {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-size: 1rem;
  background: var(--muted);
}
.action-create .ios-audit-ico { background: linear-gradient(135deg, #17b981, #0a7a54); }
.action-update .ios-audit-ico { background: linear-gradient(135deg, #4a90ff, #2563c9); }
.action-delete .ios-audit-ico { background: linear-gradient(135deg, #f2555a, #c0362f); }
.ios-audit-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.ios-audit-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ios-audit-repr { font-weight: 700; font-size: .9rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ios-audit-meta { display: flex; flex-wrap: wrap; gap: .15rem .8rem; font-size: .76rem; color: var(--muted); }
.ios-audit-meta i { color: var(--brand); }

/* ==================================================================
   iOS-Style: Filterleiste + Mitgliederkarten
   ================================================================== */
.ios-filter {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm);
  padding: .8rem; margin-bottom: 1.1rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.ios-filter .form-control,
.ios-filter .form-select {
  border-radius: 12px; border: 1px solid #dce7e3;
  padding: .68rem .9rem; background: #f7fbfa; font-size: .92rem;
}
.ios-filter .form-control:focus,
.ios-filter .form-select:focus {
  background: #fff; border-color: var(--brand);
  box-shadow: 0 0 0 .22rem rgba(14,124,102,.16);
}
.ios-filter-row { display: flex; gap: .6rem; }
.ios-filter-row .form-select { flex: 1 1 auto; }
.ios-filter-btn {
  flex: 0 0 auto; border: 0; border-radius: 12px;
  padding: .68rem 1.2rem; font-weight: 700; font-size: .9rem; cursor: pointer;
  background: var(--brand-light); color: var(--brand-dark);
  display: inline-flex; align-items: center; gap: .35rem;
}
.ios-filter-btn:active { background: #d5ede6; }

/* iOS Segmented Control (Tab-Filter) */
.ios-segment {
  display: flex; gap: .25rem;
  background: #e7efec; border-radius: 12px;
  padding: .25rem; margin-bottom: 1.1rem;
}
.ios-seg {
  flex: 1 1 0; text-align: center;
  padding: .5rem .3rem; border-radius: 9px;
  font-size: .84rem; font-weight: 700; color: var(--muted);
  text-decoration: none; white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  /* Button-Standardstile zurücksetzen, damit <button> wie <a> aussieht */
  background: none; border: 0; cursor: pointer;
  font-family: inherit; -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
}
.ios-seg:active { transform: scale(.97); }
.ios-seg.active {
  background: #fff; color: var(--brand-dark);
  box-shadow: 0 2px 6px rgba(20,49,42,.12);
}
.seg-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 5px; margin-inline-start: .3rem; border-radius: 999px;
  background: #e5484d; color: #fff; font-size: .68rem; font-weight: 800;
}

/* Beitragsverfolgung: scrollbares Segment, Inline-Filter, Statistik, Bestätigen */
.ios-segment-scroll { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
.ios-segment-scroll .ios-seg { flex: 0 0 auto; padding-inline: .8rem; white-space: nowrap; }

.ios-inline-filter {
  display: flex; align-items: center; gap: .6rem;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm);
  padding: .55rem .8rem; margin-bottom: .7rem;
}
.ios-inline-label { flex: 0 0 auto; font-size: .82rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; }
.ios-inline-label i { color: var(--brand); }
.ios-inline-filter .form-control,
.ios-inline-filter .form-select {
  flex: 1 1 auto; border-radius: 10px; border: 1px solid #dce7e3;
  padding: .5rem .7rem; background: #f7fbfa; font-size: .9rem;
}
.ios-inline-filter .form-select:focus,
.ios-inline-filter .form-control:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(14,124,102,.15); background: #fff;
}

.ios-stats { display: flex; gap: .6rem; margin: .9rem 0 1.1rem; }
.ios-stat {
  flex: 1 1 0; text-align: center;
  background: #fff; border-radius: 15px; box-shadow: var(--shadow-sm);
  padding: .8rem .4rem;
}
.ios-stat-num { display: block; font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.ios-stat-lbl { display: block; font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.ios-stat.ok .ios-stat-num { color: #0a7a54; }
.ios-stat.warn .ios-stat-num { color: #c0362f; }
.ios-stat.info .ios-stat-num { color: #2563c9; }
.ios-stat.danger .ios-stat-num { color: #c0362f; }
.ios-quick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ios-quick a { text-decoration: none; }

/* App-Icon-Kacheln (Homescreen-Stil) */
.ios-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.ios-tile {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  text-decoration: none;
}
.ios-tile-ico {
  width: 62px; height: 62px; border-radius: 18px;
  display: grid; place-items: center; color: #fff; font-size: 1.6rem;
  box-shadow: 0 8px 18px rgba(0,0,0,.14);
  transition: transform .12s ease;
}
.ios-tile:active .ios-tile-ico { transform: scale(.93); }
.ios-tile-lbl { font-size: .74rem; font-weight: 700; color: var(--ink); text-align: center; }
.tile-teal  { background: linear-gradient(135deg, #14b8a1, #0e7c66); }
.tile-green { background: linear-gradient(135deg, #34c759, #1a9e42); }
.tile-blue  { background: linear-gradient(135deg, #4a90ff, #2563c9); }
.tile-gold  { background: linear-gradient(135deg, #f7c948, #e0a021); }

.ios-confirm-btn {
  flex: 0 0 auto; border: 0; border-radius: 11px;
  padding: .5rem .8rem; font-weight: 700; font-size: .82rem; cursor: pointer;
  color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand));
  display: inline-flex; align-items: center; gap: .3rem;
  box-shadow: 0 4px 12px rgba(14,124,102,.28);
}
.ios-confirm-btn:active { transform: scale(.95); }
.ios-confirm-inline { margin: 0; flex: 0 0 auto; }

/* Klickbarer Bereich der Beitragskarte (führt zur Zahlungshistorie) */
.ios-member-link {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: .85rem;
  text-decoration: none; color: inherit;
  border-radius: 12px; transition: background .15s ease;
}
.ios-member-link:active { background: #f1f7f5; }

/* Zahlungshistorie: Zurück-Link + Mitglied-Hero */
.ios-back {
  display: inline-flex; align-items: center; gap: .25rem;
  color: var(--brand); text-decoration: none; font-weight: 600;
  font-size: .95rem; margin-bottom: .9rem;
  padding: .35rem .8rem .35rem .5rem;
  background: var(--brand-light); border-radius: 999px;
  transition: background .15s ease, transform .12s ease;
}
.ios-back i { font-size: 1.05rem; }
.ios-back:hover { background: #d5ede6; }
.ios-back:active { transform: scale(.96); }
.ios-member-hero {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem 1rem; margin-bottom: 1.1rem;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm);
}
.ios-member-hero-info { flex: 1 1 auto; min-width: 0; }
.ios-member-hero-name { font-size: 1rem; font-weight: 800; color: var(--ink); }
.ios-member-hero-sub { font-size: .78rem; color: var(--muted); }
.ios-member-hero-total {
  flex: 0 0 auto; text-align: center; line-height: 1.15;
  background: var(--brand-light); color: var(--brand-dark);
  padding: .45rem .7rem; border-radius: 12px;
}
.ios-member-hero-total span { display: block; font-size: .66rem; opacity: .8; }
.ios-member-hero-total strong { font-size: .95rem; }
.ios-member-hero-total.due { background: #fde5e5; color: #c0362f; }

/* Bestätigungs-Modal (Sheet) */
.confirm-ico {
  width: 60px; height: 60px; margin: 0 auto .6rem; border-radius: 18px;
  display: grid; place-items: center; color: #fff; font-size: 1.7rem;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 8px 20px rgba(14,124,102,.3);
}
.confirm-text { text-align: center; color: var(--muted); font-size: .95rem; margin: 0 0 1.1rem; line-height: 1.5; }

.ios-member {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid #eef4f2; transition: background .15s ease;
}
.ios-member:last-child { border-bottom: 0; }
.ios-member:active { background: #f1f7f5; }
.ios-avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 1.1rem; background: var(--brand);
}
.ios-avatar.role-admin     { background: linear-gradient(135deg, #2b4a41, #14312a); }
.ios-avatar.role-committee { background: linear-gradient(135deg, #12a184, #0e7c66); }
.ios-avatar.role-member    { background: linear-gradient(135deg, #7fa89d, #5b7a72); }

/* Profil-Avatar im Header + Profil-Sheet */
.navbar-profile {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center;
}
.nav-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem;
  background: #fff; color: var(--brand-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.nav-avatar.role-admin,
.nav-avatar.role-committee,
.nav-avatar.role-member { background: #fff; color: var(--brand-dark); }
.profile-head {
  display: flex; align-items: center; gap: .8rem;
  padding: .2rem .2rem 1rem;
}
.profile-avatar {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 1.5rem; background: var(--brand);
}
.profile-avatar.role-admin     { background: linear-gradient(135deg, #2b4a41, #14312a); }
.profile-avatar.role-committee { background: linear-gradient(135deg, #12a184, #0e7c66); }
.profile-avatar.role-member    { background: linear-gradient(135deg, #7fa89d, #5b7a72); }
.profile-name { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.profile-role { font-size: .82rem; color: var(--muted); }
#profileSheet .ios-list { margin-bottom: 1rem; }

/* Avatar-Auswahl */
.avatar-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem;
}
.avatar-group-title { margin: 1rem 0 .5rem; font-size: .85rem; font-weight: 800; color: var(--brand-dark); }
.avatar-current-wrap { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.avatar-current {
  position: relative; width: 92px; height: 92px; border-radius: 50%;
  border: 0; background: none; padding: 0; cursor: pointer; overflow: visible;
}
.avatar-current img, .avatar-current .avatar-initial {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 6px 18px rgba(14,124,102,.28);
}
.avatar-current .avatar-initial { aspect-ratio: auto; font-size: 2.2rem; }
.avatar-current-edit {
  position: absolute; bottom: 0; inset-inline-start: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; display: grid; place-items: center; font-size: .85rem;
  border: 3px solid #fff;
}
.avatar-current-hint { font-size: .78rem; color: var(--muted); }
.avatar-save { margin-top: 1rem; }
#avatarSheet .avatar-grid { max-height: 46vh; overflow-y: auto; padding: .2rem; }
.avatar-choice {
  border: 2px solid transparent; background: #f5f9f7; border-radius: 16px;
  padding: .4rem; cursor: pointer; display: grid; place-items: center; gap: .2rem;
  transition: border-color .15s ease, transform .1s ease;
}
.avatar-choice img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 12px; display: block;
}
.avatar-choice.selected { border-color: var(--brand); background: var(--brand-light); }
.avatar-choice:active { transform: scale(.95); }
.avatar-choice.missing { display: none; }
.avatar-choice-lbl { font-size: .7rem; color: var(--muted); font-weight: 700; }
.avatar-initial {
  width: 100%; aspect-ratio: 1/1; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.4rem;
  background: var(--brand);
}
.avatar-initial.role-admin     { background: linear-gradient(135deg, #2b4a41, #14312a); }
.avatar-initial.role-committee { background: linear-gradient(135deg, #12a184, #0e7c66); }
.avatar-initial.role-member    { background: linear-gradient(135deg, #7fa89d, #5b7a72); }
.nav-avatar img, .profile-avatar img, .ios-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}

.ios-member-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.ios-member-top { display: flex; align-items: center; gap: .5rem; }
.ios-member-name { font-weight: 700; font-size: .98rem; }
.ios-member-meta {
  display: flex; flex-wrap: wrap; gap: .2rem .8rem;
  font-size: .8rem; color: var(--muted);
}
.ios-member-meta i { color: var(--brand); }
.ios-member-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .1rem; }
.ios-member-inviter { font-size: .74rem; color: var(--muted); }
.ios-member-arrow { flex: 0 0 auto; color: #c0d3cd; font-size: 1rem; }
.ios-badge i { font-size: .78em; }
.ios-phone { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* Broadcast-Avatar + Chat-Ungelesen-Badge */
.ios-avatar.broadcast { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); }
.ios-avatar.sm { width: 36px; height: 36px; font-size: .95rem; }
.ios-badge.chat-unread {
  background: var(--brand); color: #fff; min-width: 22px;
  padding: .2rem .5rem; text-align: center;
}

/* ==================================================================
   iOS-Style: Chat (Thread + Eingabe)
   ================================================================== */
body.chat-page main.container { padding: 0 !important; max-width: 640px; }
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 56px); }
@media (max-width: 991.98px) { .chat-wrap { height: calc(100dvh - 0px); } }

.chat-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1rem;
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid #e8f0ed;
}
.chat-back { color: var(--brand); font-size: 1.3rem; text-decoration: none; display: inline-flex; }
.chat-peer-name { font-weight: 800; font-size: 1.05rem; color: var(--ink); }

.chat-thread {
  flex: 1 1 auto; overflow-y: auto;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: .5rem;
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(18,161,132,.05), transparent),
    #f4f7f6;
}
.chat-msg { display: flex; flex-direction: column; max-width: 78%; }
.chat-msg.mine { align-self: flex-start; align-items: flex-start; }
.chat-msg.theirs { align-self: flex-end; align-items: flex-end; }
.chat-sender { font-size: .72rem; font-weight: 700; color: var(--brand-dark); margin-bottom: .1rem; }
.chat-bubble {
  padding: .6rem .85rem; border-radius: 18px;
  font-size: .95rem; line-height: 1.4; word-wrap: break-word;
}
.chat-msg.mine .chat-bubble {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; border-bottom-right-radius: 6px;
}
.chat-msg.theirs .chat-bubble {
  background: #fff; color: var(--ink);
  border: 1px solid #e6efec; border-bottom-left-radius: 6px;
}
.chat-time { font-size: .68rem; color: var(--muted); margin-top: .15rem; padding: 0 .3rem; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-empty i { font-size: 2.4rem; opacity: .5; }
.chat-empty p { margin: .6rem 0 0; }

.chat-compose {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem .8rem calc(.6rem + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid #e8f0ed;
}
.chat-input {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid #dce7e3; border-radius: 22px;
  padding: .7rem 1rem; font-size: .95rem; background: #f7fbfa;
}
.chat-input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(14,124,102,.15); background: #fff; }
.chat-send {
  flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; font-size: 1.1rem; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(14,124,102,.28);
}
.chat-send:active { transform: scale(.94); }
/* Auf Mobil die Eingabe über der Tab-Leiste halten */
@media (max-width: 991.98px) {
  body.chat-page .tabbar { display: none; }
}

/* ==================================================================
   iOS-Style: Benachrichtigungs-Banner (Toast)
   ================================================================== */
.ios-toasts {
  position: fixed;
  top: calc(.6rem + env(safe-area-inset-top));
  left: 0; right: 0;
  z-index: 2000;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 0 .8rem;
  pointer-events: none;
}
.ios-toast {
  pointer-events: auto;
  width: 100%; max-width: 440px;
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem .9rem;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(20, 49, 42, .08);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(20, 49, 42, .18);
  cursor: pointer;
  transform: translateY(-140%);
  opacity: 0;
  transition: transform .38s cubic-bezier(.32,.72,0,1), opacity .3s ease;
}
.ios-toast.show { transform: translateY(0); opacity: 1; }
.ios-toast.hide { transform: translateY(-140%); opacity: 0; }
.ios-toast-ico {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; color: #fff; font-size: 1.15rem;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 4px 10px rgba(14,124,102,.3);
}
.ios-toast-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; text-align: start; }
.ios-toast-title { font-weight: 800; font-size: .92rem; color: var(--ink); }
.ios-toast-msg {
  font-size: .84rem; color: var(--muted); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ios-toast-close {
  flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(20,49,42,.08); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; font-size: .7rem;
  align-self: flex-start;
  transition: background .15s ease, color .15s ease;
}
.ios-toast-close:hover { background: rgba(20,49,42,.16); color: var(--ink); }

/* iOS-Feinschliff für Flash-Meldungen (django messages) */
main.container > .alert {
  border: 0; border-radius: 14px;
  padding: .85rem 1rem;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
main.container > .alert-success { background: #e3f5ee; color: #0a7a54; }
main.container > .alert-info    { background: #e4f0ff; color: #2563c9; }
main.container > .alert-warning { background: #fff3d6; color: #9a6b00; }
main.container > .alert-danger  { background: #fde5e5; color: #c0362f; }

/* iOS-Flash-Meldung (Django messages, einheitlich auf allen Seiten) */
.ios-flash-wrap { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.1rem; }
.ios-flash-wrap:empty { margin-bottom: 0; }
.ios-flash {
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem 1rem;
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--bs-border-color);
  font-weight: 600; font-size: .92rem;
  animation: iosFlashIn .35s cubic-bezier(.32,.72,0,1) both;
}
.ios-flash.hide { animation: iosFlashOut .3s ease forwards; }
@keyframes iosFlashIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes iosFlashOut { to { opacity: 0; transform: translateY(-12px); } }
.ios-flash-ico {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-size: 1.05rem;
}
.ios-flash-text { flex: 1 1 auto; min-width: 0; color: var(--ink); }
.ios-flash-close {
  flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(20,49,42,.07); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; font-size: .7rem;
}
.ios-flash-close:hover { background: rgba(20,49,42,.14); color: var(--ink); }
/* Farben je Typ */
.ios-flash-success .ios-flash-ico { background: linear-gradient(135deg, #17b981, #0a7a54); }
.ios-flash-info .ios-flash-ico    { background: linear-gradient(135deg, #4a90ff, #2563c9); }
.ios-flash-warning .ios-flash-ico { background: linear-gradient(135deg, #f0b429, #c98f1e); }
.ios-flash-error .ios-flash-ico,
.ios-flash-danger .ios-flash-ico  { background: linear-gradient(135deg, #f2555a, #c0362f); }
.ios-flash-success { border-color: #bfe8d7; }
.ios-flash-error, .ios-flash-danger { border-color: #f6c9c9; }


