/* ══════════════════════════════════════════════════════════════════
   Anfragen-Zentrale — Design nach oaklanerealestate.com
   Marine-Navy #121a21 · Gold #d3ac69 · Creme · Playfair Display + Poppins
   ══════════════════════════════════════════════════════════════════ */
:root {
  --navy:      #121a21;   /* Primär / Kopfzeile / Text */
  --navy-2:    #1c2831;
  --navy-3:    #2b3a45;
  --ink:       #1a222a;
  --ink-2:     #45525c;
  --ink-3:     #6b7883;
  --ink-4:     #97a1a9;
  --cream:     #f6f3ec;   /* Seiten-Hintergrund */
  --cream-2:   #efeadf;
  --card:      #ffffff;
  --line:      #e6e1d6;
  --line-2:    #f0ece2;
  --gold:      #d3ac69;
  --gold-dark: #b8842f;
  --gold-light:#e3ceab;
  --gold-wash: rgba(211,172,105,0.14);
  --pos:       #4e7a52;
  --neg:       #b05740;
  --radius:    12px;
  --shadow:    0 1px 2px rgba(18,26,33,0.04), 0 10px 34px rgba(18,26,33,0.07);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Poppins", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, button { font-size: 15px; }
[hidden] { display: none !important; }
h1 { margin: 0; }

/* ── LOGIN ─────────────────────────────────────────────────────────── */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(120% 90% at 50% -20%, #17222b 0%, var(--navy) 60%, #0d141a 100%);
}
.login-card {
  width: min(410px, calc(100vw - 40px));
  background: var(--card);
  border-radius: 18px;
  padding: 42px 34px 34px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.login-crest {
  font-family: var(--serif); font-weight: 500; font-size: 25px;
  width: 72px; height: 72px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy); border: 1.5px solid var(--gold); border-radius: 50%;
  letter-spacing: 0.01em;
}
.login-crest span { color: var(--gold); margin: 0 2px; font-size: 20px; }
.login-eyebrow { font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; }
.login-title { font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--navy); margin: 8px 0 4px; letter-spacing: -0.01em; }
.login-sub { margin: 0 0 26px; color: var(--ink-3); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 13px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.field input {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fdfcfa; color: var(--ink); font-family: var(--sans);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.btn-gold {
  margin-top: 6px; padding: 13px; border: none; border-radius: 10px;
  background: var(--gold); color: var(--navy); font-weight: 600; letter-spacing: 0.02em;
  transition: filter .15s, transform .12s;
}
.btn-gold:hover { filter: brightness(1.05); transform: translateY(-1px); }
.login-error { margin: 2px 0 0; color: var(--neg); font-size: 13px; }

/* ── APP SHELL ─────────────────────────────────────────────────────── */
.app { min-height: 100dvh; padding-bottom: 48px; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 24px; padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--navy);
  border-bottom: 1px solid rgba(211,172,105,0.18);
}

/* Marken-Switch — im Navy-Header, aktive Marke in Gold */
.brandswitch { display: flex; gap: 6px; }
.brand-pill {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 1px solid transparent; background: transparent;
  padding: 7px 16px; border-radius: 9px; color: rgba(246,243,236,0.6);
  transition: background .18s, color .18s, border-color .18s;
}
.brand-pill .bp-name { font-family: var(--serif); font-size: 16px; font-weight: 500; line-height: 1.1; letter-spacing: 0.01em; }
.brand-pill .bp-count { font-size: 10px; letter-spacing: 0.05em; color: rgba(246,243,236,0.4); }
.brand-pill:hover { color: rgba(246,243,236,0.9); }
.brand-pill.active { color: var(--gold); border-color: rgba(211,172,105,0.4); background: rgba(211,172,105,0.08); }
.brand-pill.active .bp-count { color: rgba(211,172,105,0.65); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(211,172,105,0.22);
  border-radius: 10px; padding: 8px 12px; color: rgba(246,243,236,0.6);
}
.search:focus-within { border-color: var(--gold); }
.search input { border: none; background: transparent; outline: none; width: 150px; color: #f6f3ec; }
.search input::placeholder { color: rgba(246,243,236,0.4); }
.btn-line {
  padding: 9px 16px; border-radius: 10px; border: 1px solid rgba(211,172,105,0.35);
  background: transparent; color: var(--gold); font-weight: 500; letter-spacing: 0.02em;
  transition: background .15s;
}
.btn-line:hover { background: rgba(211,172,105,0.12); }
.btn-icon {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14); background: transparent; color: rgba(246,243,236,0.6);
  transition: color .15s, border-color .15s;
}
.btn-icon:hover { color: #f6f3ec; border-color: rgba(255,255,255,0.3); }

.wrap { max-width: 960px; margin: 0 auto; padding: 30px 24px 0; }
.brandline { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; }
.brandline-name { font-family: var(--serif); font-size: 34px; font-weight: 500; color: var(--navy); letter-spacing: -0.01em; }
.brandline-tag { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; }

/* ── PULS (Statistik) ──────────────────────────────────────────────── */
.pulse {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; margin-bottom: 16px;
}
.pulse-hero {
  background: var(--navy); color: #f6f3ec; border-radius: 16px; padding: 22px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  box-shadow: var(--shadow);
}
.ph-left .ph-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(246,243,236,0.55); font-weight: 600; }
.ph-num { font-family: var(--serif); font-size: 56px; font-weight: 500; line-height: 1; margin-top: 6px; }
.ph-delta { font-size: 12.5px; margin-top: 8px; color: rgba(246,243,236,0.6); }
.ph-delta b { font-weight: 600; }
.ph-delta .up { color: var(--gold); }
.ph-delta .down { color: #d99a86; }
/* 7-Tage-Balken */
.spark { display: flex; align-items: flex-end; gap: 5px; height: 66px; }
.spark-bar { width: 9px; background: rgba(211,172,105,0.25); border-radius: 3px; min-height: 4px; transition: height .4s; position: relative; }
.spark-bar.today { background: var(--gold); }
.spark-wrap { text-align: center; }
.spark-cap { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(246,243,236,0.45); margin-top: 8px; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chip {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; justify-content: center;
}
.chip-num { font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--navy); line-height: 1; }
.chip-label { margin-top: 6px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.chip.gold { border-color: var(--gold-light); background: linear-gradient(180deg, #fffdf8, #fff); }
.chip.gold .chip-num { color: var(--gold-dark); }

/* ── KLAVIYO-BAR ───────────────────────────────────────────────────── */
.klavbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 12px 18px; margin-bottom: 20px; flex-wrap: wrap;
}
.klav-info { display: flex; align-items: center; gap: 12px; }
.klav-title { font-weight: 500; font-size: 14px; color: var(--ink); }
.klav-sub { font-size: 12px; color: var(--ink-3); }
.klav-controls { display: flex; align-items: center; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 23px; border-radius: 20px; background: var(--line); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform .2s; }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch .switch-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.btn-sync {
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--gold);
  background: var(--gold-wash); color: var(--gold-dark); font-weight: 600; font-size: 13px;
  transition: background .15s;
}
.btn-sync:hover { background: rgba(211,172,105,0.22); }
.btn-sync:disabled { opacity: 0.5; cursor: default; }

/* ── TOOLBAR ───────────────────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.segmented { display: inline-flex; background: var(--cream-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg { border: none; background: transparent; color: var(--ink-3); padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.seg:hover { color: var(--navy); }
.seg.active { background: var(--navy); color: var(--gold); }

/* ── LEADS ─────────────────────────────────────────────────────────── */
.leads { display: flex; flex-direction: column; gap: 11px; }
.lead {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line-2); border-left: 3px solid var(--line);
  border-radius: var(--radius); padding: 15px 18px; box-shadow: var(--shadow);
  cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s;
}
.lead:hover { transform: translateY(-1px); border-left-color: var(--gold); }
.lead.is-new { border-left-color: var(--gold); }
.lead-src { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--cream-2); color: var(--navy-3); }
.lead-src svg { width: 20px; height: 20px; }
.lead-src.instagram { background: var(--gold-wash); color: var(--gold-dark); }
.lead-body { min-width: 0; }
.lead-top { display: flex; align-items: center; gap: 9px; margin-bottom: 2px; }
.lead-name { font-family: var(--serif); font-size: 17px; font-weight: 500; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); flex-shrink: 0; }
.lead-contact { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-msg { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lead-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.lead-time { font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }
.badge { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--ink-3); background: var(--cream); }
.badge.new { color: var(--gold-dark); border-color: var(--gold-light); background: var(--gold-wash); }
.badge.done { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 30%, transparent); }
.klav-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--pos); }
.klav-dot::before { content: "✓"; font-weight: 700; }
.empty { text-align: center; color: var(--ink-3); padding: 60px 20px; font-size: 15px; font-family: var(--serif); }

/* ── DRAWER ────────────────────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-veil { position: absolute; inset: 0; background: rgba(18,26,33,0.4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  background: var(--card); box-shadow: -20px 0 60px rgba(18,26,33,0.2);
  padding: 26px 28px; padding-top: calc(26px + env(safe-area-inset-top));
  overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
  animation: slideIn .3s cubic-bezier(.5,.1,.2,1);
}
@keyframes slideIn { from { transform: translateX(28px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.dw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dw-src { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; }
.dw-name { font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--navy); margin: 4px 0 0; letter-spacing: -0.01em; }
.dw-close { border: none; background: var(--cream-2); width: 34px; height: 34px; border-radius: 10px; color: var(--ink-2); font-size: 18px; }
.dw-rows { display: flex; flex-direction: column; }
.dw-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.dw-row:last-child { border-bottom: none; }
.dw-row .k { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.dw-row .v { font-size: 14px; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.dw-row .v a { color: var(--gold-dark); text-decoration: none; }
.dw-msg { background: var(--cream); border: 1px solid var(--line-2); border-radius: 12px; padding: 15px 16px; font-size: 14.5px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.dw-block-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.dw-status { display: flex; gap: 6px; }
.dw-klav { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.dw-klav .ok { color: var(--pos); font-weight: 600; }
.dw-klav .pending { color: var(--gold-dark); }
.dw-klav .off { color: var(--ink-4); }

/* ── TOAST ─────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #f6f3ec; padding: 12px 22px; border-radius: 11px; font-size: 14px; font-weight: 500; z-index: 90; box-shadow: 0 12px 40px rgba(0,0,0,0.3); border: 1px solid rgba(211,172,105,0.3); animation: toastIn .25s ease; }
.toast.err { border-color: var(--neg); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── MOBILE ────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .topbar { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); gap: 8px; }
  .search { display: none; }
  .brand-pill { padding: 6px 12px; }
  .brand-pill .bp-name { font-size: 14px; }
  .wrap { padding: 20px 14px 0; }
  .brandline-name { font-size: 26px; }
  .pulse { grid-template-columns: 1fr; }
  .ph-num { font-size: 46px; }
  .chips { grid-template-columns: 1fr 1fr; }
  .klavbar { padding: 12px 14px; }
  .klav-controls { width: 100%; justify-content: space-between; }
  .segmented { flex: 1; }
  .seg { flex: 1; text-align: center; padding: 8px 6px; font-size: 12px; }
  .lead { grid-template-columns: auto 1fr; gap: 12px; padding: 13px 14px; }
  .lead-meta { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 2px; }
  .drawer-panel { width: 100%; }
}
@media (max-width: 340px) { .chips { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
