/* =========================================================
   Immobilienverwaltung – Design System
   Modern · clean · Indigo · Poppins
   ========================================================= */
:root{
  --primary:#3B2BBF; --primary-dark:#2A1D94; --primary-deep:#1F1573; --primary-soft:#ECEAFB;
  --bg:#F4F4FA; --surface:#fff; --text:#1B1A33; --muted:#8B8AA8; --muted-strong:#5E5D7C; --line:#E8E7F3;
  --red:#E5566D;   --red-soft:#FDECEF;
  --amber:#D98A14; --amber-soft:#FEF3E0;
  --blue:#2F6FED;  --blue-soft:#E8F0FE;
  --green:#1E9E75; --green-soft:#E4F7F0;
  --grey:#6F6E8C;  --grey-soft:#EEEEF6;
  --radius:16px; --radius-lg:24px;
  --shadow:0 10px 32px rgba(43,31,160,.08);
  --shadow-sm:0 2px 12px rgba(43,31,160,.06);

  --bs-body-font-family:'Poppins',system-ui,-apple-system,'Segoe UI',sans-serif;
  --bs-body-bg:var(--bg); --bs-body-color:var(--text);
  --bs-primary:#3B2BBF; --bs-primary-rgb:59,43,191; --bs-link-color:#3B2BBF;
}

*{ -webkit-tap-highlight-color:transparent; }
body{ font-family:var(--bs-body-font-family); background:var(--bg); color:var(--text); font-size:.94rem; -webkit-font-smoothing:antialiased; }
h1,h2,h3,h4,h5,h6{ font-weight:600; letter-spacing:-.015em; color:var(--text); }
h2{ font-size:1.55rem; } .h3,h3{ font-size:1.3rem; } h5{ font-size:1.05rem; }
a{ color:var(--primary); text-decoration:none; } a:hover{ color:var(--primary-dark); }
.text-muted{ color:var(--muted)!important; }
hr{ border-color:var(--line); opacity:1; }
.ic{ width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.ic-sm{ width:16px; height:16px; }

/* ---------- App-Shell ---------- */
.app{ min-height:100vh; }
.sidebar{ display:none; }
.content{ max-width:1400px; margin:0 auto; padding:22px 18px 120px; }

.brand{ display:flex; align-items:center; gap:11px; font-weight:700; font-size:1.05rem; color:var(--text); letter-spacing:-.01em; }
.brand:hover{ color:var(--text); }
.brand small{ display:block; font-weight:500; font-size:.68rem; color:var(--muted); letter-spacing:.02em; margin-top:-2px; }
.brand-mark{ width:40px; height:40px; border-radius:13px; background:linear-gradient(135deg,#5747E0,var(--primary-dark)); color:#fff; display:grid; place-items:center; box-shadow:0 6px 16px rgba(59,43,191,.35); }

/* mobile top bar */
.topbar{ position:relative; overflow:hidden; background:linear-gradient(135deg,var(--primary-deep),var(--primary)); color:#fff; padding:calc(18px + env(safe-area-inset-top)) 20px 30px; border-radius:0 0 30px 30px; display:flex; align-items:center; justify-content:space-between; }
.topbar::after{ content:""; position:absolute; width:190px; height:190px; border-radius:50%; background:rgba(255,255,255,.07); right:-50px; top:-80px; }
.topbar .brand, .topbar .brand:hover{ color:#fff; position:relative; z-index:1; }
.topbar .brand small{ color:rgba(255,255,255,.65); }
.topbar .brand-mark{ background:rgba(255,255,255,.16); box-shadow:none; }
.topbar .menu-btn{ position:relative; z-index:1; width:42px; height:42px; border-radius:14px; border:0; background:rgba(255,255,255,.16); color:#fff; display:grid; place-items:center; }

/* mobile tab bar */
.tabbar{ position:fixed; left:12px; right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); z-index:50; background:#fff; border-radius:26px; padding:8px; display:flex; gap:4px; box-shadow:0 14px 44px rgba(31,21,115,.22); }
.tabbar a{ flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; padding:9px 4px 8px; border-radius:19px; color:var(--muted); font-size:.68rem; font-weight:500; }
.tabbar a.active{ background:var(--primary-soft); color:var(--primary); }
.tabbar a .ic{ width:22px; height:22px; }

@media (min-width:992px){
  .app{ display:grid; grid-template-columns:272px 1fr; }
  .topbar,.tabbar{ display:none; }
  .sidebar{ display:flex; flex-direction:column; position:sticky; top:0; height:100vh; background:#fff; padding:26px 18px 20px; border-right:1px solid var(--line); }
  .content{ padding:36px 44px 60px; width:100%; }
  .nav-app{ margin-top:34px; display:flex; flex-direction:column; gap:6px; }
  .nav-app a{ display:flex; align-items:center; gap:13px; padding:12px 15px; border-radius:15px; color:var(--muted-strong); font-weight:500; transition:.15s; }
  .nav-app a:hover{ background:var(--bg); color:var(--text); }
  .nav-app a.active{ background:var(--primary); color:#fff; box-shadow:0 8px 20px rgba(59,43,191,.32); }
  .sidebar-foot{ margin-top:auto; background:var(--bg); border-radius:18px; padding:14px; display:flex; align-items:center; gap:12px; }
  .sidebar-foot .avatar{ width:38px; height:38px; border-radius:12px; background:var(--primary); color:#fff; display:grid; place-items:center; font-weight:600; flex:none; }
  .sidebar-foot .who{ min-width:0; flex:1; font-size:.78rem; line-height:1.25; }
  .sidebar-foot .who b{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
  .sidebar-foot button{ border:0; background:transparent; color:var(--muted-strong); padding:6px; border-radius:10px; }
  .sidebar-foot button:hover{ background:#fff; color:var(--red); }
}

/* ---------- Bausteine ---------- */
.card{ border:0; border-radius:var(--radius-lg); box-shadow:var(--shadow); background:var(--surface); overflow:hidden; }
.card-header{ background:transparent; border-bottom:1px solid var(--line); padding:16px 22px; font-size:.95rem; }
.card-body{ padding:22px; }
.card.text-center .card-header{ border-bottom:0; padding-bottom:0; }

.tile{ width:46px; height:46px; border-radius:15px; display:grid; place-items:center; flex:none; }
.tile-red{ background:var(--red-soft); color:var(--red); } .tile-amber{ background:var(--amber-soft); color:var(--amber); }
.tile-blue{ background:var(--blue-soft); color:var(--blue); } .tile-green{ background:var(--green-soft); color:var(--green); }
.tile-grey{ background:var(--grey-soft); color:var(--grey); } .tile-primary{ background:var(--primary-soft); color:var(--primary); }

.stat{ padding:18px; }
.stat .num{ font-size:2rem; font-weight:700; line-height:1.1; margin-top:16px; letter-spacing:-.02em; }
.stat .lbl{ color:var(--muted); font-size:.8rem; }

.item{ display:flex; align-items:center; gap:14px; padding:14px 16px; background:#fff; border-radius:20px; box-shadow:var(--shadow-sm); color:var(--text); transition:transform .15s, box-shadow .15s; }
a.item:hover, .item:hover{ transform:translateY(-1px); box-shadow:var(--shadow); color:var(--text); }
.item-main{ display:flex; align-items:center; gap:14px; flex:1; min-width:0; color:inherit; }
.item-main:hover{ color:inherit; }
.item-body{ flex:1; min-width:0; display:flex; flex-direction:column; }
.item-title{ font-weight:600; line-height:1.3; }
.item-sub{ color:var(--muted-strong); font-size:.82rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.item-meta{ color:var(--muted); font-size:.74rem; margin-top:2px; }
.item-end{ display:flex; flex-direction:column; align-items:flex-end; gap:6px; flex:none; }
.item-list{ display:flex; flex-direction:column; gap:12px; }
@media (max-width:575px){ .item-end .pill + .pill{ display:none; } }

.icon-btn{ border:0; background:transparent; color:var(--muted); padding:7px; border-radius:10px; display:inline-flex; }
.icon-btn:hover{ background:var(--red-soft); color:var(--red); }

.pill{ display:inline-block; border-radius:999px; padding:.32em .8em; font-size:.72rem; font-weight:600; white-space:nowrap; }
.pill-red{ background:var(--red-soft); color:var(--red); } .pill-amber{ background:var(--amber-soft); color:var(--amber); }
.pill-blue{ background:var(--blue-soft); color:var(--blue); } .pill-green{ background:var(--green-soft); color:var(--green); }
.pill-grey{ background:var(--grey-soft); color:var(--grey); }

.segmented{ display:inline-flex; background:#fff; padding:4px; border-radius:999px; box-shadow:var(--shadow-sm); }
.segmented a{ padding:8px 18px; border-radius:999px; color:var(--muted-strong); font-weight:500; font-size:.84rem; }
.segmented a.active{ background:var(--primary); color:#fff; box-shadow:0 6px 14px rgba(59,43,191,.3); }

.empty{ text-align:center; color:var(--muted); padding:44px 16px; }
.empty .tile{ margin:0 auto 12px; width:60px; height:60px; border-radius:20px; }

/* ---------- Bootstrap-Overrides ---------- */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:.4rem; white-space:nowrap; border-radius:999px; font-weight:500; padding:.6rem 1.25rem; border-width:1.5px; font-size:.9rem; transition:.15s; }
.btn-sm{ padding:.34rem .85rem; font-size:.8rem; } .btn-lg{ padding:.9rem 1.6rem; font-size:1rem; font-weight:600; }
.btn-primary{ --bs-btn-color:#fff; --bs-btn-bg:var(--primary); --bs-btn-border-color:var(--primary); --bs-btn-hover-color:#fff; --bs-btn-hover-bg:var(--primary-dark); --bs-btn-hover-border-color:var(--primary-dark); --bs-btn-active-color:#fff; --bs-btn-active-bg:var(--primary-deep); --bs-btn-active-border-color:var(--primary-deep); --bs-btn-focus-shadow-rgb:59,43,191; --bs-btn-disabled-bg:var(--primary); --bs-btn-disabled-border-color:var(--primary); box-shadow:0 8px 20px rgba(59,43,191,.28); }
.btn-success{ --bs-btn-bg:var(--green); --bs-btn-border-color:var(--green); --bs-btn-hover-bg:#178563; --bs-btn-hover-border-color:#178563; --bs-btn-active-bg:#12694e; --bs-btn-active-border-color:#12694e; box-shadow:0 8px 20px rgba(30,158,117,.25); }
.btn-outline-primary{ --bs-btn-color:var(--primary); --bs-btn-border-color:#D9D5F6; --bs-btn-hover-bg:var(--primary-soft); --bs-btn-hover-color:var(--primary-dark); --bs-btn-hover-border-color:#D9D5F6; --bs-btn-active-bg:var(--primary-soft); --bs-btn-active-color:var(--primary-dark); --bs-btn-active-border-color:#D9D5F6; }
.btn-outline-secondary{ --bs-btn-color:var(--muted-strong); --bs-btn-border-color:var(--line); --bs-btn-hover-bg:var(--bg); --bs-btn-hover-color:var(--text); --bs-btn-hover-border-color:var(--line); --bs-btn-active-bg:var(--bg); --bs-btn-active-color:var(--text); --bs-btn-active-border-color:var(--line); background:#fff; }
.btn-danger{ --bs-btn-color:#fff; --bs-btn-bg:var(--red); --bs-btn-border-color:var(--red); --bs-btn-hover-color:#fff; --bs-btn-hover-bg:#D4435A; --bs-btn-hover-border-color:#D4435A; --bs-btn-active-color:#fff; --bs-btn-active-bg:#C23A50; --bs-btn-active-border-color:#C23A50; --bs-btn-disabled-bg:var(--red); --bs-btn-disabled-border-color:var(--red); box-shadow:0 8px 20px rgba(229,86,109,.28); }
.btn-outline-danger{ --bs-btn-color:var(--red); --bs-btn-border-color:#F6D3D9; --bs-btn-hover-bg:var(--red-soft); --bs-btn-hover-color:var(--red); --bs-btn-hover-border-color:#F6D3D9; --bs-btn-active-bg:var(--red-soft); --bs-btn-active-color:var(--red); --bs-btn-active-border-color:#F6D3D9; }
.btn-link{ color:var(--muted-strong); text-decoration:none; }

.form-label{ font-size:.8rem; font-weight:500; color:var(--muted-strong); margin-bottom:.35rem; }
.form-control,.form-select{ border-radius:14px; border:1.5px solid var(--line); background-color:#fff; padding:.72rem .95rem; font-size:.92rem; color:var(--text); }
.form-control::placeholder{ color:#B4B3C9; }
.form-control:focus,.form-select:focus{ border-color:var(--primary); box-shadow:0 0 0 4px rgba(59,43,191,.12); }
textarea.form-control{ min-height:110px; }
.form-check-input{ border-color:#C9C7E6; width:1.15em; height:1.15em; }
.form-check-input:checked{ background-color:var(--primary); border-color:var(--primary); }
.form-check-input:focus{ box-shadow:0 0 0 4px rgba(59,43,191,.12); border-color:var(--primary); }
.form-text{ color:var(--muted); font-size:.76rem; }
.text-danger{ color:var(--red)!important; font-size:.8rem; }

.table{ --bs-table-bg:transparent; --bs-table-hover-bg:#F8F8FD; --bs-table-border-color:var(--line); margin:0; }
.table thead th{ font-size:.68rem; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); font-weight:600; border-bottom:1px solid var(--line); padding:14px 18px; background:transparent; }
.table td{ padding:14px 18px; border-color:var(--line); vertical-align:middle; }
.table-hover>tbody>tr:hover>*{ --bs-table-accent-bg:#F8F8FD; }
.table tbody tr:last-child td{ border-bottom:0; }

.alert{ border:0; border-radius:16px; padding:14px 18px; font-size:.88rem; }
.alert-success{ background:var(--green-soft); color:#0F7A57; } .alert-danger{ background:var(--red-soft); color:#C23A52; } .alert-warning{ background:var(--amber-soft); color:#9A6208; }
.badge{ border-radius:999px; font-weight:600; padding:.42em .85em; }
.badge.text-bg-secondary{ background:var(--grey-soft)!important; color:var(--grey)!important; }
.badge.text-bg-light{ background:var(--grey-soft)!important; color:var(--grey)!important; border:0!important; }

.list-group-item{ border-color:var(--line); padding:14px 22px; }
.dropdown-menu{ border:0; border-radius:18px; box-shadow:var(--shadow); padding:8px; }
.dropdown-item{ border-radius:12px; padding:10px 14px; font-size:.9rem; }

/* Bestätigungs-Popup (data-confirm) */
.confirm-modal .modal-dialog{ max-width:400px; padding:0 16px; margin-inline:auto; }
.confirm-modal .modal-content{ border:0; border-radius:var(--radius-lg); box-shadow:0 30px 80px rgba(31,21,115,.28); }
.confirm-modal .modal-body{ padding:30px 26px 24px; text-align:center; }
.confirm-modal .tile{ width:60px; height:60px; border-radius:20px; margin:0 auto 16px; }
.confirm-modal .tile .ic{ width:26px; height:26px; }
.confirm-titel{ font-size:1.1rem; font-weight:600; margin:0 0 6px; color:var(--text); }
.confirm-text{ color:var(--muted-strong); font-size:.9rem; margin:0 0 22px; }
.confirm-actions{ display:flex; gap:10px; }
.confirm-actions .btn{ flex:1; }
.confirm-actions .btn-light{ --bs-btn-bg:var(--grey-soft); --bs-btn-border-color:var(--grey-soft); --bs-btn-color:var(--muted-strong); --bs-btn-hover-bg:var(--line); --bs-btn-hover-border-color:var(--line); }
.modal-backdrop.show{ opacity:.35; background:var(--primary-deep); }
.dropdown-item:active{ background:var(--primary); }
dl dt{ color:var(--muted); font-weight:500; font-size:.8rem; }
dl dd{ margin-bottom:.7rem; }

/* ---------- Öffentlich (QR-Formular) ---------- */
.public-head{ position:relative; overflow:hidden; background:linear-gradient(150deg,var(--primary-deep),var(--primary)); color:#fff; padding:26px 22px 70px; }
.public-head::before{ content:""; position:absolute; width:240px; height:240px; border-radius:50%; background:rgba(255,255,255,.07); right:-70px; top:-90px; }
.public-head::after{ content:""; position:absolute; width:130px; height:130px; border-radius:50%; background:rgba(255,255,255,.06); left:-40px; bottom:-30px; }
.public-head-inner{ position:relative; z-index:1; max-width:560px; margin:0 auto; }
.public-head h1{ color:#fff; font-size:1.55rem; margin:18px 0 4px; }
.public-head p{ margin:0; color:rgba(255,255,255,.75); font-size:.9rem; }
.public-head .brand-mark{ background:rgba(255,255,255,.16); box-shadow:none; }
.sheet{ position:relative; z-index:2; background:#fff; max-width:560px; margin:-38px auto 0; border-radius:30px 30px 0 0; padding:26px 22px 48px; min-height:65vh; box-shadow:0 -12px 40px rgba(31,21,115,.12); }
@media (min-width:600px){ .sheet{ border-radius:30px; margin-bottom:40px; min-height:0; } }

.notice{ display:flex; gap:12px; background:var(--amber-soft); color:#8A5A0B; border-radius:16px; padding:13px 15px; font-size:.8rem; margin-bottom:22px; }
.notice .ic{ margin-top:2px; }

.choice-group{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.choice input{ position:absolute; opacity:0; pointer-events:none; }
.choice span{ display:block; text-align:center; padding:.7rem .5rem; border-radius:14px; border:1.5px solid var(--line); font-weight:500; font-size:.88rem; color:var(--muted-strong); cursor:pointer; transition:.15s; }
.choice input:checked + span{ background:var(--primary-soft); border-color:var(--primary); color:var(--primary); }
.choice.danger input:checked + span{ background:var(--red-soft); border-color:var(--red); color:var(--red); }
.choice.warn input:checked + span{ background:var(--amber-soft); border-color:var(--amber); color:var(--amber); }

.success-badge{ width:96px; height:96px; border-radius:50%; background:var(--green-soft); color:var(--green); display:grid; place-items:center; margin:16px auto 22px; box-shadow:0 0 0 12px rgba(30,158,117,.08); }
.success-badge .ic{ width:44px; height:44px; stroke-width:2.5; }

/* ---------- Login ---------- */
.auth{ min-height:100vh; display:grid; place-items:center; padding:24px; background:radial-gradient(900px 500px at 15% -10%,#6656F0 0%,transparent 60%),linear-gradient(160deg,var(--primary-deep),var(--primary)); }
.auth-card{ background:#fff; border-radius:30px; padding:34px 30px; width:100%; max-width:420px; box-shadow:0 40px 90px rgba(0,0,0,.28); }
.auth-card .brand{ justify-content:center; margin-bottom:22px; flex-direction:column; text-align:center; gap:12px; }
.auth-card h1{ font-size:1.35rem; text-align:center; margin-bottom:4px; }
