/* =========================================================================
   DJDesk - Apple-Design (Nick, 2026-09-30)

   Rein ADDITIVE Schicht: wird nur geladen, wenn die Einstellung
   "apple_design" an ist (Standard), und wirkt nur unter body.ui-apple.
   style.css bleibt komplett unangetastet - "zurueck zum alten Design" heisst
   also nur: Schalter aus (Einstellungen > Darstellung & Kontakt) oder der
   Notausgang-Link /design/klassisch.

   Aufbau: 1 Farb-/Radius-Token  2 Hintergrund  3 Kopfleiste + Seitenleiste
   (Desktop)  4 Inhalt (Kacheln, Buttons, Formulare, ...)  5 Login
   6 iPhone/Handy (Tab-Leiste, Bogen, Safe-Areas).
   Der oeffentliche Fragebogen (fragebogen_form.html) laedt weder base.html
   noch diese Datei und bleibt deshalb unveraendert.
   ========================================================================= */

/* ---------- 1  Tokens ---------------------------------------------------- */
html[data-theme] body.ui-apple {
  --bg: #18181d;
  --surface: #25252d;
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-hover: rgba(255, 255, 255, 0.11);
  --border: rgba(255, 255, 255, 0.11);
  --text: #f4f4f6;
  --muted: rgba(255, 255, 255, 0.60);
  --accent: #b39af5;
  --accent-strong: #9a7bf0;
  --accent-contrast: #1b1233;
  --danger: #ff8a84;
  --success: #34d058;
  --warn: #ffd60a;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.30);

  --a-bar: rgba(44, 44, 54, 0.58);
  --a-side: rgba(36, 36, 45, 0.50);
  --a-glass: rgba(255, 255, 255, 0.065);
  --a-glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --a-sep: rgba(255, 255, 255, 0.10);
  --a-sel: rgba(255, 255, 255, 0.11);
  --a-tint: rgba(179, 154, 245, 0.20);
  --a-field: rgba(255, 255, 255, 0.075);
  --a-pop: #2c2c36;
  --a-sheet: rgba(40, 40, 50, 0.88);
  --a-btn: linear-gradient(180deg, #c2adfa, #a488f3);
  --a-btn-glow: 0 8px 20px rgba(150, 112, 255, 0.30);
  --a-hero: linear-gradient(150deg, rgba(150, 112, 255, 0.36), rgba(110, 120, 255, 0.14));
  color-scheme: dark;
}
html[data-theme="light"] body.ui-apple {
  --bg: #f3f2f7;
  --surface: #ffffff;
  --surface-2: rgba(118, 100, 190, 0.08);
  --surface-hover: rgba(118, 100, 190, 0.13);
  --border: rgba(60, 50, 110, 0.12);
  --text: #1c1b22;
  --muted: rgba(28, 27, 34, 0.58);
  --accent: #7a58e3;
  --accent-strong: #6a46d4;
  --accent-contrast: #ffffff;
  --danger: #d6342c;
  --success: #1f8a3b;
  --warn: #a15c00;
  --shadow: 0 6px 22px rgba(60, 40, 130, 0.10);

  --a-bar: rgba(255, 255, 255, 0.66);
  --a-side: rgba(244, 243, 250, 0.62);
  --a-glass: rgba(255, 255, 255, 0.78);
  --a-glass-edge: 0 1px 2px rgba(40, 30, 90, 0.06);
  --a-sep: rgba(60, 50, 110, 0.11);
  --a-sel: rgba(122, 88, 227, 0.12);
  --a-tint: rgba(122, 88, 227, 0.13);
  --a-field: rgba(60, 50, 110, 0.06);
  --a-pop: #ffffff;
  --a-sheet: rgba(250, 249, 253, 0.90);
  --a-btn: linear-gradient(180deg, #8d6cec, #7048dc);
  --a-btn-glow: 0 8px 20px rgba(112, 72, 220, 0.28);
  --a-hero: linear-gradient(150deg, rgba(122, 88, 227, 0.18), rgba(96, 120, 255, 0.07));
  color-scheme: light;
}

/* ---------- 2  Hintergrund ---------------------------------------------- */
html:has(body.ui-apple) { background: #18181d; }
html[data-theme="light"]:has(body.ui-apple) { background: #f3f2f7; }

html[data-theme] body.ui-apple:not(.auth-bg) {
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.ui-apple:not(.auth-bg)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 12% -6%, rgba(150, 112, 255, 0.30), transparent 62%),
    radial-gradient(700px 520px at 100% 35%, rgba(96, 120, 255, 0.14), transparent 60%),
    radial-gradient(600px 500px at 0% 100%, rgba(150, 112, 255, 0.14), transparent 65%);
}
html[data-theme="light"] body.ui-apple:not(.auth-bg)::before {
  background:
    radial-gradient(760px 420px at 12% -6%, rgba(150, 112, 255, 0.20), transparent 62%),
    radial-gradient(700px 520px at 100% 35%, rgba(96, 120, 255, 0.10), transparent 60%),
    radial-gradient(600px 500px at 0% 100%, rgba(150, 112, 255, 0.10), transparent 65%);
}
/* Die Wegbereiter-Regel von style.css fuer das helle Theme (einfarbig) */
html[data-theme="light"] body.ui-apple:not(.auth-bg) { background: transparent; }

body.ui-apple ::selection { background: var(--a-tint); }
body.ui-apple a { color: var(--accent); }
body.ui-apple h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.022em; }
body.ui-apple h2 { letter-spacing: 0.05em; font-size: 0.78rem; font-weight: 600; }

/* ---------- 3  Kopfleiste (alle Breiten) -------------------------------- */
.apple-topbar,
.apple-tabbar,
.apple-sheet,
.apple-sheet-backdrop { display: none; }

body.ui-apple .apple-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 18px 0 22px;
  background: var(--a-bar);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  backdrop-filter: blur(30px) saturate(1.8);
  border-bottom: 1px solid var(--a-sep);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
}
body.ui-apple .apple-topbar-brand { display: flex; align-items: center; flex: 0 0 auto; }
body.ui-apple .apple-topbar-brand img { height: 26px; width: auto; }
body.ui-apple .apple-topbar-spacer { flex: 1 1 auto; }
body.ui-apple .apple-topbar-date { font-size: 0.82rem; color: var(--muted); white-space: nowrap; margin-right: 6px; }

body.ui-apple .apple-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  width: 230px;
  padding: 0 14px;
  margin: 0;
  border-radius: 999px;
  background: var(--a-field);
  color: var(--muted);
  border: 1px solid transparent;
}
body.ui-apple .apple-search:focus-within { border-color: var(--accent); background: var(--a-tint); }
body.ui-apple .apple-search svg { flex: 0 0 auto; }
body.ui-apple .apple-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
body.ui-apple .apple-search input:focus { outline: none; }
body.ui-apple .apple-search input::placeholder { color: var(--muted); }
body.ui-apple .apple-search input::-webkit-search-cancel-button { display: none; }

body.ui-apple .apple-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--a-field);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
body.ui-apple .apple-icon-btn:hover { background: var(--a-sel); }
body.ui-apple .apple-icon-btn .icon { margin: 0; }
body.ui-apple .apple-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--a-btn);
  color: var(--accent-contrast);
  font-weight: 700; font-size: 0.95rem;
  text-decoration: none;
  box-shadow: var(--a-btn-glow);
}
body.ui-apple .apple-avatar:hover { text-decoration: none; filter: brightness(1.05); }

/* Sonne/Mond: im dunklen Theme Sonne (-> hell), im hellen Mond (-> dunkel) */
html[data-theme="light"] .apple-theme-sun { display: none; }
html:not([data-theme="light"]) .apple-theme-moon { display: none; }
.apple-theme-sun, .apple-theme-moon { display: inline-flex; }

/* ---------- 3b  Desktop: Seitenleiste unter der Kopfleiste --------------- */
@media (min-width: 900px) {
  body.ui-apple .app-shell { min-height: 100vh; }
  body.ui-apple .app-shell > header.sidebar {
    top: 58px; left: 0; bottom: 0;
    border: 0;
    border-right: 1px solid var(--a-sep);
    border-radius: 0;
    box-shadow: none;
    background: var(--a-side);
    -webkit-backdrop-filter: blur(34px) saturate(1.7);
    backdrop-filter: blur(34px) saturate(1.7);
    z-index: 30;
  }
  /* Breite: nur ohne "automatisch einklappen" fest 232px - mit Einklappen
     gelten weiter die 68px/232px-Regeln aus style.css (sonst lag die breite
     Leiste ueber dem Inhalt). */
  body.ui-apple .app-shell > header.sidebar:not(.sidebar-auto-collapse) { width: 232px; }
  body.ui-apple .app-shell > header.sidebar .sidebar-brand { display: none; }
  body.ui-apple .sidebar-inner { padding: 16px 12px 14px; gap: 4px; }
  /* Einklappbare Seitenleiste darf das Einstellungs-Menue nach rechts heraus
     zeigen (sonst wird es an der Leistenkante abgeschnitten). */
  body.ui-apple .app-shell > header.sidebar.sidebar-auto-collapse,
  body.ui-apple .app-shell > header.sidebar.sidebar-auto-collapse:hover,
  body.ui-apple .app-shell > header.sidebar.sidebar-auto-collapse:focus-within { overflow: visible; }

  body.ui-apple .main-col,
  body.ui-apple .app-footer { margin-left: 232px; }
  body.ui-apple .main-col { padding-top: 58px; }
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse) ~ .app-footer,
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse) .main-col { margin-left: 68px; }
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse:hover) ~ .app-footer,
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse:focus-within) ~ .app-footer,
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse:hover) .main-col,
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse:focus-within) .main-col { margin-left: 232px; }

  body.ui-apple .sidebar-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: 999px;
    border: 0;
    background: var(--a-btn);
    color: var(--accent-contrast);
    font-weight: 650;
    font-size: 0.92rem;
    box-shadow: var(--a-btn-glow);
  }
  body.ui-apple .sidebar-new-btn:hover { text-decoration: none; filter: brightness(1.05); }
  body.ui-apple .sidebar-new-btn-icon { font-size: 1.15rem; font-weight: 500; }
  body.ui-apple .sidebar.sidebar-auto-collapse .sidebar-new-btn { width: 42px; height: 42px; padding: 0; }
  body.ui-apple .sidebar.sidebar-auto-collapse:hover .sidebar-new-btn,
  body.ui-apple .sidebar.sidebar-auto-collapse:focus-within .sidebar-new-btn { width: 100%; height: 42px; padding: 0 14px; }

  body.ui-apple .sidebar-link {
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 500;
  }
  body.ui-apple .sidebar-link .icon { color: var(--muted); margin-right: 0; }
  body.ui-apple .sidebar-link:hover { background: var(--a-field); }
  body.ui-apple .sidebar-link.active {
    background: var(--a-sel);
    color: var(--text);
    font-weight: 650;
  }
  body.ui-apple .sidebar-link.active .icon { color: var(--accent); }
  body.ui-apple .sidebar-bottom { border-top: 1px solid var(--a-sep); padding-top: 12px; }
  /* Theme-Schalter sitzt jetzt in der Kopfleiste */
  body.ui-apple .sidebar .theme-toggle { display: none; }
  /* Einstellungs-Menue oeffnet nach OBEN (am unteren Rand verankert), sonst
     ragt es unten aus dem Fenster heraus und wird abgeschnitten. */
  body.ui-apple .sidebar .nav-dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    color: var(--text);
  }
  body.ui-apple .sidebar .nav-dropdown-menu a .icon { color: var(--accent); margin: 0; }
  body.ui-apple .sidebar .nav-dropdown-menu a:hover { background: var(--a-sel); text-decoration: none; }
  body.ui-apple .sidebar .nav-dropdown-menu {
    top: auto; bottom: 0;
    margin-left: 10px;
    z-index: 60;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  body.ui-apple .container { max-width: 1040px; padding: 30px 32px 64px; }
}

/* Dropdown / Popover */
body.ui-apple .nav-dropdown-menu,
body.ui-apple .hero-menu-panel {
  background: var(--a-pop);
  border: 1px solid var(--a-sep);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  padding: 6px;
}
body.ui-apple .nav-dropdown-menu a,
body.ui-apple .hero-menu-item { border-radius: 12px; }

/* ---------- 4  Inhalt ---------------------------------------------------- */
/* Glas-Kacheln */
body.ui-apple .stat-card,
body.ui-apple .detail-card,
body.ui-apple .inquiry-card,
body.ui-apple .collapsible-card,
body.ui-apple .form-card,
body.ui-apple fieldset,
body.ui-apple .toolbox-card,
body.ui-apple .calendar-card,
body.ui-apple .login-card {
  background: var(--a-glass);
  border: 1px solid var(--a-sep);
  border-radius: 22px;
  box-shadow: var(--a-glass-edge);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
}
body.ui-apple .stat-card::before { display: none; }
/* Formulare: Wrapper (form.form-card) bleibt unsichtbar, die einzelnen
   Gruppen (fieldset) sind die Glas-Karten - sonst doppelter Rahmen. */
body.ui-apple form.form-card {
  background: transparent; border: 0; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.ui-apple fieldset { padding: 18px 20px 20px; }
body.ui-apple fieldset > legend {
  float: left; width: 100%; padding: 0 0 12px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
}
body.ui-apple fieldset > legend + * { clear: both; }
body.ui-apple .inquiry-card { border-radius: 20px; }
body.ui-apple .inquiry-card:hover { border-color: var(--accent); transform: none; background: var(--a-sel); }
body.ui-apple .detail-card { padding: 20px; }
body.ui-apple .dashboard-col-calendar .detail-card { background: var(--a-glass); }
body.ui-apple .collapsible-card-toggle { border-radius: 22px; }
body.ui-apple .collapsible-card-toggle:hover { background: var(--a-field); }
body.ui-apple .calendar-cell { border-radius: 10px; background: var(--a-field); border-color: transparent; }
body.ui-apple .calendar-cell-today { border-color: var(--accent); }

body.ui-apple .stats-row { gap: 14px; }
body.ui-apple .stat-card { padding: 18px 20px; }
body.ui-apple .stat-card-hoverable {
  order: -1;
  grid-column: 1 / -1;
  background: var(--a-hero);
  padding: 22px 26px 24px;
}
body.ui-apple .stat-card-hoverable .stat-value {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: initial;
  color: var(--text);
  font-size: 2.2rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
@media (min-width: 640px) {
  body.ui-apple .stats-row { grid-template-columns: repeat(3, 1fr); }
}
body.ui-apple .dashboard-greeting-text { font-size: 1.85rem; font-weight: 750; letter-spacing: -0.022em; }
body.ui-apple .stat-value { font-weight: 700; letter-spacing: -0.02em; }
body.ui-apple .stat-label { color: var(--muted); }
body.ui-apple a.stat-card-link,
body.ui-apple a.stat-card-link:hover { text-decoration: none; color: var(--text); }
body.ui-apple a.stat-card-link .stat-value { color: var(--accent); }
body.ui-apple a.stat-card-link:hover { background: var(--a-sel); }

/* Buttons */
body.ui-apple .btn {
  border-radius: 999px;
  padding: 10px 20px;
  border: 1px solid var(--a-sep);
  background: var(--a-field);
  color: var(--text);
  font-weight: 550;
}
body.ui-apple .btn:hover { background: var(--a-sel); }
body.ui-apple .btn-small { padding: 7px 15px; }
body.ui-apple .btn-accent,
body.ui-apple .btn-hero-primary {
  background: var(--a-btn);
  border: 0;
  color: var(--accent-contrast);
  font-weight: 650;
  box-shadow: var(--a-btn-glow);
}
body.ui-apple .btn-accent:hover,
body.ui-apple .btn-hero-primary:hover { background: var(--a-btn); filter: brightness(1.06); }
body.ui-apple .btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); box-shadow: none; }
body.ui-apple .btn-hero { border-radius: 999px; padding: 10px 18px; }
body.ui-apple .btn-hero-secondary { background: var(--a-field); border-color: var(--a-sep); }
body.ui-apple .btn-hero-icon { border-radius: 50%; background: var(--a-field); border-color: transparent; }
body.ui-apple .inquiry-hero-avatar { border-radius: 20px; background: var(--a-btn); color: var(--accent-contrast); box-shadow: var(--a-btn-glow); }
body.ui-apple .inquiry-hero-title { font-size: 1.7rem; letter-spacing: -0.02em; }

/* Formulare */
body.ui-apple input,
body.ui-apple select,
body.ui-apple textarea {
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--a-field);
  color: var(--text);
  padding: 11px 14px;
}
body.ui-apple input:focus,
body.ui-apple select:focus,
body.ui-apple textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--a-tint);
}
body.ui-apple input[type="checkbox"],
body.ui-apple input[type="radio"] { accent-color: var(--accent); }
body.ui-apple label { color: var(--muted); font-weight: 500; }
body.ui-apple legend { color: var(--muted); }
body.ui-apple .filter-bar input[type="search"] { border-radius: 999px; }

/* Reiter in den Einstellungen */
body.ui-apple .settings-tabnav { border-bottom: 0; padding-bottom: 8px; }
body.ui-apple .settings-tab-btn {
  border-radius: 999px;
  border: 0;
  background: var(--a-field);
  padding: 9px 16px;
  font-weight: 550;
}
body.ui-apple .settings-tab-btn:hover { background: var(--a-sel); }
body.ui-apple .settings-tab-btn.active { background: var(--a-btn); color: var(--accent-contrast); box-shadow: var(--a-btn-glow); }

/* Hinweise, Dialoge */
body.ui-apple .flash { border-radius: 16px; padding: 12px 16px; border: 1px solid var(--a-sep); }
body.ui-apple .confirm-dialog,
body.ui-apple .stats-dialog {
  background: var(--a-pop);
  border: 1px solid var(--a-sep);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
body.ui-apple dialog::backdrop { background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.ui-apple .badge,
body.ui-apple .tag,
body.ui-apple .status-pill,
body.ui-apple .hero-chip { border-radius: 999px; }
body.ui-apple .app-footer { color: var(--muted); }
body.ui-apple .theme-toggle { background: var(--a-field); border-color: transparent; }

/* ---------- 5  Login ----------------------------------------------------- */
body.ui-apple.auth-bg::before { display: none; }
body.ui-apple.auth-bg .login-wrap { padding-top: 10vh; }
body.ui-apple.auth-bg .login-card {
  max-width: 400px;
  padding: 38px 34px 30px;
  border-radius: 30px;
  background: rgba(40, 40, 52, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(34px) saturate(1.8);
  backdrop-filter: blur(34px) saturate(1.8);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
html[data-theme="light"] body.ui-apple.auth-bg .login-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.7);
}
body.ui-apple .login-card .login-brand { display: flex; justify-content: center; margin: 0 0 6px; }
body.ui-apple .login-card .login-brand img { height: 36px; width: auto; }
body.ui-apple .login-card > p { margin-top: 4px; margin-bottom: 18px; }
body.ui-apple .login-card .btn-accent { height: 46px; font-size: 1rem; margin-top: 10px; }
body.ui-apple.auth-bg .app-footer { color: rgba(255, 255, 255, 0.55); }

/* ---------- 6  iPhone / Handy ------------------------------------------- */
@media (max-width: 899.98px) {
  /* Alte, umbrechende Reiter-Leiste weg - Tab-Leiste unten uebernimmt */
  body.ui-apple .app-shell > header.sidebar { display: none; }

  body.ui-apple .apple-topbar {
    position: sticky;
    top: 0;
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 16px 0 18px;
    gap: 10px;
    flex-shrink: 0;
  }
  body.ui-apple .apple-topbar-brand img { height: 24px; }
  body.ui-apple .apple-topbar .apple-search,
  body.ui-apple .apple-topbar-date { display: none; }

  body.ui-apple .container { padding: 14px 16px calc(104px + env(safe-area-inset-bottom, 0px)); }
  body.ui-apple .app-footer { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  body.ui-apple.auth-bg .app-footer { padding-bottom: 28px; }
  body.ui-apple h1 { font-size: 1.55rem; }
  body.ui-apple .inquiry-hero-title { font-size: 1.4rem; }
  body.ui-apple .dashboard-greeting-text { font-size: 1.5rem; }
  body.ui-apple .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  body.ui-apple .stat-card { padding: 16px; }
  body.ui-apple .stats-row > .stat-card-link:nth-child(3) {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
  }
  body.ui-apple .stats-row > .stat-card-link:nth-child(3) .stat-card-icon { margin: 0; }
  body.ui-apple .stats-row > .stat-card-link:nth-child(3) .stat-label { margin-left: 2px; }
  body.ui-apple .stat-card-hoverable { padding: 18px 20px 20px; }
  body.ui-apple .stat-card-hoverable .stat-value { font-size: 1.9rem; }

  /* Fingerfreundliche Flaechen */
  body.ui-apple .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  body.ui-apple .btn-small { min-height: 38px; }
  body.ui-apple .btn-block { display: flex; }
  body.ui-apple input:not([type="checkbox"]):not([type="radio"]),
  body.ui-apple select { min-height: 46px; font-size: 16px; }
  body.ui-apple textarea { font-size: 16px; }
  body.ui-apple .grid-2,
  body.ui-apple .grid-3 { grid-template-columns: 1fr; }
  body.ui-apple .detail-card { padding: 18px; }
  body.ui-apple .inquiry-card { padding: 14px 16px; }

  /* Tab-Leiste */
  body.ui-apple .apple-tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--a-bar);
    -webkit-backdrop-filter: blur(30px) saturate(1.8);
    backdrop-filter: blur(30px) saturate(1.8);
    border-top: 1px solid var(--a-sep);
  }
  body.ui-apple .apple-tab {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px 4px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.66rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  body.ui-apple .apple-tab .icon { margin: 0; }
  body.ui-apple .apple-tab .icon + span,
  body.ui-apple .apple-sheet-row .icon + span { margin-left: 0; }
  body.ui-apple .apple-tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.ui-apple .apple-tab:hover { text-decoration: none; }
  body.ui-apple .apple-tab.active { color: var(--accent); background: var(--a-sel); }
  body.ui-apple .apple-tab-dot {
    position: absolute;
    top: 6px; left: calc(50% + 8px);
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
  }

  /* "Mehr"-Bogen */
  body.ui-apple .apple-sheet-backdrop {
    display: block;
    position: fixed; inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  body.ui-apple .apple-sheet-backdrop[hidden],
  body.ui-apple .apple-sheet[hidden] { display: none; }
  body.ui-apple .apple-sheet-backdrop.open { opacity: 1; }
  body.ui-apple .apple-sheet {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 70;
    max-height: 86vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 28px 28px 0 0;
    background: var(--a-sheet);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    backdrop-filter: blur(40px) saturate(1.8);
    border-top: 1px solid var(--a-sep);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
  body.ui-apple .apple-sheet.open { transform: translateY(0); }
  body.ui-apple .apple-sheet-grab {
    width: 38px; height: 5px;
    border-radius: 3px;
    margin: 0 auto 14px;
    background: var(--a-sep);
  }
  body.ui-apple .apple-search-sheet { width: 100%; height: 44px; margin-bottom: 12px; display: flex; }
  body.ui-apple .apple-sheet-cta {
    display: flex; align-items: center; justify-content: center;
    height: 48px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: var(--a-btn);
    color: var(--accent-contrast);
    font-weight: 650;
    text-decoration: none;
    box-shadow: var(--a-btn-glow);
  }
  body.ui-apple .apple-sheet-cta:hover { text-decoration: none; }
  body.ui-apple .apple-sheet-group {
    background: var(--a-glass);
    border: 1px solid var(--a-sep);
    border-radius: 20px;
    margin-bottom: 14px;
    overflow: hidden;
  }
  body.ui-apple .apple-sheet-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 0;
    border-bottom: 1px solid var(--a-sep);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  body.ui-apple .apple-sheet-row:last-child { border-bottom: 0; }
  body.ui-apple .apple-sheet-row:active { background: var(--a-sel); }
  body.ui-apple .apple-sheet-row:hover { text-decoration: none; }
  body.ui-apple .apple-sheet-row .icon { margin: 0; color: var(--accent); }
  body.ui-apple .apple-sheet-row.active { font-weight: 650; }
  body.ui-apple .apple-sheet-row em {
    margin-left: auto;
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 24px;
    padding: 2px 8px;
    text-align: center;
    border-radius: 999px;
    background: var(--a-tint);
    color: var(--accent);
  }
  body.ui-apple .apple-sheet-danger,
  body.ui-apple .apple-sheet-danger .icon { color: var(--danger); }
  html.apple-sheet-open body { overflow: hidden; }
}

/* Auftrag-Detail: die Hero-Akzente folgen dem Apple-Akzent */
html[data-theme] body.ui-apple .hero-scope {
  --hero-amber: var(--accent);
  --hero-amber-2: var(--accent-strong);
  --hero-amber-contrast: var(--accent-contrast);
}

/* Anker-Spruenge (z.B. /settings#grp-...) sollen nicht unter der Kopfleiste landen */
html:has(body.ui-apple),
body.ui-apple { scroll-padding-top: 76px; }
@media (min-width: 900px) {
  body.ui-apple.auth-bg .app-footer { margin-left: 0; }
  body.ui-apple.auth-bg .main-col { margin-left: 0; padding-top: 0; }
}

/* Hinweise (Dashboard): Name oben, Datum/Info darunter, x rechts - statt
   Name in schmaler Spalte neben dem Datum (brach sonst Wort fuer Wort um). */
body.ui-apple .toolbox-card { padding: 20px; }
body.ui-apple .toolbox-title { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
body.ui-apple .toolbox-section-title { font-size: 0.74rem; letter-spacing: 0.05em; margin-bottom: 8px; }
body.ui-apple .toolbox-list { gap: 8px; }
body.ui-apple .toolbox-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
  row-gap: 2px;
  padding: 12px 10px 12px 16px;
  border-radius: 16px;
  background: var(--a-field);
}
body.ui-apple .toolbox-list li > a {
  grid-column: 1; grid-row: 1;
  color: var(--accent);
  font-weight: 600;
  overflow-wrap: anywhere;
}
body.ui-apple .toolbox-item-right { display: contents; }
body.ui-apple .toolbox-item-right > :not(.toolbox-dismiss-btn) { grid-column: 1; }
body.ui-apple .toolbox-item-right > form { margin-top: 6px; }
body.ui-apple .toolbox-item-right .muted.small { font-size: 0.8rem; }
body.ui-apple .toolbox-dismiss-btn {
  grid-column: 2; grid-row: 1;
  align-self: start;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border-radius: 50%;
}

/* "Neue Anfrage"-Button: Inhalt exakt mittig, unabhaengig vom Browser
   (Safari setzte Zeilenhoehen/Abstand der beiden Teile leicht anders). */
@media (min-width: 900px) {
  body.ui-apple .sidebar-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;
  }
  body.ui-apple .sidebar-new-btn .sidebar-new-btn-icon {
    display: block;
    line-height: 1;
    margin: 0 8px 0 0;
    font-size: 1.2rem;
    transform: translateY(0.5px);
  }
  body.ui-apple .sidebar-new-btn .sidebar-link-label {
    display: block;
    line-height: 1.3;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  /* eingeklappt: nur das Plus, ohne Abstand */
  body.ui-apple .sidebar.sidebar-auto-collapse:not(:hover):not(:focus-within) .sidebar-new-btn .sidebar-new-btn-icon { margin-right: 0; }
}

/* Einstellungen-Flyout in der Seitenleiste: oeffnet nach oben (Einstellungen
   sitzen ganz unten - sonst wird das Menue am Fensterrand abgeschnitten),
   Icon + Text mit sauberem Abstand. */
@media (min-width: 900px) {
  body.ui-apple .sidebar .nav-dropdown-menu {
    top: auto;
    bottom: -6px;
    min-width: 250px;
    padding: 8px;
    gap: 2px;
  }
  body.ui-apple .sidebar .nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 500;
  }
  body.ui-apple .sidebar .nav-dropdown-menu a .icon { margin: 0; color: var(--accent); }
  body.ui-apple .sidebar .nav-dropdown-menu a:hover,
  body.ui-apple .sidebar .nav-dropdown-menu a:focus { background: var(--a-sel); text-decoration: none; }
}

/* Suchfeld: kein eigener Kasten/Schatten um das Textfeld beim Tippen - der
   Fokus-Ring sitzt nur an der Pille aussen herum. */
html[data-theme] body.ui-apple .apple-search input,
html[data-theme] body.ui-apple .apple-search input:focus,
html[data-theme] body.ui-apple .apple-search input:focus-visible {
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  min-height: 0;
}
body.ui-apple .apple-search input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px transparent inset;
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s;
}
body.ui-apple .apple-search input::-webkit-search-decoration { -webkit-appearance: none; }
body.ui-apple .apple-search:focus-within { box-shadow: 0 0 0 3px var(--a-tint); }

/* Live-Suche: Trefferliste unter dem Suchfeld */
body.ui-apple .apple-search { position: relative; }
body.ui-apple .apple-search-results {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 400px;
  max-width: calc(100vw - 24px);
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 8px;
  background: var(--a-pop);
  border: 1px solid var(--a-sep);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.40);
  z-index: 80;
  cursor: default;
}
body.ui-apple .apple-search-results[hidden] { display: none; }
body.ui-apple .apple-search-group {
  padding: 10px 12px 4px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
body.ui-apple .apple-search-hit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 2px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
body.ui-apple .apple-search-hit:hover,
body.ui-apple .apple-search-hit.active { background: var(--a-sel); text-decoration: none; }
body.ui-apple .apple-search-hit-title {
  grid-column: 1;
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.ui-apple .apple-search-hit-status {
  grid-column: 2; grid-row: 1;
  align-self: center;
  font-size: 0.7rem;
  font-weight: 650;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--a-tint);
  color: var(--accent);
  white-space: nowrap;
}
body.ui-apple .apple-search-hit-meta {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.ui-apple .apple-search-all {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--a-sep);
  border-radius: 0 0 12px 12px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
body.ui-apple .apple-search-all:hover { background: var(--a-sel); }
/* Im "Mehr"-Bogen (Handy): Liste direkt unter dem Feld statt schwebend */
@media (max-width: 899.98px) {
  body.ui-apple .apple-search-sheet { flex-wrap: wrap; height: auto; min-height: 44px; }
  body.ui-apple .apple-search-sheet input { height: 44px; }
  body.ui-apple .apple-search-sheet .apple-search-results {
    position: static;
    flex: 1 0 100%;
    width: auto;
    max-width: none;
    max-height: none;
    margin: 4px -14px 8px;
    box-shadow: none;
    border-radius: 18px;
  }
  body.ui-apple .apple-search-sheet.has-results { border-radius: 22px; padding-bottom: 0; }
}
@media (max-width: 899.98px) {
  html[data-theme] body.ui-apple .apple-search-sheet input { flex: 1 1 0; width: auto; }
  body.ui-apple .apple-search-sheet .apple-search-results { margin: 2px -14px 0; }
}

/* Du/Sie-Schalter im Apple-Look: iOS-Segmented-Control */
body.ui-apple .anrede-seg { background: var(--a-field); border-color: transparent; padding: 3px; }
body.ui-apple .anrede-seg button { padding: 6px 18px; color: var(--muted); }
body.ui-apple .anrede-seg button[aria-pressed="true"] {
  background: var(--a-btn);
  color: var(--accent-contrast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
@media (max-width: 899.98px) {
  body.ui-apple .anrede-seg button { min-height: 36px; padding: 6px 22px; }
}

/* "Per WhatsApp"-Knopf: nach dem Teilen gruen */
body.ui-apple .wa-share-btn.is-sent { color: var(--success); border-color: var(--success); }

/* Dashboard-Kennzahlen (Nick, 2026-09-30): kompakter - auf breiten
   Bildschirmen Honorar-Kachel links, die drei Kennzahlen direkt daneben in
   einer Reihe (statt grosser Kachel ueber die volle Breite + Reihe darunter).
   Kleine Kacheln im Widget-Stil: Symbol oben, Zahl + Beschriftung unten. */
@media (min-width: 1100px) {
  body.ui-apple .stats-row {
    grid-template-columns: minmax(0, 1.55fr) repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
  }
  body.ui-apple .stat-card-hoverable {
    grid-column: auto;
    padding: 18px 22px 18px;
  }
  body.ui-apple .stat-card-hoverable .stat-card-icon { margin-bottom: 6px; }
  body.ui-apple .stat-card-hoverable .stat-value { font-size: 2rem; }
  body.ui-apple .stat-card-hoverable .stat-card-secondary { margin-top: 10px; padding-top: 10px; }
  body.ui-apple .stats-row > .stat-card-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 18px 16px;
    min-height: 0;
  }
  body.ui-apple .stats-row > .stat-card-link .stat-card-icon { margin-bottom: 0; }
  body.ui-apple .stats-row > .stat-card-link .stat-value { font-size: 1.9rem; line-height: 1.1; margin-top: auto; }
  body.ui-apple .stats-row > .stat-card-link .stat-label { font-size: 0.8rem; }
}
/* Mittlere Breiten (iPad, kleines Fenster): Honorar links, die drei
   Kennzahlen rechts daneben untereinander als flache Zeilen. */
@media (min-width: 640px) and (max-width: 1099.98px) {
  body.ui-apple .stats-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 12px;
  }
  body.ui-apple .stat-card-hoverable { grid-column: 1; grid-row: 1 / span 3; padding: 20px 22px; }
  body.ui-apple .stat-card-hoverable .stat-value { font-size: 2rem; }
  body.ui-apple .stats-row > .stat-card-link {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }
  body.ui-apple .stats-row > .stat-card-link .stat-card-icon { margin: 0; }
  body.ui-apple .stats-row > .stat-card-link .stat-value { font-size: 1.4rem; }
  body.ui-apple .stats-row > .stat-card-link .stat-label { margin: 0; }
  body.ui-apple .stats-row > .stat-card-link:nth-child(3) { grid-column: 2; padding: 12px 16px; }
  body.ui-apple .stats-row > .stat-card-link:nth-child(3) .stat-label { margin-left: 0; }
}
/* Handy: Honorar oben (flacher), darunter die drei Kennzahlen als kleine
   Kacheln in EINER Reihe. */
@media (max-width: 639.98px) {
  body.ui-apple .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  body.ui-apple .stat-card-hoverable { grid-column: 1 / -1; padding: 16px 18px; }
  body.ui-apple .stat-card-hoverable .stat-card-icon { margin-bottom: 4px; }
  body.ui-apple .stat-card-hoverable .stat-value { font-size: 1.8rem; }
  body.ui-apple .stat-card-hoverable .stat-card-secondary { margin-top: 10px; padding-top: 10px; }
  body.ui-apple .stats-row > .stat-card-link,
  body.ui-apple .stats-row > .stat-card-link:nth-child(3) {
    grid-column: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 12px 12px;
    border-radius: 18px;
  }
  body.ui-apple .stats-row > .stat-card-link .stat-card-icon { margin: 0 0 6px; }
  body.ui-apple .stats-row > .stat-card-link .stat-value { font-size: 1.5rem; line-height: 1.1; }
  body.ui-apple .stats-row > .stat-card-link .stat-label,
  body.ui-apple .stats-row > .stat-card-link:nth-child(3) .stat-label { font-size: 0.72rem; line-height: 1.25; margin: 0; }
}
@media (max-width: 639.98px) {
  body.ui-apple .stats-row > .stat-card-link:nth-child(3) .stat-card-icon { margin: 0 0 6px; }
}
body.ui-apple a.stat-card-link:hover { transform: none; }

/* Login-Hinweisfenster im Apple-Look */
body.ui-apple .login-hints-dialog {
  background: var(--a-pop);
  border-color: var(--a-sep);
  border-radius: 28px;
  padding: 24px 22px 20px;
}
body.ui-apple .login-hints-icon { background: var(--a-btn); border-radius: 14px; box-shadow: var(--a-btn-glow); }
body.ui-apple .login-hint { background: var(--a-field); border-radius: 16px; }
body.ui-apple .login-hint:hover { background: var(--a-sel); }
body.ui-apple .login-hints-head h2 {
  font-size: 1.2rem; font-weight: 700; letter-spacing: -0.015em;
  text-transform: none; color: var(--text); margin: 0;
}

/* =========================================================================
   Liquid Glass (Nick, 2026-09-30): mehr Apple-Glas - schwebende Kopf-/
   Seiten-/Tab-Leiste, Glas-Kacheln mit Lichtkante, Glas-Knoepfe,
   kraeftigere Hintergrund-Lichtflecken. Rein zusaetzliche Regeln; zum
   Zuruecknehmen diesen Block entfernen (Backup: apple.css.bak_*_pre_glass).
   ========================================================================= */

html[data-theme] body.ui-apple {
  --lg-fill: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035) 55%, rgba(255, 255, 255, 0.06));
  --lg-fill-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06) 55%, rgba(255, 255, 255, 0.09));
  --lg-rim: linear-gradient(150deg, rgba(255, 255, 255, 0.60), rgba(255, 255, 255, 0.10) 32%, rgba(255, 255, 255, 0.02) 60%, rgba(255, 255, 255, 0.22));
  --lg-shadow: 0 18px 50px rgba(0, 0, 0, 0.38), 0 2px 6px rgba(0, 0, 0, 0.22);
  --lg-inner: inset 0 1px 0 rgba(255, 255, 255, 0.30), inset 0 -1px 1px rgba(255, 255, 255, 0.06);
  --lg-blur: blur(26px) saturate(1.9) brightness(1.06);
  --a-bar: rgba(40, 38, 52, 0.42);
  --a-side: rgba(38, 36, 50, 0.38);
  --a-sheet: rgba(40, 38, 52, 0.62);
}
html[data-theme="light"] body.ui-apple {
  --lg-fill: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.48) 55%, rgba(255, 255, 255, 0.62));
  --lg-fill-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.60) 55%, rgba(255, 255, 255, 0.72));
  --lg-rim: linear-gradient(150deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.4) 35%, rgba(120, 100, 200, 0.12) 65%, rgba(255, 255, 255, 0.8));
  --lg-shadow: 0 18px 44px rgba(70, 50, 150, 0.16), 0 2px 6px rgba(70, 50, 150, 0.08);
  --lg-inner: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --a-bar: rgba(255, 255, 255, 0.50);
  --a-side: rgba(250, 249, 255, 0.46);
}

/* 1 Hintergrund: kraeftigere, logo-farbige Lichtflecken, damit das Glas
   etwas zum Durchscheinen hat */
body.ui-apple:not(.auth-bg)::before {
  background:
    radial-gradient(620px 460px at 8% 4%, rgba(160, 110, 255, 0.42), transparent 64%),
    radial-gradient(560px 420px at 92% 18%, rgba(90, 120, 255, 0.26), transparent 62%),
    radial-gradient(520px 520px at 70% 88%, rgba(210, 110, 230, 0.22), transparent 64%),
    radial-gradient(640px 520px at 0% 100%, rgba(130, 100, 255, 0.24), transparent 66%);
}
html[data-theme="light"] body.ui-apple:not(.auth-bg)::before {
  background:
    radial-gradient(620px 460px at 8% 4%, rgba(160, 110, 255, 0.30), transparent 64%),
    radial-gradient(560px 420px at 92% 18%, rgba(90, 140, 255, 0.20), transparent 62%),
    radial-gradient(520px 520px at 70% 88%, rgba(230, 120, 220, 0.18), transparent 64%),
    radial-gradient(640px 520px at 0% 100%, rgba(130, 100, 255, 0.18), transparent 66%);
}

/* 2 Gemeinsamer Glas-Baustein: Verlaufsfuellung, starke Unschaerfe,
   Lichtkante (heller Rand oben links, "specular rim") per ::after */
body.ui-apple .apple-topbar,
body.ui-apple .app-shell > header.sidebar,
body.ui-apple .apple-tabbar,
body.ui-apple .stat-card,
body.ui-apple .detail-card,
body.ui-apple .inquiry-card,
body.ui-apple .collapsible-card,
body.ui-apple fieldset,
body.ui-apple .login-card,
body.ui-apple .apple-sheet,
body.ui-apple .login-hints-dialog {
  background: var(--lg-fill);
  -webkit-backdrop-filter: var(--lg-blur);
  backdrop-filter: var(--lg-blur);
  border-color: transparent;
  box-shadow: var(--lg-inner), var(--lg-shadow);
}
body.ui-apple .stat-card,
body.ui-apple .detail-card,
body.ui-apple .inquiry-card,
body.ui-apple .collapsible-card,
body.ui-apple fieldset { position: relative; }
body.ui-apple .apple-topbar::after,
body.ui-apple .app-shell > header.sidebar::after,
body.ui-apple .apple-tabbar::after,
body.ui-apple .stat-card::after,
body.ui-apple .detail-card::after,
body.ui-apple .inquiry-card::after,
body.ui-apple .collapsible-card::after,
body.ui-apple fieldset::after,
body.ui-apple .login-card::after,
body.ui-apple .login-hints-dialog::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* 3 Schwebende Leisten: Kopfleiste, Seitenleiste, Tab-Leiste loesen sich
   vom Rand und werden eigene Glas-Inseln */
@media (min-width: 900px) {
  body.ui-apple .apple-topbar {
    top: 10px; left: 12px; right: 12px;
    height: 56px;
    border-radius: 22px;
    border-bottom: 0;
  }
  body.ui-apple .app-shell > header.sidebar {
    top: 78px; left: 12px; bottom: 12px;
    border-right: 0;
    border-radius: 26px;
  }
  body.ui-apple .main-col { padding-top: 76px; }
  body.ui-apple .main-col,
  body.ui-apple .app-footer { margin-left: 256px; }
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse) ~ .app-footer,
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse) .main-col { margin-left: 92px; }
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse:hover) ~ .app-footer,
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse:focus-within) ~ .app-footer,
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse:hover) .main-col,
  body.ui-apple .app-shell:has(.sidebar.sidebar-auto-collapse:focus-within) .main-col { margin-left: 256px; }
  body.ui-apple .sidebar-link.active {
    background: var(--lg-fill-strong);
    box-shadow: var(--lg-inner), 0 4px 14px rgba(0, 0, 0, 0.18);
  }
  body.ui-apple .apple-search { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10); }
  html[data-theme="light"] body.ui-apple .apple-search { background: rgba(255, 255, 255, 0.6); }
}
@media (max-width: 899.98px) {
  body.ui-apple .apple-topbar { border-bottom: 0; }
  body.ui-apple .apple-tabbar {
    left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 6px;
    border-top: 0;
    border-radius: 30px;
  }
  body.ui-apple .apple-tab { border-radius: 24px; }
  body.ui-apple .apple-tab.active { background: var(--lg-fill-strong); box-shadow: var(--lg-inner); }
  body.ui-apple .apple-sheet { border-radius: 32px 32px 0 0; }
}

/* 4 Knoepfe: Glas-Kapseln; Primaerknopf behaelt Lavendel, bekommt aber
   Glanzkante und inneres Licht */
body.ui-apple .btn,
body.ui-apple .btn-hero-secondary,
body.ui-apple .btn-hero-icon,
body.ui-apple .apple-icon-btn,
body.ui-apple .settings-tab-btn:not(.active) {
  background: var(--lg-fill);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--lg-inner), 0 4px 14px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
}
body.ui-apple .btn-accent,
body.ui-apple .btn-hero-primary,
body.ui-apple .sidebar-new-btn,
body.ui-apple .settings-tab-btn.active,
body.ui-apple .anrede-seg button[aria-pressed="true"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 52%),
    var(--a-btn);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 6px rgba(80, 40, 180, 0.25), var(--a-btn-glow);
}

/* 5 Honorar-Kachel: getoentes Glas statt flacher Flaeche */
body.ui-apple .stat-card-hoverable {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(170, 130, 255, 0.40), transparent 60%),
    var(--lg-fill-strong);
}
html[data-theme="light"] body.ui-apple .stat-card-hoverable {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(150, 110, 245, 0.28), transparent 60%),
    var(--lg-fill-strong);
}

/* 6 Innen-Flaechen (Felder, Kalender-Zellen) leicht glasig */
body.ui-apple input:not([type="checkbox"]):not([type="radio"]),
body.ui-apple select,
body.ui-apple textarea {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}
html[data-theme="light"] body.ui-apple input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] body.ui-apple select,
html[data-theme="light"] body.ui-apple textarea { background: rgba(255, 255, 255, 0.7); box-shadow: inset 0 1px 2px rgba(60, 40, 120, 0.08); }
html[data-theme] body.ui-apple .apple-search input { background: transparent; box-shadow: none; }
body.ui-apple .calendar-cell { background: rgba(255, 255, 255, 0.05); }
html[data-theme] body.ui-apple .apple-search input:not([type="checkbox"]):not([type="radio"]) { background: transparent; box-shadow: none; }
html[data-theme="light"] body.ui-apple .calendar-cell { background: rgba(255, 255, 255, 0.55); }
@media (max-width: 899.98px) {
  body.ui-apple .apple-topbar {
    top: calc(8px + env(safe-area-inset-top, 0px));
    margin: calc(8px + env(safe-area-inset-top, 0px)) 10px 0;
    padding-top: 0;
    height: 54px;
    border-radius: 22px;
  }
}
@media (max-width: 899.98px) {
  body.ui-apple .apple-tabbar {
    background: var(--lg-fill), rgba(30, 28, 42, 0.8);
    -webkit-backdrop-filter: blur(34px) saturate(2) brightness(0.9);
    backdrop-filter: blur(34px) saturate(2) brightness(0.9);
  }
  html[data-theme="light"] body.ui-apple .apple-tabbar { background: var(--lg-fill), rgba(255, 255, 255, 0.78); }
}

/* Kalender-Eintraege (Nick, 2026-09-30): wieder klar nach Veranstaltungsart
   unterscheidbar - vorher faerbte die allgemeine Link-Farbe alle Eintraege
   lavendel und die Hintergruende waren im Glas-Look zu blass. Jetzt wie im
   Apple-Kalender: farbiger Streifen links, kraeftig getoenter Hintergrund,
   gut lesbare Schrift. */
body.ui-apple .calendar-event.cal-type-hochzeit  { --cal: 232, 121, 249; --cal-ink-light: #9d1aa8; }
body.ui-apple .calendar-event.cal-type-corporate { --cal: 56, 189, 248;  --cal-ink-light: #03659a; }
body.ui-apple .calendar-event.cal-type-club      { --cal: 251, 146, 60;  --cal-ink-light: #b23c08; }
body.ui-apple .calendar-event.cal-type-sonstiges { --cal: 45, 212, 191;  --cal-ink-light: #0b6f66; }
body.ui-apple .calendar-event.cal-type-termin    { --cal: 250, 204, 21;  --cal-ink-light: #8a5a00; }
body.ui-apple a.calendar-event[class*="cal-type-"] {
  background: rgba(var(--cal), 0.34);
  box-shadow: inset 3px 0 0 rgb(var(--cal));
  color: #ffffff;
  padding: 2px 4px 2px 7px;
  border-radius: 6px;
  font-weight: 650;
}
body.ui-apple a.calendar-event[class*="cal-type-"]:hover { background: rgba(var(--cal), 0.5); text-decoration: none; }
html[data-theme="light"] body.ui-apple a.calendar-event[class*="cal-type-"] {
  background: rgba(var(--cal), 0.24);
  color: var(--cal-ink-light);
}
body.ui-apple .calendar-legend { color: var(--text); opacity: 0.85; }
body.ui-apple .calendar-legend-dot { width: 10px; height: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08); }
body.ui-apple .calendar-legend-dot.dot-hochzeit  { background: rgb(232, 121, 249); }
body.ui-apple .calendar-legend-dot.dot-corporate { background: rgb(56, 189, 248); }
body.ui-apple .calendar-legend-dot.dot-club      { background: rgb(251, 146, 60); }
body.ui-apple .calendar-legend-dot.dot-sonstiges { background: rgb(45, 212, 191); }
body.ui-apple .calendar-legend-dot.dot-termin    { background: rgb(250, 204, 21); }

/* Checkliste im Apple-/Glas-Look */
body.ui-apple main .hero-scope > aside.cl-panel { border-radius: 24px; }
@media (min-width: 1100px) {
  body.ui-apple main .hero-scope > aside.cl-panel { position: sticky; top: 90px; }
}
body.ui-apple .cl-bar { background: rgba(255, 255, 255, 0.08); }
html[data-theme="light"] body.ui-apple .cl-bar { background: rgba(60, 40, 120, 0.08); }
body.ui-apple .cl-dot { background: transparent; border-color: rgba(255, 255, 255, 0.22); }
html[data-theme="light"] body.ui-apple .cl-dot { border-color: rgba(60, 40, 120, 0.22); }
body.ui-apple .cl-item.done .cl-dot { background: #34d058; border-color: #34d058; box-shadow: 0 0 0 4px rgba(52, 208, 88, 0.16); }
body.ui-apple .cl-item:not(:last-child)::before { background: rgba(255, 255, 255, 0.10); }
body.ui-apple .cl-item.done:not(:last-child)::before { background: rgba(52, 208, 88, 0.55); }
body.ui-apple .cl-item.next .cl-dot { box-shadow: 0 0 0 4px var(--a-tint); }
body.ui-apple .cl-next-tag { background: var(--a-tint); }
body.ui-apple button.cl-row:hover { background: rgba(255, 255, 255, 0.05); }
body.ui-apple .kl-seg button { background: var(--a-field); border-color: var(--a-sep); }
body.ui-apple .kl-seg button.on { background: rgba(52, 208, 88, 0.18); border-color: rgba(52, 208, 88, 0.6); }
/* Auftrag mit Checkliste: breitere Seite, damit Inhalt + Checkliste Platz haben */
@media (min-width: 1100px) {
  body.ui-apple main.container:has(.cl-panel) { max-width: 1320px; }
}

/* Datum/Uhrzeit nur noch oben neben der Suche (Nick, 2026-10-04) - die
   Zeile im Dashboard-Gruss entfaellt dort, wo die Kopfleiste sie zeigt
   (Desktop/iPad quer). Auf dem Handy hat die Kopfleiste keinen Platz,
   dort bleibt sie im Dashboard. */
body.ui-apple .apple-topbar-date { font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  body.ui-apple .dashboard-greeting-datetime { display: none; }
}
