/* ─────────────────────────────────────────
   main.css — Dein erster qm CRM
   Brand Foundation v1.0 (re-mapped)
   Fonts: Inter (via index.html) · JetBrains Mono (Overlines/IDs)
   ───────────────────────────────────────── */

/* ── VARIABLEN ── */
:root {
  /* Backgrounds — re-mapped auf Foundation Canvas/Surface */
  --bg:     var(--canvas);
  --bg2:    var(--surface);
  --bg3:    var(--surface-2);
  --bg4:    var(--surface-3);

  /* Accent — re-mapped auf Foundation Terrakotta */
  --gold:        var(--accent);
  --gold2:       var(--accent-bright);
  --gold-dark:   var(--accent-deep);
  --gold-subtle: var(--accent-soft);
  --gold-border: var(--accent-soft-strong);

  /* Text — re-mapped auf Foundation Ink */
  --text:   var(--ink-1);
  --text2:  var(--ink-2);
  --text3:  var(--ink-3);

  /* Status — re-mapped auf Foundation Semantic (gedämpft/warm) */
  --green:  var(--success);
  --red:    var(--danger);
  --blue:   var(--info);
  --orange: var(--warning);
  --purple: var(--accent-deep);

  /* Borders */
  --border:  rgba(26,23,20,0.09);
  --border2: rgba(26,23,20,0.14);

  /* Radii */
  --radius: 10px;

  /* Fonts — Foundation Inter für alles, JBM via tokens.css */
  --font-display: var(--font-sans);
  --font-body:    var(--font-sans);
  /* --font-mono kommt jetzt aus tokens.css (JetBrains Mono) */
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
input, textarea, select {
  -webkit-user-select: text; user-select: text;
  border: 1px solid var(--bg4);
  border-radius: 6px;
  padding: 10px 14px;
  min-height: 42px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(168, 94, 58, 0.15);
  outline: none;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ─────────────────────────────────────────
   LOGIN
   ───────────────────────────────────────── */
#loginPage {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
  position: relative; overflow: hidden;
}
#loginPage::before {
  content: ''; position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(ellipse at center, rgba(168, 94, 58,0.08) 0%, transparent 65%);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  pointer-events: none;
}
.loginBox {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 62px 53px;
  width: 100%; max-width: 440px;
  text-align: center;
  position: relative; z-index: 1;
  box-shadow: 0 12px 40px rgba(26,23,20,0.10);
}
.loginBox::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 100px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}
.logoText {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 5px;
  color: var(--gold); text-transform: uppercase;
  margin-bottom: 10px; opacity: 0.9;
}
.loginBox h1 {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700; margin-bottom: 7px;
}
.loginBox p { color: var(--text2); font-size: 16px; font-weight: 500; margin-bottom: 38px; }

.inp {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 15px 19px;
  color: var(--text); font-size: 16px;
  font-family: var(--font-body); font-weight: 500;
  margin-bottom: 12px; transition: border-color .2s, box-shadow .2s;
}
.inp:focus { outline: none; border-color: rgba(168, 94, 58,0.5); box-shadow: 0 0 0 2px rgba(168, 94, 58,0.08); }

.loginBtn {
  width: 100%;
  background: var(--gold);
  color: var(--ink-inverse); border: none; border-radius: 8px;
  padding: 16px; font-size: 13px; font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer; letter-spacing: 0.08em; text-transform: uppercase;
  transition: all .2s;
}
.loginBtn:hover { background: var(--gold-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(168, 94, 58,0.2); }
.loginBtn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.errMsg { color: var(--red); font-size: 14px; margin-top: 10px; font-weight: 600; }

/* Login Logo */
.loginLogoWrap {
  display: flex; align-items: center; justify-content: center;
  gap: 17px; margin-bottom: 38px;
}
.loginWordmark { display: flex; flex-direction: column; text-align: left; }
.loginRendite {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 400; letter-spacing: 0.38em;
  color: var(--text2); text-transform: lowercase;
}
.loginFreunde {
  font-family: var(--font-display);
  font-size: 27px; font-weight: 800; letter-spacing: 0.04em;
  color: var(--text); line-height: 1;
}
.loginDividerRow { display: flex; align-items: center; gap: 8px; margin: 7px 0 6px; }
.loginDividerLine { flex: 1; height: 1px; background: var(--border); }
.loginDividerDot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.loginClaim {
  font-family: var(--font-display);
  font-size: 9px; font-weight: 400; letter-spacing: 0.18em;
  color: var(--text3); text-transform: uppercase;
}

/* ─────────────────────────────────────────
   NAV
   ───────────────────────────────────────── */
#app { display: none; min-height: 100vh; }

nav {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 29px;
  display: flex; align-items: center; gap: 2px;
  height: 62px; position: sticky; top: 0; z-index: 100;
}
nav::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-border) 30%, var(--gold-border) 70%, transparent 100%);
}
.navLogo {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 3.5px;
  color: var(--gold); text-transform: uppercase;
  font-weight: 700; margin-right: 24px; white-space: nowrap;
}
.navLogoWordmark { display: flex; flex-direction: column; margin-right: 24px; }
.navLogoRendite {
  font-family: var(--font-display);
  font-size: 8px; font-weight: 400; letter-spacing: 0.32em;
  color: var(--text2); text-transform: lowercase; line-height: 1;
}
.navLogoFreunde {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 800; letter-spacing: 0.04em;
  color: var(--text); line-height: 1;
}
.navBtn {
  padding: 7px 15px; border-radius: 6px;
  border: none; background: transparent;
  color: var(--text2); font-size: 13px; cursor: pointer;
  transition: all .15s; font-weight: 600;
  font-family: var(--font-body);
  white-space: nowrap; letter-spacing: 0.02em;
}
.navBtn:hover  { background: rgba(255,255,255,0.04); color: var(--text); }
.navBtn.active { background: var(--bg3); color: var(--gold); border: 1px solid var(--gold-border); font-weight: 700; }

.navRight { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.roleBadge {
  font-size: 10px; padding: 3px 10px; border-radius: 20px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  font-family: var(--font-display);
}
.role-admin       { background: rgba(168, 94, 58,0.12); color: var(--gold); border: 1px solid var(--gold-border); }
.role-setter      { background: rgba(41,128,185,0.12); color: var(--blue);   border: 1px solid rgba(41,128,185,0.25); }
.role-closer      { background: rgba(142,68,173,0.12); color: var(--purple); border: 1px solid rgba(142,68,173,0.25); }
.role-vertriebler { background: rgba(39,174,96,0.12);  color: var(--green);  border: 1px solid rgba(39,174,96,0.25); }

.userName { font-size: 13px; color: var(--text2); font-weight: 600; }
.logoutBtn {
  padding: 6px 13px; border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text2);
  font-size: 12px; cursor: pointer; transition: all .15s; font-weight: 600;
}
.logoutBtn:hover { border-color: var(--red); color: var(--red); }

/* ─────────────────────────────────────────
   MAIN / LAYOUT
   ───────────────────────────────────────── */
main { padding: 34px 29px; max-width: 1600px; margin: 0 auto; }

.pageHeader {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 14px; flex-wrap: wrap;
}
.pageTitle {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
}
.pageTitle span { color: var(--gold); }

.headerActions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.divider {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--gold); margin: 26px 0 17px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-border), transparent); }

/* ─────────────────────────────────────────
   INPUTS / FORMS
   ───────────────────────────────────────── */
.srchInput {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; padding: 10px 14px;
  color: var(--text); font-size: 15px; width: 220px;
  font-family: var(--font-body); font-weight: 500;
}
.srchInput:focus { outline: none; border-color: rgba(168, 94, 58,0.4); }

.filterSel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; padding: 10px 12px;
  color: var(--text); font-size: 14px; cursor: pointer;
  font-family: var(--font-body); font-weight: 500;
}
.filterSel:focus { outline: none; border-color: var(--gold); }

.addBtn {
  background: var(--gold);
  color: var(--ink-inverse); border: none; border-radius: 7px;
  padding: 10px 22px; font-size: 13px; font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer; letter-spacing: 0.06em;
  transition: all .2s; text-transform: uppercase;
}
.addBtn:hover { background: var(--gold-dark); transform: translateY(-1px); }
.addBtn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ─────────────────────────────────────────
   STATS
   ───────────────────────────────────────── */
.statsGrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 29px;
}
.statCard {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 19px;
  text-align: center; cursor: pointer;
  transition: all .2s; position: relative; overflow: hidden;
}
.statCard::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--border);
}
.statCard:hover { border-color: var(--gold-border); box-shadow: 0 0 20px rgba(168, 94, 58,0.07); }
.statCard:hover::before { background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }
.statNum   { font-size: 34px; font-weight: 600; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.statLabel { font-family: var(--font-body); font-size: 11px; font-weight: 700; color: var(--text2); margin-top: 7px; text-transform: uppercase; letter-spacing: 0.12em; }

/* ─────────────────────────────────────────
   ALERTS
   ───────────────────────────────────────── */
.alertBox {
  background: rgba(230,126,34,0.06); border: 1px solid rgba(230,126,34,0.18);
  border-radius: 9px; padding: 17px 19px; margin-bottom: 24px;
  border-left: 2px solid var(--orange);
}
.alertTitle {
  font-family: var(--font-display);
  font-size: 11px; color: var(--orange);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.10em; margin-bottom: 10px;
}
.alertItem { font-size: 14px; font-weight: 500; color: var(--text2); margin-bottom: 4px; cursor: pointer; }
.alertItem:hover { color: var(--text); }

/* ─────────────────────────────────────────
   KANBAN
   ───────────────────────────────────────── */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; }

.kCol {
  min-width: 225px; max-width: 225px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  transition: border-color .2s;
}
.kCol.drag-over { border-color: var(--gold); background: rgba(168, 94, 58,0.04); }

.kColHeader {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.kColDot   { width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; display: inline-block; }
.kColTitle {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text2);
}
.kColCount {
  background: var(--bg3); color: var(--text2);
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  font-variant-numeric: tabular-nums; font-weight: 500;
}

/* ── LEAD CARD ── */
.leadCard {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; margin-bottom: 8px;
  cursor: grab; transition: all .15s; user-select: none;
}
.leadCard:hover    { border-color: var(--gold-border); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.leadCard.dragging { opacity: .3; cursor: grabbing; }
.lcName { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.lcSub  { font-size: 13px; font-weight: 500; color: var(--text2); }
.lcTags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.lcPrice { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ── TAGS ── */
.tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; font-family: var(--font-display); letter-spacing: 0.03em; }
.s1 { background: rgba(192,57,43,0.12); color: var(--red);    }
.s2 { background: rgba(230,126,34,0.12); color: var(--orange); }
.s3 { background: rgba(39,174,96,0.12);  color: var(--green);  }
.s1, .s2, .s3 { font-variant-numeric: tabular-nums; font-weight: 500; }
.tNotar   { background: rgba(192,57,43,0.12); color: var(--red);   }
.tNotarOk { background: rgba(39,174,96,0.12); color: var(--green); }
.tOnline  { background: rgba(41,128,185,0.12); color: var(--blue); }
.tOrg     { background: rgba(142,68,173,0.12); color: var(--purple); }
.tGray    { background: rgba(255,255,255,0.05); color: var(--text2); }

/* ── PIPELINE STATUS TAGS ── */
.tag[data-status="NEU"]            { background: rgba(148, 140, 130, 0.10); color: var(--ink-3); }
.tag[data-status="QUALIFIZIERT"]   { background: var(--info-soft);         color: var(--info); }
.tag[data-status="CC1"]            { background: rgba(130, 68, 42, 0.10);  color: var(--accent-deep); }
.tag[data-status="CC2"]            { background: var(--warning-soft);      color: var(--warning); }
.tag[data-status="NOTAR"]          { background: var(--danger-soft);       color: var(--danger); }
.tag[data-status="ABGESCHLOSSEN"]  { background: var(--success-soft);      color: var(--success); }
.tag[data-status="AFTERSALES"]     { background: var(--accent-soft);       color: var(--accent); }
.tag[data-status="ABSAGE"]         { background: var(--danger-soft);       color: var(--danger); }
.tag[data-status="DISQUALIFIZIERT"]{ background: rgba(188, 180, 168, 0.10); color: var(--ink-4); }
.tag[data-status="NO_SHOW"]        { background: rgba(143, 102, 32, 0.10);  color: var(--warning-deep); }
.tag[data-status="FOLLOW_UP"]      { background: var(--info-soft);         color: var(--info); }

/* ─────────────────────────────────────────
   MODAL
   ───────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 19px;
}

@media (max-width: 768px) {
  .overlay {
    align-items: flex-end;
    padding: 0;
  }

  .overlay .modal {
    position: fixed;
    top: 8px;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: none;
    margin: 0;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
  }

  .overlay .modal > * {
    flex-shrink: 0;
  }

  .overlay .modal .modalHeader {
    flex-shrink: 0;
    padding: 14px 16px;
  }

  .overlay .modal .modalHeader .closeBtn {
    padding: 5px 10px;
  }

  .overlay .modal .modalBody {
    flex: 1 1 0%;
    overflow-y: auto;
    min-height: 0;
    overscroll-behavior: contain;
    padding: 18px 16px;
    -webkit-overflow-scrolling: touch;
  }

  .overlay .modal .modalFooter {
    flex-shrink: 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .overlay .modal .mTabs {
    flex-shrink: 0;
  }

  .overlay .modal .mTabs .mTab {
    padding: 10px 8px;
    font-size: 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; width: 100%; max-width: 640px;
  max-height: 94vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(26,23,20,0.15);
  position: relative;
}
.modal::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 80px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}
.modalHeader {
  padding: 22px 26px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modalTitle {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
}
.modalMeta  { font-size: 13px; font-weight: 500; color: var(--text2); margin-top: 2px; }
.closeBtn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px;
  color: var(--text2); cursor: pointer; font-size: 18px; line-height: 1;
  transition: all .15s;
}
.closeBtn:hover { border-color: var(--red); color: var(--red); }

/* ── MODAL TABS ── */
.mTabs {
  display: flex; gap: 2px; padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2); flex-shrink: 0; overflow-x: auto;
  white-space: nowrap; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.mTabs::-webkit-scrollbar { height: 3px; }
.mTabs::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
.mTabs::-webkit-scrollbar-track { background: transparent; }
.mTab {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  padding: 13px 12px; color: var(--text2);
  font-size: 13px; cursor: pointer;
  font-weight: 600; font-family: var(--font-body);
  white-space: nowrap; transition: all .15s;
  margin-bottom: -1px; letter-spacing: 0.02em;
  flex-shrink: 0;
}
.mTab:hover  { color: var(--text); }
.mTab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tabDot {
  display: inline-block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--green);
  margin-left: 6px; vertical-align: middle;
}

/* ── MODAL BODY ── */
.modalBody { padding: 26px; overflow-y: auto; flex: 1; }
.tPane        { display: none; }
.tPane.active { display: block; }

/* ── FORM ── */
.fGrid  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 17px; }
.fGroup { display: flex; flex-direction: column; gap: 6px; }
.fGroup label {
  font-family: var(--font-body);
  font-size: 11px; color: var(--text2); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
}
.fGroup input,
.fGroup select,
.fGroup textarea {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 12px 14px;
  color: var(--text); font-size: 15px;
  font-family: var(--font-body); font-weight: 500;
  transition: border-color .2s, box-shadow .2s;
}
.fGroup input:focus,
.fGroup select:focus,
.fGroup textarea:focus { outline: none; border-color: rgba(168, 94, 58,0.45); box-shadow: 0 0 0 2px rgba(168, 94, 58,0.07); }
.fGroup textarea        { resize: vertical; min-height: 86px; }
.fGroup select option   { background: var(--bg2); }
.fGroup input[readonly] { opacity: .55; cursor: not-allowed; }

.statusSel {
  background: var(--bg3); border: 1px solid var(--gold-border);
  border-radius: 7px; padding: 11px 14px;
  color: var(--gold); font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%; font-family: var(--font-body);
}

/* ── MODAL FOOTER ── */
.modalFooter {
  padding: 17px 26px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0;
}
.btnSec {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 7px; padding: 11px 22px;
  color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: all .15s;
}
.btnSec:hover { border-color: var(--border2); }
.btnPri {
  background: var(--gold);
  color: var(--ink-inverse); border: none; border-radius: 7px;
  padding: 11px 22px; font-size: 13px; font-weight: 700;
  font-family: var(--font-body); cursor: pointer;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: all .2s;
}
.btnPri:hover    { background: var(--gold-dark); }
.btnPri:disabled { opacity: .5; cursor: not-allowed; }
.btnDel {
  background: transparent; border: 1px solid rgba(192,57,43,0.3);
  border-radius: 7px; padding: 11px 17px;
  color: var(--red); font-size: 13px; font-weight: 600; cursor: pointer;
  margin-right: auto; transition: all .15s;
}
.btnDel:hover { background: rgba(192,57,43,0.08); border-color: var(--red); }
.loginBtn:disabled { opacity: .7; cursor: not-allowed; }

/* ─────────────────────────────────────────
   AFTERSALES CHECKLIST
   ───────────────────────────────────────── */
.checkGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkItem {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  display: flex; align-items: center; gap: 11px;
  cursor: pointer; transition: all .15s;
}
.checkItem:hover { border-color: var(--gold-border); }
.checkItem.done  { border-color: rgba(39,174,96,0.3); background: rgba(39,174,96,0.05); }
.checkBox {
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .15s;
}
.checkBox.checked             { background: var(--green); border-color: var(--green); }
.checkBox.checked::after      { content: '✓'; color: var(--ink-inverse); font-size: 11px; font-weight: bold; }
.checkLabel { font-size: 14px; font-weight: 600; }
.checkSub   { font-size: 12px; font-weight: 500; color: var(--text2); }

/* ─────────────────────────────────────────
   TABELLEN
   ───────────────────────────────────────── */
.dataTable { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dataTable col.col-einheit   { width: 17%; }
.dataTable col.col-groesse   { width: 15%; }
.dataTable col.col-kaufpreis { width: 18%; }
.dataTable col.col-kaltmiete { width: 17%; }
.dataTable col.col-rendite   { width: 11%; }
.dataTable col.col-status    { width: 22%; }
.dataTable th {
  text-align: left; padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 11px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.1em;
  border-bottom: 2px solid var(--border2); font-weight: 700;
}
.dataTable td {
  padding: 12px 16px; font-size: 13px; font-weight: 500;
  border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dataTable td.num {
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.dataTable td:not(:first-child), .dataTable th:not(:first-child) {
  font-variant-numeric: tabular-nums;
}
.dataTable tr:hover td { background: var(--surface-2); cursor: pointer; }
.rendite { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── STATUS BADGES ── */
.sBadge {
  padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 700;
  display: inline-block;
  font-family: var(--font-display); letter-spacing: 0.04em; text-transform: uppercase;
}
.bv { background: var(--accent); color: var(--ink-inverse); border: 1px solid var(--accent); }
.bi { background: rgba(41,128,185,0.12); color: var(--blue);   border: 1px solid rgba(41,128,185,0.2); }
.br { background: rgba(168, 94, 58,0.12); color: var(--gold);   border: 1px solid var(--gold-border); }
.bk { background: rgba(255,255,255,0.04); color: var(--text2); border: 1px solid var(--border); }

/* ─────────────────────────────────────────
   CLOSER TRACKING
   ───────────────────────────────────────── */
.closerGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 17px; }
.closerCard { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.closerName {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600; margin-bottom: 17px;
}
.qRow { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.qVal { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.qBar { height: 4px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-bottom: 12px; }
.qFill{ height: 100%; border-radius: 3px; transition: width .5s; }

/* ─────────────────────────────────────────
   SETTER / VERTRIEBLER KARTEN
   ───────────────────────────────────────── */
.listCard {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 19px 22px;
  margin-bottom: 12px; cursor: pointer; transition: all .15s;
}
.listCard:hover { border-color: var(--gold-border); box-shadow: 0 0 16px rgba(168, 94, 58,0.06); }
.listCardName { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.listCardMeta { font-size: 14px; font-weight: 500; color: var(--text2); margin-top: 4px; }

/* ─────────────────────────────────────────
   NOTAR PROGRESS BAR
   ───────────────────────────────────────── */
.notarBar  { height: 4px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.notarFill { height: 100%; border-radius: 3px; }

/* ─────────────────────────────────────────
   ÜBERGABE FORMULAR
   ───────────────────────────────────────── */
.uebergabeBox {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 38px; max-width: 600px;
}
.uebergabeTitle { font-family: var(--font-display); font-size: 23px; font-weight: 700; margin-bottom: 7px; }
.uebergabeSub   { color: var(--text2); font-size: 16px; font-weight: 500; margin-bottom: 29px; }

/* ─────────────────────────────────────────
   LOADING / TOAST
   ───────────────────────────────────────── */
.loading { text-align: center; padding: 48px; color: var(--text2); font-weight: 500; }
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 29px; right: 29px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 9px; padding: 14px 22px; font-size: 15px;
  z-index: 999; animation: slideIn .25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  font-family: var(--font-body); font-weight: 600;
}
.toast.success { border-color: rgba(39,174,96,0.4); color: var(--green); }
.toast.error   { border-color: rgba(192,57,43,0.4); color: var(--red);   }
@keyframes slideIn {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ─────────────────────────────────────────
   BERECHTIGUNGEN
   ───────────────────────────────────────── */
.berechGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.berechItem {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  cursor: pointer; transition: all .15s; user-select: none;
}
.berechItem:hover    { border-color: var(--border2); }
.berechItem.berechActive { border-color: var(--gold-border); background: var(--gold-subtle); }
.berechItem input    { display: none; }
.berechIcon          { font-size: 18px; }
.berechLabel         { font-size: 14px; font-weight: 600; color: var(--text2); }
.berechItem.berechActive .berechLabel { color: var(--gold); }

/* ─────────────────────────────────────────
   IMMOBILIEN DATEIEN
   ───────────────────────────────────────── */
.dateiKat { margin-bottom: 24px; }
.dateiKatHeader {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--border);
}
.dateiGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.dateiCard {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 10px 20px rgba(168, 94, 58,0.06);
  transition: border-color .15s, box-shadow .2s, transform .2s;
}
.dateiCard:hover { border-color: var(--gold-border); box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 16px 32px rgba(168, 94, 58,0.10); transform: translateY(-1px); }
.dateiCard img { width: 100%; height: 86px; object-fit: cover; cursor: zoom-in; display: block; }
.dateiIcon { height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 30px; gap: 5px; }
.dateiIconName { font-size: 10px; color: var(--text2); text-align: center; padding: 0 5px; word-break: break-all; line-height: 1.2; font-weight: 500; }
.dateiCardFooter { display: flex; align-items: center; justify-content: space-between; padding: 5px 7px; border-top: 1px solid var(--border); gap: 5px; }
.dateiName { font-size: 10px; font-weight: 500; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dateiDel { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 11px; padding: 0 2px; flex-shrink: 0; line-height: 1; }
.dateiDel:hover { color: var(--red); }
.dateiUploadBtn {
  background: var(--bg3); border: 1px dashed var(--border2);
  border-radius: 8px; height: 122px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 30px; color: var(--text2); transition: all .15s;
}
.dateiUploadBtn:hover { border-color: var(--gold-border); color: var(--gold); }
.projektCard {
  box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 10px 20px rgba(168, 94, 58,0.06);
  transition: box-shadow .2s, transform .2s;
}
.projektCard:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 16px 32px rgba(168, 94, 58,0.10); transform: translateY(-1px); }

/* ── Zahlen-Inputs ── */
input[type="number"],
input[type="date"] {
  font-variant-numeric: tabular-nums;
}

/* ── Tabular Nums GLOBAL — gleichmäßige Zahlenbreiten ── */
[data-count],
.mono,
.statNum,
.kColCount,
.lcPrice,
.stageNavCount,
.rendite-wert,
.sBadge,
.dataTable td:not(:first-child),
.qVal,
.closerCard .qRow span:last-child,
.alertItem,
.em-price,
.em-rendite,
.modalMeta,
.num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ── Einheiten Mobile List: base hidden ── */
.einheiten-mobile-list { display: none; }

/* ─────────────────────────────────────────
   STAGE NAVIGATION BAR
   ───────────────────────────────────────── */
.stageNavWrap {
  position: relative;
  margin-bottom: 14px;
}
.stageNavWrap::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 44px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
  z-index: 1;
}
.stageNav {
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-right: 40px;
}
.stageNav::-webkit-scrollbar { display: none; }
.stageNavItem {
  padding: 7px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg2);
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text2); cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.stageNavItem:hover { border-color: var(--gold-border); color: var(--text); }
.stageNavItem.active { background: var(--gold-subtle); border-color: var(--gold-border); color: var(--gold); }
.stageNavCount {
  font-variant-numeric: tabular-nums;
  font-size: 10px; padding: 1px 6px; border-radius: 10px;
  background: var(--bg3); color: var(--text2);
}
.stageNavItem.active .stageNavCount { background: rgba(168, 94, 58,0.15); color: var(--gold); }
.stageNavScrollBtn {
  position: absolute;
  right: 2px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  background: var(--bg2);
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  color: var(--gold);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: all 0.15s;
  padding: 0 0 2px 1px;
}
.stageNavScrollBtn:hover {
  background: var(--gold-subtle);
  transform: translateY(-50%) scale(1.08);
}
/* ── Kanban Scroll Progress Bar ── */
.stageNavProgress {
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.stageNavProgressFill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s ease;
}
.stageNavScrollBtnLeft {
  position: absolute;
  left: 2px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  background: var(--bg2);
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  color: var(--gold);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  z-index: 2;
  transition: all 0.15s;
  padding: 0 1px 2px 0;
}
.stageNavScrollBtnLeft:hover {
  background: var(--gold-subtle);
  transform: translateY(-50%) scale(1.08);
}
.stageNavScrollBtnLeft.visible { display: flex; }

.kanbanWrap { position: relative; }
.kanbanWrap::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 14px;
  width: 48px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
  z-index: 1;
}
@keyframes swipeHint {
  0%, 100% { transform: translateX(0); }
  40% { transform: translateX(-12px); }
  70% { transform: translateX(3px); }
}
.kanban.swipe-hint { animation: swipeHint 0.8s ease-in-out 2; }

/* ─────────────────────────────────────────
   DASHBOARD v3
   ───────────────────────────────────────── */
.dashSection {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 10px 20px rgba(168, 94, 58,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.dashSection:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.06), 0 16px 32px rgba(168, 94, 58,0.10);
}
.dashGridTwo {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.dashTimeFilter {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border-radius: 7px;
  padding: 3px;
}
.dtfBtn {
  padding: 6px 14px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
}
.dtfBtn:hover { color: var(--text); }
.dtfBtn.active {
  background: var(--bg2);
  color: var(--gold);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.statCard.dashCard {
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--gold);
  background: var(--bg2);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 10px 20px rgba(168, 94, 58,0.06);
  position: relative;
}
.statCard.dashCard:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(168, 94, 58,0.18), 0 4px 8px rgba(0,0,0,0.06);
}
.statCard.dashCard .statNum { color: var(--ink-1); font-weight: 500; font-size: 40px; }
.statCard.dashCard .statLabel { font-weight: 700; letter-spacing: 0.12em; color: var(--accent); }
.dashCardIcon {
  position: absolute;
  top: 14px;
  left: 14px;
  opacity: 0.5;
}
.statSub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
}
@keyframes skelPulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.3; }
}
.skelPulse {
  background: var(--bg3);
  border-radius: var(--radius);
  animation: skelPulse 1.5s ease-in-out infinite;
}
.dashEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 0;
  color: var(--text3);
  font-size: 13px;
}
.dashSkelGrid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.dashSection .divider {
  font-size: 22px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--ink-1);
  border-bottom: none;
  padding-bottom: 14px;
}
.dashSection .divider::after {
  background: linear-gradient(90deg, rgba(168, 94, 58,0.4), transparent);
}
.dashSectionIcon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
/* Funnel bar hover */
.funnelRow:hover .funnelBar {
  height: 30px;
  box-shadow: 0 0 12px rgba(168, 94, 58,0.25);
}
.funnelRow { transition: all 0.15s ease; }
.funnelBar { transition: width 0.4s ease, height 0.15s ease, box-shadow 0.15s ease; }

/* ─────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────── */
@media (max-width: 600px) {
  .fGrid     { grid-template-columns: 1fr; }
  .checkGrid { grid-template-columns: 1fr; }
  main       { padding: 17px 14px; }
  nav        { padding: 0 14px; }

  /* Kanban scroll-snap (600px Breakpoint per Spec) */
  .kanban { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .stageNavScrollBtn { display: none; }
  .kCol   { min-width: 85vw; max-width: 85vw; scroll-snap-align: center; flex-shrink: 0; }

  /* Immobilien: Tabelle → Mobile Cards */
  .dataTable             { display: none; }
  .einheiten-mobile-list { display: block; }

  /* Login compact auf kleinen Screens */
  .loginBox { padding: 40px 24px; }

  /* KPI Grid 2-spaltig (override JS inline grid-template-columns) */
  .statsGrid { grid-template-columns: 1fr 1fr !important; gap: 12px; }

  /* Dashboard Grid → 1-spaltig auf Mobile */
  .dashGridTwo, .dashSkelGrid { grid-template-columns: 1fr; }
  .dashTimeFilter { order: -1; }
}

/* ─────────────────────────────────────────
   MOBILE OPTIMIERUNG
   ───────────────────────────────────────── */
@media (max-width: 768px) {
  /* Prevent zoom on input focus (iOS) */
  input, select, textarea { font-size: 16px !important; }

  /* Navigation — horizontal scroll */
  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }

  /* Nav buttons — mobile sizing */
  .navBtn {
    font-size: 13px;
    padding: 8px 12px;
    white-space: nowrap;
  }

  /* Touch targets — primary interactive elements (min 44px) */
  .addBtn, .btnPri, .btnSec, .loginBtn, .filterSel {
    min-height: 44px;
  }

  /* Typography + FAB spacing */
  body {
    font-size: 15px;
    padding-bottom: 90px;
  }

  /* Kanban — horizontal scroll (snap handled at 600px) */
  .kanban {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* FAB Button — Neuer Lead */
  .mobile-fab {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--text);
    font-size: 28px; font-weight: 300;
    border: none;
    box-shadow: 0 4px 16px rgba(168, 94, 58,0.4);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
  }

  /* KPI Card — zentriert + lesbar */
  .statCard {
    text-align: center;
    padding: 16px 8px;
  }
  .statNum {
    font-size: 30px;
  }
  .statLabel {
    font-size: 11px;
    letter-spacing: 0.05em;
  }

  /* FAB bei offenem Modal ausblenden */
  .overlay ~ .mobile-fab,
  body.modal-open .mobile-fab {
    display: none !important;
  }

  /* Einheiten Mobile Cards (visible at ≤600px, styled here) */
  .einheit-mobile-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(168, 94, 58,0.15);
    gap: 12px;
  }
  .einheit-mobile-card .em-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
  }
  .einheit-mobile-card .em-price {
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }
  .einheit-mobile-card .em-rendite {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    min-width: 45px;
    text-align: right;
  }
  .einheit-mobile-card .em-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(168, 94, 58,0.15);
    color: var(--gold);
  }

  /* Modal Tabs — Platz nach letztem Tab */
  .mTabs {
    padding-right: 32px;
  }
}

@media (min-width: 769px) {
  .mobile-fab { display: none; }
}

/* ─────────────────────────────────────────
   SIGNATURE-ELEMENTE — Brand Foundation v1.0 (Phase 3)
   ───────────────────────────────────────── */

/* § Section-Label — Paragraph-Nummerierung */
.rf-section-label::before {
  content: "§ ";
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
  margin-right: 2px;
}

/* Kursiv-Emphase auf Kern-Wort */
.rf-em {
  font-style: italic;
  color: var(--accent);
}

/* R-Monogramm (Signature: Rounded-Square 11px, Terrakotta) */
.rf-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--ink-inverse);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: 11px;
  flex-shrink: 0;
}
.rf-monogram--lg { width: 48px; height: 48px; font-size: 22px; }
.rf-monogram--sm { width: 30px; height: 30px; font-size: 14px; }

/* ─────────────────────────────────────────
   TABULAR NUMS — Utility-Klasse (2026-04-16)
   Verwendung: <span class="num">1.234 €</span>
   ───────────────────────────────────────── */
.num,
.tabular,
.kpiValue,
.statValue,
.metricValue {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Optional: alle Zahlen in Dashboards global */
.dashSection [class*="statNum"],
.dashSection [class*="Value"],
.pipelineCount,
.kpiCard .value {
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────
   MOBILE PHASE 2 — Kanban↔Liste Toggle
   + Nav-Indicator (2026-04-16)
   ───────────────────────────────────────── */

/* View-Toggle (Kanban vs Liste) — nur Mobile sichtbar */
.viewToggle {
  display: none;
  gap: 6px;
  margin: 10px 0 12px;
  background: var(--bg3);
  padding: 4px;
  border-radius: 8px;
  width: 100%;
}
.viewToggle button {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
}
.viewToggle button.active {
  background: var(--bg2);
  color: var(--gold);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Liste-Ansicht (Mobile Alternative zum Kanban) */
.leadList {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}
.leadListItem {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 60px;
}
.leadListItem:active {
  transform: scale(0.99);
  background: var(--bg3);
}
.leadListItem .leadRow1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.leadListItem .leadName {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leadListItem .leadStatus {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gold-subtle);
  color: var(--gold);
  flex-shrink: 0;
}
.leadListItem .leadMeta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}
.leadListItem .leadMeta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stage-Nav Indicator (aktive Stage highlight) */
.stageNavItem.active {
  background: var(--gold-subtle);
  border-color: var(--gold-border);
  color: var(--gold);
  font-weight: 700;
  position: relative;
}
.stageNavItem.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}
.stageNavItem {
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
}

/* Mobile: View-Toggle sichtbar, Kanban/Liste umschalten */
@media (max-width: 768px) {
  .viewToggle { display: flex; }

  /* Im Liste-Modus: Kanban versteckt, Liste sichtbar */
  .pipelineView[data-view="list"] .kanban { display: none; }
  .pipelineView[data-view="list"] .leadList { display: flex; }

  /* Im Kanban-Modus: Liste versteckt, Kanban sichtbar (default) */
  .pipelineView[data-view="kanban"] .leadList { display: none; }
  .pipelineView[data-view="kanban"] .kanban { display: grid; }

  /* Stage-Nav: Touch-freundlich */
  .stageNavItem { min-height: 44px; display: flex; align-items: center; }
}

/* ═══════════════════════════════════════════════════════════════
   JS-TEMPLATE EXTRACTED CLASSES (2026-04-21 Brand-Cleanup)
   Extrahiert aus Inline-Styles in public/js/*.js, damit CSS-Tokens
   nicht mehr in JS-Templates überschrieben werden.
   ═══════════════════════════════════════════════════════════════ */

/* Required-Asterisk in Formular-Labels (pipeline.js, vertriebler.js) */
.req-asterisk { color: var(--gold); font-weight: 600; }

/* SA-Buttons im Lead-Modal (lead-modal.js) */
.saOpenBtn {
  width: 100%;
  padding: 12px 20px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body, 'Inter', sans-serif);
  cursor: pointer;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  min-height: 44px;
}
.saOpenBtn:hover { background: var(--gold-dark, var(--gold)); }

.saCopyBtn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body, 'Inter', sans-serif);
  cursor: pointer;
  letter-spacing: 0.03em;
  min-height: 36px;
}
.saCopyBtn:hover { background: var(--gold-dark, var(--gold)); }

/* Aufgaben-Alert im Dashboard (dashboard.js overdueAlert) */
.dashAlertAufgaben {
  background: rgba(168,94,58,0.10);
  border: 1px solid rgba(168,94,58,0.20);
  border-left: 2px solid var(--gold);
  border-radius: 9px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

/* Task-Row overdue-Highlight (dashboard.js) */
.taskRowOverdue {
  background: rgba(168,94,58,0.08);
  margin: 0 -12px;
  padding-left: 12px !important;
  padding-right: 12px !important;
  border-radius: 6px;
}

/* Vertriebler-Zuordnungs-Chip (immobilien-liste.js) */
.chipZuord {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(168,94,58,0.12);
  color: var(--gold-dark, var(--gold));
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* RESERVIERT-Status-Badge (immobilien-zuordnung.js, 2 Größen) */
.badgeReserviert {
  background: rgba(168,94,58,0.15);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.badgeReserviert--lg { padding: 3px 8px; font-size: 11px; }

/* ═══════════════════════════════════════════════════════════════
   EVENT-HEADER-BAR (pipeline.js Event-Tabs, z.B. Beton Gold)
   Sitzt zwischen pageHeader und stageNavWrap. Zeigt Badge, Datum/Ort
   und Landing-URL-Actions (Öffnen + Kopieren).
   ═══════════════════════════════════════════════════════════════ */
.event-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface, #FDFBF6);
  border: 1px solid var(--hairline, rgba(20,17,14,0.09));
  border-radius: var(--radius, 10px);
  padding: 12px 16px;
  margin: 0 0 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.event-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.event-header-title {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1, #14110E);
  letter-spacing: -0.01em;
}
.event-header-meta {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  color: var(--ink-3, #948C82);
  letter-spacing: 0.02em;
}
.event-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.event-header-link,
.event-header-copy {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--accent, #A85E3A);
  transition: background .15s, color .15s, border-color .15s;
  min-height: 34px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.event-header-link {
  background: transparent;
  color: var(--accent, #A85E3A);
  text-decoration: none;
}
.event-header-link:hover {
  background: var(--accent, #A85E3A);
  color: var(--canvas, #F3EFE7);
}
.event-header-copy {
  background: var(--accent, #A85E3A);
  color: var(--canvas, #F3EFE7);
}
.event-header-copy:hover {
  background: var(--accent-deep, #82442A);
  border-color: var(--accent-deep, #82442A);
}
.event-header-copy.is-copied {
  background: var(--success, #4F6B42);
  border-color: var(--success, #4F6B42);
}

@media (max-width: 768px) {
  .event-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .event-header-actions {
    width: 100%;
  }
  .event-header-link,
  .event-header-copy {
    flex: 1;
    justify-content: center;
  }
}

