/* Schriften wie auf yoursalesbuddy.de – lokal ausgeliefert (keine Anfragen an Google) */
@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap; src: url("../fonts/opensans-400.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-display: swap; src: url("../fonts/opensans-600.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-display: swap; src: url("../fonts/opensans-700.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("../fonts/montserrat-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("../fonts/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("../fonts/montserrat-700.woff2") format("woff2"); }

/* Farben der YOUR Sales Buddy Corporate Identity */
:root {
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: #e2e6f0;
  --text: #141414;
  --muted: #666b78;
  --primary: #2a4eef;
  --primary-hover: #1032cf;
  --primary-soft: #e9edfd;
  --accent: #2ea3f2;
  --cta: #6eba01;
  --cta-hover: #5a9a00;
  --danger: #c93636;
  --danger-soft: #fdecec;
  --warn: #b26b00;
  --warn-soft: #fff4e0;
  --ok: #19803d;
  --ok-soft: #e5f6ea;
  --side: #0d1a5c;
  --side-text: #c9d3f5;
  --side-active: #1f37a8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-size: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
h1, h2, h3, .brand, .kpi .value, .btn, th, .nav-section, .column-head { font-family: "Montserrat", "Open Sans", Arial, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 0 0 .5rem; }
small, .muted { color: var(--muted); }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 .3em; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.1rem 1rem; color: #fff; font-weight: 700; font-size: 1.05rem; }
.brand-mark { width: 36px; height: 36px; flex-shrink: 0; display: block; }
.brand small { display: block; color: #9fb0ea; font-weight: 400; font-size: .74rem; letter-spacing: .02em; }
.brand-logo { display: block; max-width: 230px; width: 100%; height: auto; margin: 0 auto .5rem; }
.nav { padding: .25rem .6rem 1rem; flex: 1; }
.nav-section { text-transform: uppercase; font-size: .68rem; letter-spacing: .06em; color: #8798d8; margin: 1rem .6rem .35rem; }
.nav a { display: flex; align-items: center; gap: .55rem; color: var(--side-text); padding: .45rem .6rem; border-radius: 7px; font-size: .92rem; }
.nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav .ico { width: 18px; text-align: center; opacity: .85; }
.side-foot { padding: .8rem 1.1rem; border-top: 1px solid #22348a; font-size: .82rem; }
.side-foot a { color: var(--side-text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; justify-content: space-between; padding: .6rem 1rem; background: var(--side); color: #fff; }
.topbar button { background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.content { padding: 1.5rem 2rem 3rem; max-width: 1400px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 50; left: -260px; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .topbar { display: flex; }
  .content { padding: 1rem; }
}

/* ---------- Karten, Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card > h2:first-child { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 1rem 1.2rem 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .split, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); color: var(--text); display: block; }
.kpi:hover { text-decoration: none; border-color: var(--primary); }
.kpi .value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.kpi .label { color: var(--muted); font-size: .85rem; }
.kpi.warn .value { color: var(--warn); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
td.nowrap, th.nowrap { white-space: nowrap; }
.row-link { color: var(--text); font-weight: 600; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=url], input[type=search], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid #cfd6e2; border-radius: 7px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=color] { width: 3rem; height: 2.1rem; padding: 0; border: 1px solid #cfd6e2; border-radius: 6px; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: .4rem; }
textarea { resize: vertical; }
.field { margin-bottom: .9rem; }
.field .help { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.field .errors, .errorlist { color: var(--danger); font-size: .84rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.field.check label { display: flex; align-items: flex-start; font-weight: 500; }
.field ul { list-style: none; padding: 0; margin: 0; }
.field ul li label { font-weight: 500; display: flex; align-items: center; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 140px; flex: 1 1 140px; }
.filters .field.grow { flex: 2 1 220px; }
.inline-form { display: inline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .35rem; padding: .48rem .9rem; border-radius: 7px; border: 1px solid #cfd6e2;
  background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: #f0c2c2; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: .28rem .6rem; font-size: .8rem; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---------- Badges, Meldungen ---------- */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.phase { color: #fff; border: 0; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.messages { margin-bottom: 1rem; }
.msg { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .5rem; border: 1px solid transparent; }
.msg.success { background: var(--ok-soft); color: #11612d; }
.msg.info { background: var(--primary-soft); color: #1b3d99; }
.msg.warning { background: var(--warn-soft); color: #7a4a00; }
.msg.error { background: var(--danger-soft); color: #8f1f1f; }
.notice { padding: .7rem .9rem; border-radius: 8px; background: var(--warn-soft); color: #7a4a00; margin-bottom: 1rem; }
.notice.info { background: var(--primary-soft); color: #1b3d99; }
.empty { color: var(--muted); padding: 1.5rem; text-align: center; }

/* ---------- Detail / Verlauf ---------- */
dl.data { display: grid; grid-template-columns: 120px 1fr; gap: .35rem .75rem; margin: 0; }
dl.data dt { color: var(--muted); font-size: .85rem; }
dl.data dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.tl-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: .9rem; }
.tl-meta { font-size: .78rem; color: var(--muted); }
.tl-text { white-space: pre-wrap; word-break: break-word; }
.call-box { display: flex; flex-direction: column; gap: .5rem; }
.tel-link { font-size: 1.15rem; font-weight: 700; }
.outcomes { display: flex; flex-wrap: wrap; gap: .35rem; }
details summary { cursor: pointer; font-weight: 600; margin: .25rem 0; }
details[open] summary { margin-bottom: .6rem; }

/* ---------- Board ---------- */
.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.column { background: #eaeef5; border-radius: var(--radius); min-width: 250px; width: 250px; flex-shrink: 0; display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.column-head { padding: .6rem .75rem; font-weight: 700; font-size: .88rem; display: flex; justify-content: space-between; align-items: center; border-top: 4px solid var(--c, #64748b); border-radius: var(--radius) var(--radius) 0 0; }
.column-body { padding: .4rem; overflow-y: auto; flex: 1; min-height: 60px; }
.column-body.drag-over { background: #dde5f3; border-radius: 0 0 var(--radius) var(--radius); }
.bcard { background: #fff; border-radius: 8px; padding: .55rem .65rem; margin-bottom: .4rem; box-shadow: var(--shadow); cursor: grab; display: block; color: var(--text); border: 1px solid transparent; }
.bcard:hover { border-color: var(--primary); text-decoration: none; }
.bcard.dragging { opacity: .5; }
.bcard .name { font-weight: 600; font-size: .9rem; }
.bcard .meta { font-size: .76rem; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; padding: .75rem 1rem; font-size: .88rem; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(150deg, #0d1a5c 0%, #2a4eef 60%, #2ea3f2 100%); }
.auth-card { background: #fff; border-radius: 14px; padding: 2rem; width: 100%; max-width: 410px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.auth-card .brand { color: var(--text); padding: 0 0 1.25rem; }
.auth-card .brand small { color: var(--muted); }
.qr svg { width: 210px; height: 210px; display: block; margin: .5rem auto; }

/* ---------- Session-Hinweis ---------- */
#idle-warning { position: fixed; bottom: 1rem; right: 1rem; background: var(--side); color: #fff; padding: .8rem 1rem; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); display: none; z-index: 100; max-width: 320px; }
#idle-warning button { margin-top: .5rem; }

.copy-row { display: flex; gap: .4rem; align-items: center; }
.copy-row input { font-size: .82rem; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem 1rem; background: var(--primary-soft); border-bottom: 1px solid var(--border); }
.bulk-bar select { width: auto; min-width: 160px; padding: .32rem .5rem; }
.diff { font-size: .82rem; }
.diff .old { color: var(--danger); text-decoration: line-through; }
.diff .new { color: var(--ok); }

/* ---------- Aufgaben ---------- */
.task-row { display: flex; gap: .65rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.task-row:last-of-type { border-bottom: 0; }
.task-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #b8c1d6; background: #fff; cursor: pointer; display: grid; place-items: center; color: #fff; font-weight: 700; padding: 0; margin-top: 1px; }
.task-check:hover { border-color: var(--cta); }
.task-row.done .task-check { background: var(--cta); border-color: var(--cta); }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; color: var(--text); }
.btn-cta { background: var(--cta); border-color: var(--cta); color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.btn-cta:hover { background: var(--cta-hover); }
.inline-inputs input { width: auto; }
