/* KM CRM – Oberfläche im Stil des Design-Guides v53 (hell, Gilroy, Markenblau/Violett als Akzent) */
@font-face { font-family: "Gilroy"; src: url("/fonts/Gilroy-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("/fonts/Gilroy-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("/fonts/Gilroy-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --bg: #f7f9fe; --bg-alt: #e9edf8; --panel: #ffffff;
  --ink: #101733; --body: #3f486b; --muted: #5f6787;
  --line: #d3daee; --line-strong: #aeb8d8; --line-input: #7e89b3;
  --accent-700: #1a2e8f; --accent-600: #2340b8; --accent-500: #3a5cff; --accent-400: #6d8bff; --accent-100: #e6ecff; --accent-50: #f0f4ff;
  --violet-600: #6a48d7; --violet-100: #efe9ff;
  --dark: #070c20; --star: #f6b73c;
  --ok: #1f8a4c; --ok-100: #e3f5ea; --warn: #b26a00; --warn-100: #fff3dc; --bad: #b3261e; --bad-100: #fde8e6;
  --shadow-s: 0 1px 2px rgba(16,23,51,.06); --shadow-m: 0 10px 30px -14px rgba(16,23,51,.18);
  --r-card: 8px; --r-small: 6px; --r-input: 4px;
  --font: "Gilroy", -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--body); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.15rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 500; }
a { color: var(--accent-600); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 .75rem; }
.num, td.num, .stat b { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.ink { color: var(--ink); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .25rem; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .35rem .5rem 1.1rem; }
.brand .mark { width: 36px; height: 36px; border-radius: var(--r-small); background: var(--dark); display: grid; place-items: center; flex: none; }
.brand .mark svg { width: 24px; height: 24px; }
.brand b { color: var(--ink); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; display: block; line-height: 1.1; }
.brand span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--r-small); position: relative; color: var(--body); font-weight: 500; font-size: .95rem; }
.nav a:hover { background: var(--accent-50); text-decoration: none; color: var(--accent-700); }
.nav a.active { background: var(--accent-100); color: var(--accent-700); }
.nav a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav .sep { height: 1px; background: var(--line); margin: .6rem .5rem; }
/* »Ansicht als«: Admin prüft, was ein Mitarbeiter sieht */
.viewas { margin: .5rem 0 .25rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--r-small); background: var(--bg-alt); }
.viewas .lbl { display: block; font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: .25rem; }
.viewas select { width: 100%; font-size: .85rem; padding: .35rem .4rem; }
.viewas.on { border-color: var(--warn); background: #fff8ec; }
.viewas-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; padding: .7rem .9rem; border: 1px solid var(--warn); border-radius: var(--r-card); background: #fff8ec; color: var(--warn); }
.viewas-bar b { color: var(--ink); }
.viewas-bar span { color: var(--muted); font-size: .85rem; flex: 1; min-width: 12rem; }
.viewas-bar .btn { margin-left: auto; }
.nav .grp { font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: .9rem .7rem .25rem; }
.nav .grp:first-child { margin-top: .2rem; }
.sidebar a.me { color: inherit; border-radius: var(--r-small); }
.sidebar a.me:hover, .sidebar a.me.active { text-decoration: none; background: var(--accent-50); }
.sidebar a.me.active b { color: var(--accent-700); }
/* Tabs innerhalb einer Seite */
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin: -.4rem 0 1.1rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; font-size: .92rem; white-space: nowrap; }
.tabs a:hover { color: var(--accent-700); text-decoration: none; }
.tabs a.active { color: var(--accent-700); border-bottom-color: var(--accent-600); }
.tabs a .cnt { display: inline-block; margin-left: .4rem; min-width: 1.35em; padding: 0 .35em; border-radius: var(--r-input); background: var(--bg-alt); color: var(--body); font-size: .74rem; text-align: center; line-height: 1.5; }
.tabs a.active .cnt { background: var(--accent-100); color: var(--accent-700); }
/* Einstellungen: gruppierte Unternavigation links */
.subnav { display: flex; flex-direction: column; gap: .1rem; position: sticky; top: 1rem; }
.subnav .grp { font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: .8rem .6rem .2rem; }
.subnav .grp:first-child { margin-top: 0; }
.subnav a { padding: .42rem .6rem; border-radius: var(--r-small); color: var(--body); font-size: .9rem; }
.subnav a:hover { background: var(--accent-50); text-decoration: none; }
.subnav a.active { background: var(--accent-100); color: var(--accent-700); font-weight: 500; }
.grid.settings { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.grid.settings .grid.c2 { grid-template-columns: 1fr; }
/* Kompakte Statuszeilen (Cockpit rechts) */
.status-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.status-list li:last-child { border-bottom: 0; }
.status-list .n { font-weight: 800; color: var(--ink); min-width: 2ch; text-align: right; font-size: 1.05rem; }
.status-list .n.bad { color: var(--bad); }
.status-list .n.warn { color: var(--warn); }
.status-list a.more { margin-left: auto; font-size: .82rem; white-space: nowrap; }
.nav .badge { margin-left: auto; }
.sidebar .me { margin-top: auto; padding: .8rem .7rem; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .6rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-100); color: var(--accent-700); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.me b { display: block; color: var(--ink); font-weight: 500; font-size: .9rem; line-height: 1.15; }
.me span { color: var(--muted); font-size: .78rem; text-transform: capitalize; }
.me button { margin-left: auto; }
main { padding: 1.6rem 2rem 3rem; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: .2rem; }
.eyebrow { display: flex; align-items: center; gap: .6rem; font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .15em; color: var(--accent-600); margin-bottom: .4rem; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent-600); }
.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* Buttons (Pill + Knob = Markenelement) */
.btn { display: inline-flex; align-items: center; gap: .6rem; background: var(--accent-600); color: #fff; font: 500 .95rem var(--font); padding: .38rem 1.2rem .38rem .38rem; border-radius: 999px; border: 0; cursor: pointer; box-shadow: var(--shadow-s); transition: background .18s, box-shadow .18s, transform .1s; white-space: nowrap; }
.btn .knob { width: 1.85rem; height: 1.85rem; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.btn .knob svg { width: 1rem; height: 1rem; stroke: var(--accent-600); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--accent-700); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.ghost .knob { background: var(--accent-100); }
.btn.ghost:hover { border-color: var(--accent-400); background: var(--accent-50); }
.btn.plain { padding: .55rem 1.2rem; }
.btn.sm { font-size: .86rem; padding: .3rem .9rem .3rem .3rem; }
.btn.sm .knob { width: 1.5rem; height: 1.5rem; }
.btn.sm.plain { padding: .4rem .9rem; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #8e1d17; }
.btn.violet { background: var(--violet-600); }
.btn.violet .knob svg { stroke: var(--violet-600); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.link-btn { background: none; border: 0; color: var(--accent-600); font: 500 .9rem var(--font); cursor: pointer; padding: .2rem .3rem; border-radius: var(--r-input); }
.link-btn:hover { background: var(--accent-50); }
.link-btn.danger { color: var(--bad); }
.icon-btn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-input); width: 30px; height: 30px; display: inline-grid; place-items: center; cursor: pointer; color: var(--body); }
.icon-btn:hover { border-color: var(--accent-400); color: var(--accent-700); }
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Cards, Grids, Stats */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.25rem 1.4rem; box-shadow: var(--shadow-s); }
.card + .card { margin-top: 1rem; }
.card h2 { margin-bottom: .8rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1rem 1.2rem; box-shadow: var(--shadow-s); }
.stat .lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; }
.stat b { display: block; will-change: contents; color: var(--ink); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-top: .2rem; }
.stat .sub { color: var(--muted); font-size: .84rem; margin-top: .15rem; }
.stat.accent { background: var(--accent-600); border-color: var(--accent-600); position: relative; overflow: hidden; }
.stat.accent::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.08); animation: pulse-soft 6s ease-in-out infinite; }
.stat.accent .lbl, .stat.accent .sub { color: #dfe6ff; }
.stat.accent b { color: #fff; }
.stat.violet { background: var(--violet-100); border-color: #e0d5ff; }
.stat.violet b { color: var(--violet-600); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; padding: .55rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.row-link { cursor: pointer; }
tbody tr.row-link:hover td { background: var(--accent-50); }
td .sub { display: block; color: var(--muted); font-size: .82rem; }
td.num, th.num { text-align: right; }
.strong { color: var(--ink); font-weight: 500; }

/* Badges / Stages */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem; border-radius: var(--r-input); font-size: .76rem; font-weight: 500; background: var(--bg-alt); color: var(--body); white-space: nowrap; }
.badge.neu { background: var(--accent-100); color: var(--accent-700); }
.badge.kontaktiert { background: #e6f0ff; color: #1d4ed8; }
.badge.termin { background: var(--violet-100); color: var(--violet-600); }
.badge.angebot { background: var(--warn-100); color: var(--warn); }
.badge.auftrag, .badge.live, .badge.abo, .badge.ok, .badge.ausgezahlt, .badge.bestaetigt, .badge.erledigt { background: var(--ok-100); color: var(--ok); }
.badge.verloren, .badge.storniert, .badge.gekuendigt, .badge.bad, .badge.abgesagt, .badge.nicht_erschienen { background: var(--bad-100); color: var(--bad); }
.badge.fragebogen, .badge.entwurf, .badge.freigabe, .badge.abgerechnet, .badge.gebucht { background: var(--accent-50); color: var(--accent-700); border: 1px solid var(--accent-100); }
.badge.offen { background: var(--warn-100); color: var(--warn); }
.badge.src { background: var(--bg-alt); color: var(--muted); }
.badge.pool { background: var(--violet-100); color: var(--violet-600); }
.badge.liga { font-variant-numeric: tabular-nums; }
.badge.liga.l1 { background: #fdeccc; color: #8a5a00; }
.badge.liga.l2 { background: #e3e7f2; color: var(--ink); }
.badge.liga.l3 { background: var(--bg-alt); color: var(--muted); }
.badge.liga.l4 { background: var(--bg-alt); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--accent-500); }

/* Forms */
label { display: block; font-size: .82rem; font-weight: 500; color: var(--ink); margin-bottom: .25rem; }
input, select, textarea { width: 100%; font: 400 .95rem var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line-input); border-radius: var(--r-input); padding: .55rem .75rem; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-600); box-shadow: 0 0 0 3px var(--accent-100); }
input[type="checkbox"], input[type="radio"] { width: auto; margin-right: .4rem; vertical-align: -1px; }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.help { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-width: 150px; padding: .45rem .7rem; }
.filters input[type="search"] { min-width: 220px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--panel); border-radius: var(--r-input); padding: .3rem .8rem; font: 500 .84rem var(--font); cursor: pointer; color: var(--body); }
.chip.active { background: var(--accent-600); color: #fff; border-color: var(--accent-600); }
.chip:hover:not(.active) { border-color: var(--accent-400); }

/* Alerts */
.alert { padding: .7rem 1rem; border-radius: var(--r-small); font-size: .9rem; margin-bottom: 1rem; border: 1px solid; }
.alert.bad { background: var(--bad-100); border-color: #f4c5c1; color: var(--bad); }
.alert.ok { background: var(--ok-100); border-color: #bfe6cd; color: var(--ok); }
.alert.info { background: var(--accent-50); border-color: var(--accent-100); color: var(--accent-700); }
.note-box { background: var(--accent-50); border: 1px solid var(--accent-100); border-left: 3px solid var(--accent-600); border-radius: var(--r-small); padding: .8rem 1rem; font-size: .9rem; }

/* Modal / Drawer */
.overlay { position: fixed; inset: 0; background: rgba(16,23,51,.35); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { background: var(--panel); border-radius: var(--r-card); width: min(680px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow-m); padding: 1.5rem 1.6rem; }
.modal.wide { width: min(920px, 100%); }
.modal h2 { margin-bottom: 1rem; }
.modal .foot { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.toast { position: fixed; bottom: 1.2rem; right: 1.2rem; background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: var(--r-small); font-size: .9rem; box-shadow: var(--shadow-m); z-index: 60; }
.toast.bad { background: var(--bad); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login { width: min(420px, 100%); }
.login .brand { padding: 0 0 1.2rem; }

/* Pipeline / Kanban */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: .8rem; overflow-x: auto; padding-bottom: .5rem; }
.kcol { background: var(--bg-alt); border-radius: var(--r-small); padding: .7rem; min-height: 200px; }
.kcol h3 { display: flex; justify-content: space-between; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .2rem .3rem .6rem; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-small); padding: .6rem .7rem; margin-bottom: .55rem; cursor: pointer; box-shadow: var(--shadow-s); }
.kcard:hover { border-color: var(--accent-400); }
.kcard b { display: block; color: var(--ink); font-weight: 500; font-size: .9rem; }
.kcard .sub { color: var(--muted); font-size: .8rem; display: block; }
.kcard .meta { display: flex; gap: .4rem; margin-top: .4rem; flex-wrap: wrap; }

/* Timeline (Aktivitäten) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .ico { width: 26px; height: 26px; border-radius: var(--r-input); background: var(--accent-50); border: 1px solid var(--accent-100); display: grid; place-items: center; }
.timeline .ico svg { width: 14px; height: 14px; stroke: var(--accent-600); fill: none; stroke-width: 2; }
.timeline .ico.fonio { background: var(--violet-100); border-color: #e0d5ff; }
.timeline .ico.fonio svg { stroke: var(--violet-600); }
.timeline .when { color: var(--muted); font-size: .8rem; }
.timeline .txt { color: var(--body); white-space: pre-wrap; }
.timeline .done .txt { text-decoration: line-through; color: var(--muted); }

/* Calendar week view */
.cal { display: grid; grid-template-columns: 56px repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--panel); }
.cal .hd { padding: .6rem .5rem; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.cal .hd b { display: block; color: var(--ink); font-size: 1rem; font-weight: 800; }
.cal .hd.today b { color: var(--accent-600); }
.cal .col { border-left: 1px solid var(--line); position: relative; height: var(--cal-h, 560px); touch-action: none; }
.cal .col[data-day] { cursor: crosshair; }
.cal .sel { position: absolute; left: 4px; right: 4px; background: var(--accent-100); border: 1px dashed var(--accent-600); color: var(--accent-700); border-radius: var(--r-input); font-size: .74rem; font-weight: 500; padding: 1px 5px; pointer-events: none; overflow: hidden; z-index: 3; }
.cal .col.times { border-left: 0; }
.cal .hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--bg-alt); font-size: .72rem; color: var(--muted); padding: 2px 6px; }
.cal .ev { position: absolute; left: 4px; right: 4px; border-radius: var(--r-input); padding: .25rem .45rem; font-size: .76rem; line-height: 1.25; overflow: hidden; cursor: pointer; border: 1px solid transparent; }
.cal .ev b { display: block; color: inherit; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.gebucht { background: var(--accent-100); color: var(--accent-700); border-color: #cdd8ff; }
.cal .ev.bestaetigt { background: var(--ok-100); color: var(--ok); }
.cal .ev.abgesagt { background: var(--bad-100); color: var(--bad); text-decoration: line-through; }
.cal .ev.erledigt, .cal .ev.nicht_erschienen { background: var(--bg-alt); color: var(--muted); }
.cal .ev.fonio { border-left: 3px solid var(--violet-600); }
.cal .ev.restricted { background: repeating-linear-gradient(45deg, var(--bg-alt), var(--bg-alt) 6px, #f3f5fb 6px, #f3f5fb 12px); color: var(--muted); }
.cal .blk { position: absolute; left: 4px; right: 4px; background: repeating-linear-gradient(45deg, #fff3dc, #fff3dc 6px, #ffe9c2 6px, #ffe9c2 12px); color: var(--warn); border-radius: var(--r-input); font-size: .74rem; padding: .25rem .45rem; }
.slots { display: flex; flex-wrap: wrap; gap: .4rem; }
.slots .chip.busy { opacity: .4; pointer-events: none; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li .grow { flex: 1; min-width: 0; }
.list li b { color: var(--ink); font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li .sub { color: var(--muted); font-size: .82rem; display: block; }
.empty { color: var(--muted); font-size: .9rem; padding: .6rem 0; }

/* Top-Seller */
.rank { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; background: var(--bg-alt); color: var(--muted); }
.rank.r1 { background: var(--star); color: var(--ink); }
.rank.r2 { background: #e3e7f2; color: var(--ink); }
.rank.r3 { background: #f2e7d9; color: var(--ink); }
.bar { height: 8px; background: var(--bg-alt); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent-600); border-radius: 2px; transform-origin: left; animation: grow-x .7s cubic-bezier(.2,.7,.2,1) both; }
.bar.violet i { background: var(--violet-600); }

/* Steps (Projektstatus) */
.steps { display: flex; gap: .3rem; flex-wrap: wrap; }
.steps span { padding: .25rem .6rem; border-radius: var(--r-input); font-size: .76rem; background: var(--bg-alt); color: var(--muted); }
.steps span.done { background: var(--ok-100); color: var(--ok); }
.steps span.cur { background: var(--accent-600); color: #fff; }

/* Bars chart (Provision je Monat) */
.bars { display: grid; grid-auto-flow: column; align-items: end; gap: .45rem; height: 130px; padding-top: .5rem; }
.bars div { background: var(--accent-100); border-radius: 3px 3px 0 0; position: relative; min-height: 3px; }
.bars div.cur { background: var(--accent-600); }
.bars div span { position: absolute; bottom: -1.3rem; left: 0; right: 0; text-align: center; font-size: .68rem; color: var(--muted); }
.bars-wrap { padding-bottom: 1.4rem; }

kbd { font: .8rem/1 ui-monospace, Menlo, monospace; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: .15rem .4rem; color: var(--ink); }
code { font: .86rem ui-monospace, Menlo, monospace; background: var(--bg-alt); padding: .1rem .35rem; border-radius: 5px; color: var(--ink); }
pre { background: var(--dark); color: #eef2ff; padding: 1rem; border-radius: var(--r-small); overflow: auto; font-size: .82rem; }
.demo-bar { background: var(--violet-600); color: #fff; font-size: .84rem; padding: .45rem 1rem; display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.demo-bar select { width: auto; padding: .2rem .5rem; font-size: .84rem; border-radius: 8px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem; padding: .7rem .8rem; }
  .brand { padding: .2rem .4rem; }
  .nav { display: flex; flex-wrap: wrap; gap: .2rem; }
  .nav a { padding: .4rem .6rem; font-size: .86rem; }
  .nav .sep, .nav .grp { display: none; }
  .grid.settings { grid-template-columns: 1fr; }
  .subnav { position: static; flex-direction: row; flex-wrap: wrap; }
  .subnav .grp { display: none; }
  .sidebar .me { margin: 0 0 0 auto; border: 0; padding: 0; }
  main { padding: 1rem; }
  .grid.c2, .grid.c3, .grid.c4, .grid.side { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(6, 220px); }
  .cal { grid-template-columns: 40px repeat(6, minmax(0, 1fr)); }
}
@media print { .sidebar, .actions, .filters, .demo-bar { display: none !important; } .shell { display: block; } main { padding: 0; } }

/* ---------- Bewegung (dezent, einmalig; aus bei reduced-motion) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pulse-soft { 0%, 100% { transform: scale(1); opacity: .6; } 50% { transform: scale(1.35); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
main > * { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
main > *:nth-child(2) { animation-delay: .05s; } main > *:nth-child(3) { animation-delay: .1s; } main > *:nth-child(4) { animation-delay: .15s; } main > *:nth-child(5) { animation-delay: .2s; }
.grid > .stat, .grid > .card, .kanban > .kcol { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.grid > :nth-child(1) { animation-delay: .06s; } .grid > :nth-child(2) { animation-delay: .12s; } .grid > :nth-child(3) { animation-delay: .18s; } .grid > :nth-child(4) { animation-delay: .24s; }
.kanban > :nth-child(1) { animation-delay: .05s; } .kanban > :nth-child(2) { animation-delay: .1s; } .kanban > :nth-child(3) { animation-delay: .15s; } .kanban > :nth-child(4) { animation-delay: .2s; } .kanban > :nth-child(5) { animation-delay: .25s; } .kanban > :nth-child(6) { animation-delay: .3s; }
.bars div { transform-origin: bottom; animation: grow-y .7s cubic-bezier(.2,.7,.2,1) both; }
.bars div:nth-child(n) { animation-delay: calc(var(--i, 0) * 40ms); }
.modal { animation: pop .22s cubic-bezier(.2,.7,.2,1) both; }
.overlay { animation: rise .2s ease both; }
.toast { animation: pop .25s cubic-bezier(.2,.7,.2,1) both; }
.login { animation: pop .5s cubic-bezier(.2,.7,.2,1) both; }
.cal .ev, .cal .blk { animation: pop .35s cubic-bezier(.2,.7,.2,1) both; }
.nav a::before { content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; border-radius: 2px; background: var(--accent-600); transform: scaleY(0); transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.nav a.active::before { transform: scaleY(1); }
.card, .stat { transition: border-color .18s, box-shadow .18s; }
.card:hover, .stat:hover { border-color: var(--line-strong); box-shadow: var(--shadow-m); }
.kcard { transition: border-color .15s, box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: var(--shadow-m); }
.kcard.dragging { opacity: .5; }
.row-link td { transition: background .12s; }
.chip { transition: background .15s, border-color .15s, color .15s; }
.rank.r1 { animation: pop .6s cubic-bezier(.2,.7,.2,1) .3s both; }
.timeline li { animation: rise .35s cubic-bezier(.2,.7,.2,1) both; }
.timeline li:nth-child(2) { animation-delay: .04s; } .timeline li:nth-child(3) { animation-delay: .08s; } .timeline li:nth-child(4) { animation-delay: .12s; } .timeline li:nth-child(5) { animation-delay: .16s; }
.steps span.cur { animation: pop .4s cubic-bezier(.2,.7,.2,1) .2s both; }
.brand .mark svg path { stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 1.4s cubic-bezier(.2,.7,.2,1) .2s forwards; }
.brand .mark svg path:nth-child(3) { animation-delay: .5s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
