/* ══════════════════════════════════════════════════════════════
   Immo.Expert – App-Shell & Design-System "Onyx & Gold"
   Wird zusätzlich zum seiteneigenen <style>-Block geladen.
   ══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* Flächen */
  --ie-bg:        #0f0f11;   /* Seitenhintergrund  */
  --ie-surface:   #18181b;   /* Karten             */
  --ie-surface-2: #222226;   /* leicht abgesetzt   */
  --ie-line:      rgba(255,255,255,0.11);
  --ie-line-soft: rgba(255,255,255,0.07);

  /* Text */
  --ie-ink:       #f1eee7;
  --ie-ink-soft:  #9b968c;

  /* Akzent */
  --ie-accent:    #d3ac5f;
  --ie-accent-2:  #b8914a;
  --ie-accent-bg: rgba(211,172,95,0.12);
  --ie-on-accent: #17130a;   /* Schrift auf Goldflächen */

  /* Signal */
  --ie-pos:       #5cc98a;
  --ie-neg:       #ef6b6b;

  /* Sidebar (noch dunkler als der Inhalt) */
  --ie-sb-bg:     #0a0a0c;
  --ie-sb-bg-2:   #18181b;
  --ie-sb-ink:    #ece9e2;
  --ie-sb-muted:  #8d887e;
  --ie-sb-line:   rgba(255,255,255,0.09);

  /* Maße */
  --ie-top-h:     60px;
  --ie-sb-w:      268px;
}

/* ── Grundgerüst ──────────────────────────────────────────── */

html { background: var(--ie-bg); }

body.ie-app {
  background: var(--ie-bg) !important;
  color: var(--ie-ink) !important;
  padding-top: var(--ie-top-h);
  display: block !important;
}
body.ie-app.has-sidebar { padding-left: var(--ie-sb-w); }

/* Der Inhaltsbereich nimmt die volle Breite ein */
body.ie-app .ie-content { width: 100%; min-height: calc(100vh - var(--ie-top-h)); display: flex; flex-direction: column; }
body.ie-app .ie-content > * { max-width: none !important; }

/* Alte, mittig begrenzte Container aufziehen */
body.ie-app .tab-content,
body.ie-app .page-header,
body.ie-app .summary-bar,
body.ie-app .tile-grid,
body.ie-app .prop-header,
body.ie-app .profil-wrap,
body.ie-app .steckbriefe-wrap,
body.ie-app .input-section,
body.ie-app .result,
body.ie-app .loading,
body.ie-app .saved-section,
body.ie-app .cta-section,
body.ie-app .tab-nav,
body.ie-app footer {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.ie-app .tab-content,
body.ie-app .page-header,
body.ie-app .summary-bar,
body.ie-app .tile-grid,
body.ie-app .prop-header,
body.ie-app .input-section,
body.ie-app .result,
body.ie-app .saved-section,
body.ie-app footer { padding-left: 40px !important; padding-right: 40px !important; }

body.ie-app .tab-pane { flex: 1; }

/* ── Topbar ───────────────────────────────────────────────── */

.ie-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--ie-top-h);
  z-index: 400;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
  background: rgba(15,15,17,0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ie-line);
}
.ie-topbar .ie-logo {
  font: 700 1.18rem/1 'Inter', sans-serif; letter-spacing: -0.4px;
  color: var(--ie-ink); text-decoration: none; white-space: nowrap;
}
.ie-topbar .ie-logo span { color: var(--ie-accent); }
.ie-topbar .ie-spacer { flex: 1; }

/* Höhere Spezifität als die seiteneigenen nav-Regeln */
.ie-topbar nav.ie-topnav {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0; margin: 0; position: static; background: none;
  border: none; backdrop-filter: none;
}
.ie-topbar nav.ie-topnav ul {
  list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0;
}
.ie-topbar nav.ie-topnav ul li { display: flex; align-items: center; }
.ie-topbar nav.ie-topnav ul a {
  font: 500 0.875rem/1 'Inter', sans-serif;
  color: var(--ie-ink-soft); text-decoration: none;
  padding: 9px 14px; border-radius: 8px; background: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.ie-topbar nav.ie-topnav ul a:hover { background: var(--ie-surface-2); color: var(--ie-ink); }
.ie-topbar nav.ie-topnav ul a.active { color: var(--ie-accent); background: var(--ie-accent-bg); font-weight: 600; }
.ie-topbar nav.ie-topnav ul a.ie-cta { background: var(--ie-accent); color: var(--ie-on-accent); font-weight: 600; }
.ie-topbar nav.ie-topnav ul a.ie-cta:hover { background: var(--ie-accent-2); color: var(--ie-on-accent); }

/* Glocke aus notifications.js an das dunkle Theme anpassen */
.ie-topbar .notif-bell { filter: none; font-size: 1.05rem; }
.ie-topbar .notif-panel {
  background: var(--ie-surface); border: 1px solid var(--ie-line);
  box-shadow: 0 16px 44px rgba(0,0,0,0.55);
}
.ie-topbar .notif-head { color: var(--ie-accent); border-bottom-color: var(--ie-line); }
.ie-topbar .notif-item { border-bottom-color: var(--ie-line-soft); }
.ie-topbar .notif-item:hover { background: var(--ie-surface-2); }
.ie-topbar .notif-title { color: var(--ie-ink); }
.ie-topbar .notif-sub, .ie-topbar .notif-empty { color: var(--ie-ink-soft); }

.ie-burger {
  display: none; background: none; border: 1px solid var(--ie-line);
  border-radius: 8px; width: 36px; height: 36px; cursor: pointer;
  color: var(--ie-ink); font-size: 1.05rem; line-height: 1;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.ie-sidebar {
  position: fixed; top: var(--ie-top-h); bottom: 0; left: 0;
  width: var(--ie-sb-w); z-index: 350;
  background: var(--ie-sb-bg);
  border-right: 1px solid rgba(255,255,255,0.07);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 0 40px;
  font-family: 'Inter', sans-serif;
}
.ie-sidebar::-webkit-scrollbar { width: 8px; }
.ie-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 8px; }

.ie-sb-head {
  padding: 6px 18px 14px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--ie-sb-muted);
}

.ie-sidebar .ie-sb-nav {
  display: flex; flex-direction: column; gap: 1px;
  padding: 0 10px; margin: 0; position: static;
  background: none; border: none; backdrop-filter: none;
}

.ie-sb-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  font: 500 0.875rem/1.35 'Inter', sans-serif;
  color: var(--ie-sb-ink); text-decoration: none;
  transition: background .13s, color .13s;
}
.ie-sb-item:hover { background: rgba(255,255,255,0.07); }
.ie-sb-item.active { background: rgba(255,255,255,0.13); color: #fff; font-weight: 600; }
.ie-sb-item .ie-dot {
  width: 6px; height: 6px; border-radius: 50%; background: transparent;
  flex: 0 0 6px;
}
.ie-sb-item.active .ie-dot { background: var(--ie-accent); }
.ie-sb-item .ie-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* Knopf „Immobilie hinzufügen" unter der Immobilienliste */
.ie-sb-item.ie-sb-add { color: var(--ie-accent); margin-top: 2px; }
.ie-sb-item.ie-sb-add:hover { background: var(--ie-accent-bg); }
.ie-sb-item.ie-sb-add .ie-sb-thumb {
  color: var(--ie-accent); font-weight: 600; font-size: 1rem; line-height: 1;
}

/* Roter Punkt: in dieser Immobilie ist etwas offen */
.ie-sb-alert {
  flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ie-neg);
  box-shadow: 0 0 0 3px rgba(239,107,107,0.18);
}

.ie-chev {
  flex: 0 0 auto; font-size: 0.7rem; color: var(--ie-sb-muted);
  transition: transform .16s; display: inline-block;
}
.ie-sb-group.open > .ie-sb-item > .ie-chev { transform: rotate(90deg); }

.ie-sb-sub { display: none; flex-direction: column; gap: 1px; margin: 2px 0 6px 12px; padding-left: 10px; border-left: 1px solid var(--ie-sb-line); }
.ie-sb-group.open > .ie-sb-sub { display: flex; }
.ie-sb-sub .ie-sb-item { font-size: 0.83rem; padding: 7px 10px; color: var(--ie-sb-muted); }
.ie-sb-sub .ie-sb-item:hover { color: var(--ie-sb-ink); }
.ie-sb-sub .ie-sb-item.active { color: #fff; }

.ie-sb-sep {
  margin: 18px 12px 6px; padding-top: 14px;
  border-top: 1px solid var(--ie-sb-line);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--ie-sb-muted);
}
.ie-sb-empty { padding: 8px 22px; font-size: 0.8rem; color: var(--ie-sb-muted); }

.ie-sb-thumb {
  width: 22px; height: 22px; border-radius: 5px; flex: 0 0 22px;
  background: var(--ie-sb-bg-2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
}

.ie-scrim { display: none; position: fixed; inset: 0; z-index: 340; background: rgba(0,0,0,0.62); }

/* ── Wiederkehrende Bausteine ─────────────────────────────── */

.ie-card {
  background: var(--ie-surface); border: 1px solid var(--ie-line);
  border-radius: 14px; padding: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.ie-placeholder {
  background: var(--ie-surface); border: 1px dashed var(--ie-line);
  border-radius: 14px; padding: 56px 32px; text-align: center;
  max-width: 620px;
}
.ie-placeholder .ie-ph-icon { font-size: 2rem; margin-bottom: 14px; }
.ie-placeholder h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: var(--ie-ink); }
.ie-placeholder p { font-size: 0.9rem; color: var(--ie-ink-soft); line-height: 1.65; margin: 0 auto; max-width: 44ch; }

/* Bildbereich der Portfolio-Kacheln */
.tile-photo {
  position: relative; height: 148px; background: var(--ie-surface-2);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--ie-line-soft);
}
.tile-photo.empty { background: linear-gradient(135deg, #24242a, #1a1a1e); }
.tile-photo .tile-photo-icon { font-size: 2.1rem; opacity: 0.55; }
.tile-photo .tile-photo-badge {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(15,15,17,0.86); color: var(--ie-accent);
  border-radius: 50px; padding: 4px 12px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}

/* Sichtbarkeit der Ansichten */
.ie-view { display: none; }
.ie-view.active { display: block; }

/* ── Responsiv ────────────────────────────────────────────── */

@media (max-width: 1000px) {
  body.ie-app.has-sidebar { padding-left: 0; }
  .ie-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.ie-sb-open .ie-sidebar { transform: none; }
  body.ie-sb-open .ie-scrim { display: block; }
  .ie-burger { display: inline-flex; align-items: center; justify-content: center; }
}
/* Seiten ohne Seitenleiste (Startseite, Login, Kontakt …): Menü nur am Handy */
.ie-sidebar.ie-nur-mobil { display: none; }

/* Hauptbereiche im Menü – nur am Handy, dort fehlen sie oben in der Leiste */
.ie-sb-mobil { display: none; }

@media (min-width: 701px) {
  body.ie-app:not(.has-sidebar) .ie-burger { display: none !important; }
}

@media (max-width: 700px) {
  /* obere Leiste: nur Menüknopf, Logo und Profil/Login */
  .ie-topbar nav.ie-topnav ul li:not(:last-child) { display: none; }
  .ie-topbar nav.ie-topnav ul a.ie-cta { padding: 9px 14px; font-size: 0.85rem; }
  .ie-burger { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px; }

  .ie-sidebar.ie-nur-mobil { display: block; transform: translateX(-100%); transition: transform .2s ease; }
  body.ie-sb-open .ie-sidebar.ie-nur-mobil { transform: none; }
  body.ie-sb-open .ie-scrim { display: block; }
  body.ie-sb-open { overflow: hidden; }

  .ie-sidebar { width: min(86vw, 320px); }
  .ie-sb-mobil { display: flex; flex-direction: column; gap: 1px; padding: 0 10px 6px; }
  .ie-sb-mobil + .ie-sb-head { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--ie-sb-line); }
  .ie-sb-item { padding: 12px 12px; font-size: 0.95rem; }
  .ie-sb-sub .ie-sb-item { padding: 10px 10px; }

  /* Seiteninhalt */
  body.ie-app .ie-page-title { font-size: 1.6rem; }
  .pc-card { padding: 16px 14px 14px; }
}

@media (max-width: 700px) {
  body.ie-app .tab-content,
  body.ie-app .page-header,
  body.ie-app .summary-bar,
  body.ie-app .tile-grid,
  body.ie-app .prop-header,
  body.ie-app .input-section,
  body.ie-app .result,
  body.ie-app .saved-section,
  body.ie-app footer { padding-left: 18px !important; padding-right: 18px !important; }
  .ie-topnav a { padding: 8px 10px; font-size: 0.8rem; }
  .ie-topbar { padding: 0 14px; gap: 10px; }
}

/* ── Erklärung hinter dem kleinen i ───────────────────────── */

.ie-info {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex: 0 0 16px;
  border-radius: 50%;
  border: 1px solid var(--ie-line);
  background: none; padding: 0; cursor: help;
  color: var(--ie-ink-soft);
  font: 700 0.62rem/1 'Inter', sans-serif;
  vertical-align: middle;
  transition: color .15s, border-color .15s, background .15s;
}
.ie-info::after { content: 'i'; }
.ie-info:hover, .ie-info:focus-visible {
  color: var(--ie-accent); border-color: var(--ie-accent); background: var(--ie-accent-bg);
  outline: none;
}

.ie-info .ie-info-pop {
  position: absolute; left: 50%; top: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content; max-width: 260px;
  background: var(--ie-surface-2); color: var(--ie-ink);
  border: 1px solid var(--ie-line);
  border-radius: 10px; padding: 9px 12px;
  font: 400 0.76rem/1.5 'Inter', sans-serif;
  text-align: left; text-transform: none; letter-spacing: 0;
  box-shadow: 0 14px 36px rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .14s, visibility .14s;
  z-index: 500;
}
/* Der Text bleibt im Markup, angezeigt wird er aber über eine schwebende
   Kopie (#ieInfoFloat, app-shell.js). So ragt nichts Unsichtbares über den
   Bildschirmrand, und auf dem Handy öffnet ein Antippen die Erklärung. */
.ie-info .ie-info-pop { display: none; }
.ie-info.offen { color: var(--ie-accent); border-color: var(--ie-accent); background: var(--ie-accent-bg); }

#ieInfoFloat {
  position: fixed; left: 0; top: 0; z-index: 10000;
  width: max-content; max-width: min(300px, calc(100vw - 24px));
  background: var(--ie-surface-2); color: var(--ie-ink);
  border: 1px solid var(--ie-line);
  border-radius: 10px; padding: 10px 13px;
  font: 400 0.8rem/1.5 'Inter', sans-serif;
  text-align: left; text-transform: none; letter-spacing: 0;
  box-shadow: 0 14px 36px rgba(0,0,0,0.5);
  display: none;
}
#ieInfoFloat.offen { display: block; }
#ieInfoFloat a { color: var(--ie-accent); }

/* ══════════════════════════════════════════════════════════════
   Rechtstexte – Zustimmung bei der Registrierung (login.html)
   und Betroffenenrechte im Profil (profil.html)
   ══════════════════════════════════════════════════════════════ */

/* Zustimmung zu AGB und Auftragsverarbeitung */
.ie-zust { margin: 20px 0 20px; text-align: left; }
/* wichtig: seiteneigene label-Regeln (Großschrift, Sperrung) hier zurücksetzen */
label.ie-zust-zeile {
  display: flex; gap: 10px; align-items: flex-start;
  font: 400 0.875rem/1.55 'Inter', sans-serif;
  text-transform: none; letter-spacing: normal;
  color: var(--ie-ink, #f1eee7); cursor: pointer; margin-bottom: 0;
}
label.ie-zust-zeile input {
  margin-top: 3px; flex: 0 0 auto; width: 16px; height: 16px;
  accent-color: var(--ie-accent, #d3ac5f); cursor: pointer;
}
label.ie-zust-zeile a { color: var(--ie-accent, #d3ac5f); }
.ie-zust-hinweis {
  margin: 10px 0 0 26px; text-transform: none; letter-spacing: normal;
  font: 400 0.8rem/1.5 'Inter', sans-serif;
  color: var(--ie-ink-soft, #9b968c);
}
.ie-zust-hinweis a { color: var(--ie-ink-soft, #9b968c); text-decoration: underline; }
.ie-zust-hinweis a:hover { color: var(--ie-accent, #d3ac5f); }

/* Meine Daten – Export und Kontolöschung */
.ie-konto-zeile {
  display: flex; gap: 20px; align-items: center; justify-content: space-between;
  padding: 16px 0; border-top: 1px solid var(--ie-line, rgba(255,255,255,.11));
  flex-wrap: wrap;
}
.ie-konto-zeile:first-of-type { border-top: none; padding-top: 4px; }
.ie-konto-zeile strong { display: block; margin-bottom: 4px; color: var(--ie-ink); }
.ie-konto-zeile p {
  margin: 0; font: 400 0.8rem/1.55 'Inter', sans-serif;
  color: var(--ie-ink-soft, #9b968c); max-width: 52ch;
}
.ie-btn-gefahr {
  background: transparent !important; color: #ef6b6b !important;
  border: 1px solid #ef6b6b !important;
}
.ie-btn-gefahr:hover { background: #ef6b6b !important; color: #17130a !important; }
#ie-konto-meldung { margin: 14px 0 0; font: 400 0.82rem/1.5 'Inter', sans-serif; }

/* ══════════════════════════════════════════════════════════════
   Charts (ie-charts.js) – auf allen App-Seiten gleich
   ══════════════════════════════════════════════════════════════ */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.pc-card { background: #18181b; border: 1px solid rgba(255,255,255,0.112);
  border-radius: 14px; padding: 18px 22px 16px; min-width: 0; position: relative; }
.pc-head { display: flex; align-items: flex-start; gap: 12px; }
.pc-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.2px; color: #f1eee7;
  display: inline-flex; align-items: center; gap: 8px; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.075); }
.pc-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: #9b968c; }
.pc-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pc-plot { position: relative; margin-top: 14px; }
.pc-svg { display: block; overflow: hidden; }
.pc-tip { position: absolute; top: 8px; background: #18181b; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 9px; box-shadow: 0 10px 28px rgba(0,0,0,0.63); padding: 9px 12px;
  font-size: 0.78rem; pointer-events: none; z-index: 5; white-space: nowrap; }
.pc-tip b { display: block; margin-bottom: 5px; color: #f1eee7; font-size: 0.8rem; }
.pc-tip-row { display: flex; align-items: center; gap: 7px; color: #9b968c; margin-top: 3px; }
.pc-tip-row i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 9px; }
.pc-tip-row b { display: inline; margin: 0 0 0 auto; padding-left: 14px; color: #f1eee7; font-size: 0.78rem; }
.pc-hero { display: flex; align-items: baseline; gap: 9px; margin-top: 10px; }
.pc-hero-val { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.5px; color: #f1eee7; }
.pc-hero-val.green { color: #5cc98a; } .pc-hero-val.red { color: #ef6b6b; }
.pc-hero-lab { font-size: 0.76rem; color: #9b968c; }
.pc-leer { color: #9b968c; font-size: 0.85rem; text-align: center; padding: 48px 0; }
@media (max-width: 700px) { .pc-grid { grid-template-columns: 1fr; } }

/* ── Einheitlicher Seitenkopf der Portfolio-Ansichten ─────── */
.ie-page-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; color: #f1eee7; margin: 0; }

/* ── Gruppenüberschrift mit goldenem Balken ───────────────── */
.ie-gruppe-titel { display: flex; align-items: center; gap: 9px;
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: #f1eee7; margin-bottom: 13px; }
.ie-gruppe-titel::before { content: ''; display: inline-block; width: 3px; height: 13px;
  border-radius: 2px; background: #d3ac5f; }
.ie-gruppe-titel .save-indicator { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
