/* Sales4Sells Admin Portal – Dunkel & Gold */
:root {
  --bg: #0a0907;
  --bg-2: #100e0b;
  --surface: #15130f;
  --surface-2: #1c1914;
  --surface-3: #25211a;
  --border: #2c271e;
  --border-strong: #3d3528;
  --text: #f3ecdd;
  --text-2: #c2b8a3;
  --muted: #8b826f;
  --gold: #d9b25f;
  --gold-2: #f0d48f;
  --gold-3: #a8842f;
  --gold-soft: rgba(217, 178, 95, .12);
  --gold-glow: rgba(217, 178, 95, .35);
  --grad-gold: linear-gradient(135deg, #f3d995 0%, #d9b25f 45%, #a8842f 100%);
  --green: #6fcf97;
  --red: #eb6f6f;
  --blue: #7aa7e8;
  --purple: #b99cf0;
  --orange: #f0a35e;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(217, 178, 95, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(217, 178, 95, .05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--gold-glow); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
.hidden { display: none !important; }

/* ---------- Logo ---------- */
.logo {
  font-family: var(--font-serif);
  font-size: var(--s, 28px);
  letter-spacing: -.01em;
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.logo .logo-4 {
  color: var(--gold);
  font-style: italic;
  font-size: 1.32em;
  margin: 0 .02em 0 .04em;
  transform: translateY(.06em);
  text-shadow: 0 0 18px var(--gold-glow);
}
.logo-sub { font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 410px; padding: 40px 34px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad-gold);
}
.login-card h1 { font: 400 30px/1.15 var(--font-serif); margin: 26px 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: rgba(13, 11, 8, .85); border-right: 1px solid var(--border); padding: 22px 14px;
  backdrop-filter: blur(10px); z-index: 20;
}
.sidebar .brand { padding: 4px 10px 22px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--gold-soft); color: var(--gold-2); box-shadow: inset 2px 0 0 var(--gold); }
.nav a.active svg { opacity: 1; }
.nav .badge { margin-left: auto; }
.user-card {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); margin-top: 12px;
}
.user-card .meta { flex: 1; min-width: 0; }
.user-card .meta strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell > div { min-width: 0; }
.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 60px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar h1 { font: 400 clamp(28px, 3.4vw, 38px)/1.1 var(--font-serif); margin: 0; letter-spacing: -.01em; }
.topbar h1 em { color: var(--gold); }
.topbar .sub { color: var(--muted); margin-top: 4px; }
.topbar .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mobile-bar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .25s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(10, 9, 7, .92);
    backdrop-filter: blur(8px); z-index: 15;
  }
  .main { padding: 20px 16px 60px; }
}

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--gold-3); color: var(--gold-2); }
.btn svg { width: 16px; height: 16px; }
.btn-gold { background: var(--grad-gold); color: #1a1408; border-color: transparent; box-shadow: 0 6px 22px -8px var(--gold-glow); }
.btn-gold:hover { color: #1a1408; filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { padding: 7px; border-radius: 9px; background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.field .req { color: var(--gold); }
.hint { font-size: 12px; color: var(--muted); }
.hint.ok { color: var(--green); }
.hint.bad { color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--bg-2);
  border: 1px solid var(--border); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--gold-3); box-shadow: 0 0 0 3px var(--gold-soft); }
.input::placeholder { color: #5f5849; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type="date"].input, input[type="datetime-local"].input { color-scheme: dark; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.form-error { background: rgba(235, 111, 111, .1); border: 1px solid rgba(235, 111, 111, .35); color: #f4a9a9; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }

.yesno { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.yesno button { background: var(--bg-2); border: 0; padding: 8px 16px; cursor: pointer; color: var(--muted); font-weight: 600; }
.yesno button + button { border-left: 1px solid var(--border); }
.yesno button.on-yes { background: rgba(111, 207, 151, .15); color: var(--green); }
.yesno button.on-no { background: rgba(235, 111, 111, .13); color: var(--red); }
.qual-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.qual-row:last-child { border-bottom: 0; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--gold-soft); border-color: var(--gold-3); color: var(--gold-2); }
.chip .count { opacity: .7; margin-left: 4px; }

.person-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.person-pick label { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; background: var(--bg-2); }
.person-pick input { display: none; }
.person-pick label:has(input:checked) { border-color: var(--gold-3); background: var(--gold-soft); color: var(--gold-2); }

/* ---------- Cards ---------- */
.card { background: linear-gradient(180deg, var(--surface), rgba(21, 19, 15, .85)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.card-head .hint { margin: 0; }
.section-title { font: 400 24px/1.2 var(--font-serif); margin: 34px 0 14px; }
.section-title em { color: var(--gold); }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1200px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .cols-3 { grid-template-columns: 1fr; } .cols-2 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }
@media (max-width: 560px) { .cols-4 { grid-template-columns: 1fr; } }

.kpi { position: relative; overflow: hidden; }
.kpi .kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.kpi .kpi-value { font: 600 30px/1.1 var(--font-sans); margin: 10px 0 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-value.gold { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .kpi-foot { font-size: 12.5px; color: var(--muted); }
.kpi .kpi-icon { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.kpi .kpi-icon svg { width: 18px; height: 18px; }
.delta-up { color: var(--green); font-weight: 600; }
.delta-down { color: var(--red); font-weight: 600; }

.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 26px 28px; border-radius: 18px; margin-bottom: 18px; position: relative; overflow: hidden;
  background: radial-gradient(600px 200px at 100% 0%, rgba(217, 178, 95, .18), transparent 70%), var(--surface);
  border: 1px solid var(--border-strong);
}
.hero .big { font: 400 54px/1 var(--font-serif); color: var(--gold-2); }
.hero h2 { font: 400 26px/1.2 var(--font-serif); margin: 0 0 6px; }
.hero p { margin: 0; color: var(--text-2); }
.hero .hero-stats { display: flex; gap: 26px; }
.hero .hero-stats div { text-align: center; }
.hero .hero-stats span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.chart-box { position: relative; height: 270px; }
.chart-box.sm { height: 210px; }

/* ---------- Badges, pills, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: var(--gold-2); }
.badge.red { background: rgba(235, 111, 111, .14); color: var(--red); }
.badge.green { background: rgba(111, 207, 151, .13); color: var(--green); }
.badge.blue { background: rgba(122, 167, 232, .14); color: var(--blue); }
.badge.purple { background: rgba(185, 156, 240, .14); color: var(--purple); }
.badge.orange { background: rgba(240, 163, 94, .14); color: var(--orange); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #16120a; flex: none; border: 2px solid var(--surface); }
.avatar.lg { width: 38px; height: 38px; font-size: 13px; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.role-admin { color: var(--gold-2); }
.role-sales { color: var(--blue); }
.role-marketing { color: var(--purple); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty svg { width: 34px; height: 34px; color: var(--gold-3); margin-bottom: 8px; }

/* ---------- Lists ---------- */
.todo { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.todo:last-child { border-bottom: 0; }
.todo:hover .todo-title { color: var(--gold-2); }
.todo .todo-title { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.prio-niedrig { background: #5d6a73; }
.prio-normal { background: var(--blue); }
.prio-hoch { background: var(--orange); }
.prio-dringend { background: var(--red); }

.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--grad-gold); transition: width .6s; }
.progress .pace { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); opacity: .55; }

/* ---------- Kanban ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 220px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search .input { padding-left: 34px; }
.board { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column { background: rgba(21, 19, 15, .7); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 340px; transition: border-color .15s, background .15s; }
.column.drag-over { border-color: var(--gold-3); background: rgba(217, 178, 95, .05); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; font-weight: 700; font-size: 13.5px; }
.column-head .dot { width: 9px; height: 9px; }
.column-head .total { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.column-body { display: flex; flex-direction: column; gap: 10px; min-height: 280px; }
.kcard { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; cursor: grab; position: relative; transition: transform .12s, border-color .12s, box-shadow .12s; }
.kcard:hover { border-color: var(--border-strong); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .8); }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kcard .kcard-title { font-weight: 600; margin: 0 0 8px; line-height: 1.35; padding-left: 8px; }
.kcard .kcard-prio { position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; }
.kcard .kcard-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-left: 8px; }
.kcard .kcard-meta .grow { flex: 1; }
.kcard .sub { font-size: 12.5px; color: var(--text-2); padding-left: 8px; margin: -4px 0 8px; }
.drop-marker { height: 3px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }

/* ---------- CRM ---------- */
.crm { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
@media (max-width: 1000px) { .crm { grid-template-columns: 1fr; } }
.views { display: flex; flex-direction: column; gap: 2px; }
.views a { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.views a:hover { background: var(--surface-2); color: var(--text); }
.views a.active { background: var(--gold-soft); color: var(--gold-2); }
.views a span:last-child { color: var(--muted); font-size: 12.5px; }
@media (max-width: 1000px) { .views { flex-direction: row; overflow-x: auto; } .views a { white-space: nowrap; gap: 8px; } }
.status-neu { --c: var(--blue); }
.status-kontaktiert { --c: var(--purple); }
.status-setting { --c: var(--gold); }
.status-gewonnen { --c: var(--green); }
.status-verloren { --c: var(--red); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.q-icons { display: inline-flex; gap: 4px; }
.q-icons span { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.q-ok { background: rgba(111, 207, 151, .13); color: var(--green); }
.q-bad { background: rgba(235, 111, 111, .13); color: var(--red); }

.lead-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.lead-head h1 { font: 400 34px/1.1 var(--font-serif); margin: 0; }
.lead-head .grow { flex: 1; }
.lead-layout { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .lead-layout { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.timeline { position: relative; margin-top: 8px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl-item { display: flex; gap: 14px; padding: 10px 0; position: relative; }
.tl-icon { width: 35px; height: 35px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-strong); display: grid; place-items: center; flex: none; color: var(--gold); z-index: 1; }
.tl-icon svg { width: 16px; height: 16px; }
.tl-body { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.tl-body.compact { background: none; border: 0; padding: 7px 0 0; color: var(--muted); font-size: 13.5px; }
.tl-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.tl-meta strong { color: var(--text-2); }
.tl-text { white-space: pre-wrap; word-break: break-word; }

/* ---------- Goals ---------- */
.ring { --p: 0; --size: 132px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; margin: 4px auto 14px;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 79% 100%), conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; }
.ring.done { background: radial-gradient(closest-side, var(--surface) 78%, transparent 79% 100%), conic-gradient(var(--green) 100%, var(--surface-3) 0); }
.ring strong { font: 400 32px/1 var(--font-serif); }
.ring small { display: block; color: var(--muted); font-size: 11.5px; text-align: center; }
.goal-card { text-align: center; }
.goal-card h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-2); }
.goal-card .nums { font-variant-numeric: tabular-nums; font-weight: 600; }
.goal-card .nums span { color: var(--muted); font-weight: 500; }
.period-tag { font-size: 12px; color: var(--muted); font-weight: 500; font-family: var(--font-sans); margin-left: 8px; }

/* ---------- Content calendar ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.day { background: rgba(21, 19, 15, .7); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-height: 260px; }
.day.today { border-color: var(--gold-3); box-shadow: inset 0 2px 0 var(--gold); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.day-head strong { font: 400 22px/1 var(--font-serif); color: var(--text); }
.ccard { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--c, var(--gold)); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px; cursor: pointer; font-size: 13px; }
.ccard:hover { border-color: var(--border-strong); }
.ccard .ccard-title { font-weight: 600; line-height: 1.3; margin: 3px 0; }
.ccard .ccard-meta { color: var(--muted); font-size: 11.5px; display: flex; justify-content: space-between; gap: 6px; }
.pf-TikTok { --c: #ff4d8d; }
.pf-Instagram { --c: #c77dff; }
.pf-YouTube { --c: #ff5f5f; }
.pf-Facebook { --c: #6c9cff; }
.pf-LinkedIn { --c: #4fb3e8; }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 4, 3, .72); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; animation: fade .15s; }
.modal { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow); animation: pop .18s; }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font: 400 25px/1.2 var(--font-serif); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .grow { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--gold); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); animation: pop .2s; max-width: 360px; font-size: 14px; }
.toast.error { border-left-color: var(--red); }

.notes { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; max-height: 300px; overflow-y: auto; }
.note { display: flex; gap: 10px; }
.note .bubble { flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.note .bubble .tl-meta { margin-bottom: 2px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.right { text-align: right; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt { margin-top: 18px; }
.small { font-size: 13px; }
.report-text { white-space: pre-wrap; color: var(--text-2); font-size: 14px; background: var(--bg-2); border: 1px solid var(--border); padding: 12px; border-radius: 10px; }
.perm-yes { color: var(--green); font-weight: 700; }
.perm-no { color: #5f5849; }

/* ---------- Google Drive ---------- */
.drive-frame { padding: 0; overflow: hidden; height: 72vh; min-height: 420px; }
/* Googles Ordneransicht ist hell – per Filter ins dunkle Design gebracht */
.drive-frame iframe { width: 100%; height: 100%; border: 0; filter: invert(.92) hue-rotate(180deg) sepia(.12); background: #fff; }

/* ---------- Admin-Vorschau ---------- */
.view-switch { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.view-switch label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }
.view-switch .input { padding: 8px 32px 8px 10px; font-size: 13.5px; }
.preview-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 20px; border-radius: 12px; border: 1px solid var(--gold-3); background: var(--gold-soft); color: var(--gold-2); font-size: 14px; }
.preview-banner svg { width: 18px; height: 18px; flex: none; }
.preview-banner span { flex: 1; min-width: 200px; }

/* ---------- Benachrichtigungen ---------- */
.ntf { align-items: center; }
.ntf .ntf-text { white-space: normal; color: var(--text-2); }
.ntf.unread .ntf-text { color: var(--text); font-weight: 600; }
.ntf .kpi-icon svg { width: 15px; height: 15px; }

/* ---------- Termin buchen ---------- */
.kpi-link { color: inherit; display: block; }
.kpi-link:hover { color: inherit; }
.kpi-link .card { transition: border-color .15s; height: 100%; }
.kpi-link:hover .card { border-color: var(--border-strong); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1300px) { .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cols-5 { grid-template-columns: 1fr; } }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-2); font-size: 12px; margin-right: 6px; }
.setter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.setter-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s; }
.setter-card:hover { border-color: var(--border-strong); }
.setter-card input { display: none; }
.setter-card.active { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(217, 178, 95, .08); }
.calendly-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--gold); background: radial-gradient(500px 120px at 0% 0%, rgba(217, 178, 95, .18), transparent 70%), var(--surface-2); }
.calendly-box.missing { border-color: rgba(240, 163, 94, .5); background: rgba(240, 163, 94, .07); }
.calendly-url { display: block; font: 400 22px/1.3 var(--font-serif); color: var(--gold-2); word-break: break-all; margin-top: 4px; }

/* =====================================================================
   Handy & Tablet
   ===================================================================== */
.bottom-nav { display: none; }
.mobile-bar .bell { position: relative; color: var(--text-2); }
.bell-dot { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: #1a1408; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.chart-summary { padding-top: 2px; }
.mstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mstat { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mstat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.mstat strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.mstat small { color: var(--muted); font-size: 11.5px; }
.mstats + .hint { margin-top: 8px; }
.mbars { display: flex; flex-direction: column; gap: 12px; }
.mbar-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.mbar-head small { color: var(--muted); font-weight: 500; }
.mbar-track { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.mbar-track i { display: block; height: 100%; border-radius: 6px; }

@media (max-width: 900px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 2px;
    background: rgba(13, 11, 8, .96); border-top: 1px solid var(--border); backdrop-filter: blur(12px);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; position: relative;
    color: var(--muted); font-size: 10.5px; font-weight: 600; background: none; border: 0; border-radius: 10px; cursor: pointer;
  }
  .bottom-nav svg { width: 21px; height: 21px; }
  .bottom-nav a.active { color: var(--gold-2); }
  .bottom-nav .bn-primary svg { width: 34px; height: 34px; padding: 7px; margin-top: -14px; border-radius: 50%; background: var(--grad-gold); color: #1a1408; box-shadow: 0 6px 18px -6px var(--gold-glow); }
  .bottom-nav .bn-primary { color: var(--gold-2); }
  .bottom-nav b { position: absolute; top: 2px; left: 50%; margin-left: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: #1a1408; font-size: 10px; display: grid; place-items: center; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; right: 12px; }
  .toast { max-width: none; }
  .sidebar { z-index: 40; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .main { padding-left: 14px; padding-right: 14px; padding-top: 16px; }
  .topbar { margin-bottom: 16px; gap: 10px; }
  .topbar h1 { font-size: 27px; }
  .topbar .sub { font-size: 13px; }
  .topbar .actions { width: 100%; }
  .topbar .actions .btn { flex: 1; }
  .section-title { font-size: 21px; margin: 26px 0 12px; }
  .card { padding: 15px; border-radius: 12px; }
  .grid { gap: 10px; }
  .mt { margin-top: 12px; }

  /* Kennzahlen: zwei kompakte Kacheln pro Zeile */
  .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .kpi-icon { display: none; }
  .kpi .kpi-label { font-size: 10.5px; letter-spacing: .05em; }
  .kpi .kpi-value { font-size: 22px; margin: 6px 0 4px; }
  .kpi .kpi-foot { font-size: 11.5px; line-height: 1.35; }
  .kpi .kpi-foot .muted { display: none; }

  /* Werkzeugleisten */
  .toolbar { gap: 8px; margin-bottom: 14px; }
  .toolbar .grow { display: none; }
  .search { min-width: 0; flex: 1 1 100%; }
  .toolbar select.input { flex: 1; width: auto !important; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .tabs { scrollbar-width: none; }

  /* Boards: Spalte für Spalte wischen */
  .board { grid-template-columns: repeat(var(--cols, 4), 84vw); scroll-snap-type: x mandatory; gap: 10px; margin: 0 -14px; padding: 0 14px 8px; scroll-padding: 0 14px; }
  .column { scroll-snap-align: start; min-height: 0; }
  .column-body { min-height: 120px; }

  /* Tabellen als Karten */
  .table-wrap { border: 0; background: none; overflow: visible; }
  table.table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 4px 14px; }
  .table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); text-align: right; white-space: normal !important; }
  .table td:last-child { border-bottom: 0; }
  .table td::before { content: attr(data-label); flex: none; max-width: 48%; text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .table td[data-label=""]::before { display: none; }
  .table td[data-label=""] { justify-content: flex-end; }
  .table td[colspan] { display: block; text-align: center; }
  .table td:first-child { font-size: 15px; }
  .table tbody tr.clickable:hover td { background: none; }
  .table td .input { max-width: 62%; min-width: 0 !important; }

  /* Modals von unten */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94vh; overflow-y: auto; }
  .modal-head { position: sticky; top: 0; background: var(--surface); z-index: 1; padding: 14px 16px; }
  .modal-head h2 { font-size: 22px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: var(--surface); }
  .modal-foot .grow { display: none; }
  .modal-foot .btn { flex: 1; }
  .modal .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* CRM & Lead */
  .lead-head { gap: 8px; }
  .lead-head h1 { font-size: 28px; flex: 1 1 100%; }
  .lead-head .grow { display: none; }
  .lead-head .btn { flex: 1; }
  .kv { grid-template-columns: 105px 1fr; }
  .timeline::before { left: 15px; }
  .tl-icon { width: 31px; height: 31px; }
  .tl-item { gap: 10px; }

  /* Ziele */
  .goal-card { padding: 14px 10px; }
  .ring { --size: 96px; }
  .ring strong { font-size: 24px; }
  .goal-card .nums { font-size: 12.5px; }
  .period-tag { display: block; margin: 4px 0 0; }

  /* Content-Kalender: Tage untereinander */
  .week { grid-template-columns: 1fr; gap: 8px; }
  .day { min-height: 0; }
  .day-head { margin-bottom: 6px; }

  /* Termin buchen */
  .setter-grid { grid-template-columns: 1fr; }
  .calendly-box { padding: 14px; }
  .calendly-box .btn { flex: 1; }
  .calendly-box > span { width: 100%; }
  .calendly-url { font-size: 18px; }
  .qual-row { flex-wrap: wrap; }

  /* Sonstiges */
  .drive-frame { height: 66vh; }
  .preview-banner { font-size: 13px; }
  .login-card { padding: 30px 22px; }
  .person-pick label { font-size: 12.5px; }
}

/* Grid-Kinder dürfen schrumpfen (sonst drücken breite Tabellen das Layout auf) */
.crm > *, .grid > *, .lead-layout > * { min-width: 0; }
@media (max-width: 640px) {
  /* CRM-Liste am Handy: nur das Wichtigste, Details im Lead */
  .crm-table td:nth-child(3), .crm-table td:nth-child(6), .crm-table td:nth-child(7), .crm-table td:nth-child(9) { display: none; }
  .crm-table td:first-child { display: block; text-align: left; }
  .crm-table td:first-child::before { display: none; }
}
@media (max-width: 640px) {
  /* Zellen mit mehreren Badges (z. B. Kennzahlen in Berichten) umbrechen */
  .table td.small { display: block; text-align: left; }
  .table td.small::before { display: block; margin-bottom: 6px; }
  .table td.small .badge { margin: 0 4px 4px 0; }
}

/* ---------- Datum + Uhrzeit (15-Minuten-Takt) ---------- */
.dt-row { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.dt-open { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.dt-open input { accent-color: var(--gold); width: 16px; height: 16px; }
.dt-field.is-open .dt-row { opacity: .45; }

/* Erledigte Aufgaben: grün und zurückhaltend */
.kcard.done { background: rgba(111, 207, 151, .06); border-color: rgba(111, 207, 151, .28); }
.kcard.done .kcard-prio { background: var(--green); }
.kcard.done .kcard-title { color: var(--text-2); }
.kcard.done .avatars { opacity: .7; }

/* Leaderboards: eigene Zeile hervorheben */
.leaderboard tr.me-row td { background: var(--gold-soft); }
@media (max-width: 640px) { .leaderboard tr.me-row { border-color: var(--gold-3); background: var(--gold-soft); } .leaderboard tr.me-row td { background: none; } }

/* Seitenweise blättern (Abschlüsse) */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.kcard .pill { white-space: normal; line-height: 1.3; }
