/* Medialab Cockpit – basiert auf dem Medialab Brand Style Guide 1.0 */

:root {
  --ml-black: #000000;
  --ml-white: #FFFFFF;
  --ml-pink: #FF3DEA;
  --ml-pink-deep: #C2009F;
  --ml-pink-light: #FFE8FC;
  --ml-ink: #111111;
  --ml-grey: #6B6B6B;
  --ml-line: #E3E1DC;

  --font-display: "Comfortaa", "Nunito", "Arial Rounded MT Bold", sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;
  --maxw: 1240px;

  /* Dark (Standard) */
  --bg: #000000;
  --surface: #0D0D0D;
  --surface-2: #171717;
  --surface-3: #222222;
  --line: #262626;
  --text: #FFFFFF;
  --text-2: #A1A1A1;
  --text-3: #6B6B6B;
  --accent: var(--ml-pink);
  --accent-text: var(--ml-pink);
  --accent-soft: rgba(255, 61, 234, 0.12);
  --danger: #FF6B6B;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F6F5F2;
  --surface-3: #ECEAE5;
  --line: var(--ml-line);
  --text: var(--ml-ink);
  --text-2: var(--ml-grey);
  --text-3: #8F8F8F;
  --accent-text: var(--ml-pink-deep);
  --accent-soft: var(--ml-pink-light);
  --danger: #C62828;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: clamp(26px, 4vw, 36px); }
h2 { font-size: 20px; }
h3 { font-size: 15px; font-weight: 700; margin: 0; }
.kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-text);
}
.muted { color: var(--text-2); }
.card .display { font-size: 30px; margin-bottom: 4px; }
.small { font-size: 13px; }
.accent { color: var(--accent-text); }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  text-decoration: none; padding: 8px 14px; border-radius: 999px;
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--surface-3); }
.topbar-actions { display: flex; gap: 6px; align-items: center; }

main { max-width: var(--maxw); margin: 0 auto; padding: 32px var(--gutter) 80px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head .kicker { margin-bottom: 8px; }

/* ---------- Logo (Platzhalter bis brand/logo_*.svg da ist) ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--surface-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1; padding-bottom: 2px;
}
.logo-dot {
  position: absolute; top: -3px; right: 1px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ml-pink);
}
.logo-word { font-family: var(--font-display); font-weight: 600; font-size: 16px; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* Primär: Pink mit schwarzer Schrift – nie weiße Schrift auf Pink */
.btn-primary { background: var(--ml-pink); border-color: var(--ml-pink); color: var(--ml-black); }
.btn-primary:hover { background: #FF5CEE; border-color: #FF5CEE; }
.btn-ghost { border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid transparent; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; }

/* ---------- Karten ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }

/* ---------- Chips & Pills ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; }
.chip-count { margin-left: 6px; font-size: 11px; opacity: .7; font-weight: 500; }
.chip-static { cursor: default; height: 24px; padding: 0 10px; font-size: 12px; }
.chip-static:hover { color: var(--text-2); border-color: var(--line); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.pill.is-progress::before { background: var(--ml-pink); }
.pill.is-done { background: var(--accent-soft); color: var(--accent-text); }
.pill.is-done::before { background: var(--accent-text); }
.pill.is-paused { background: transparent; border: 1px dashed var(--text-3); color: var(--text-2); }
.pill.is-cancelled { background: transparent; color: var(--text-3); text-decoration: line-through; }
.pill.is-cancelled::before { display: none; }

.tag-billed { color: var(--accent-text); font-size: 12px; font-weight: 700; }

/* ---------- Toolbar & Formular-Elemente ---------- */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.toolbar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-row .grow { flex: 1; min-width: 180px; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  color: var(--text-2); font-weight: 500; font-size: 13px; cursor: pointer;
}
.segmented button.active { background: var(--surface-3); color: var(--text); font-weight: 700; }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 14px;
  outline: none; transition: border-color .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.toolbar .select, .toolbar .input { width: auto; min-width: 140px; }
.toolbar .input.grow { width: 100%; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ml-pink); }
:focus-visible { outline: 2px solid var(--ml-pink); outline-offset: 2px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .label { font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; height: 40px; }
.check input { width: 18px; height: 18px; accent-color: var(--ml-pink); }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }

/* ---------- Dialog ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text);
  padding: 0; width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.dialog-body { padding: 20px 24px; overflow-y: auto; }
.dialog-foot {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  padding: 16px 24px 20px; border-top: 1px solid var(--line);
}
.dialog-foot .spacer { flex: 1; }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }

/* ---------- Listen (Projekte, Kunden) ---------- */
.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.list-head, .list-row {
  display: grid; gap: 16px; align-items: center; padding: 14px 20px;
}
.list-head {
  font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); padding-top: 12px; padding-bottom: 12px;
}
.list-row { text-decoration: none; border-bottom: 1px solid var(--line); transition: background .1s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .title { font-weight: 700; }
.list-row .sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row > * { min-width: 0; }
.cell-right { text-align: right; }
.cols-projects { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) 130px 140px 100px 110px; }
.cols-projects.compact { grid-template-columns: minmax(0, 2fr) 120px 130px 96px 96px; }
.cols-clients { grid-template-columns: minmax(0, 2fr) 120px minmax(0, 1fr) 180px 90px; }
.overdue { color: var(--accent-text); font-weight: 700; }
.show-m { display: none; }

.empty {
  text-align: center; padding: 56px 20px; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--text-2);
}
.empty .display { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.empty .btn { margin-top: 16px; }

/* ---------- Kanban ---------- */
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px;
  overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory;
}
.kanban-col {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start;
  transition: border-color .15s, background .15s;
}
.kanban-col.drop-target { border-color: var(--ml-pink); background: var(--accent-soft); }
.kanban-col.is-side { opacity: .75; }
.kanban-col-head {
  display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 6px;
  font-weight: 700; font-size: 13px;
}
.kanban-col-head .count { color: var(--text-3); font-weight: 500; }
.kcard {
  display: block; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; cursor: grab;
}
.kcard:hover { border-color: var(--text-3); }
.kcard.dragging { opacity: .4; }
.kcard .title { font-weight: 700; font-size: 14px; line-height: 1.35; }
.kcard .meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-2); }

/* ---------- Detail ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; }
.kv dt { color: var(--text-2); font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-line {
  display: flex; align-items: center; gap: 8px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 8px 8px 12px;
}
.code-line span { flex: 1; overflow-wrap: anywhere; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.status-select { width: auto; height: 36px; border-radius: 999px; font-weight: 700; }
.back { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; color: var(--text-2); font-size: 13px; margin-bottom: 16px; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #000; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter); position: relative; overflow: hidden; }
.auth-deco { position: absolute; top: -120px; right: -120px; width: 360px; height: 360px; border-radius: 50%; border: 3px solid var(--surface-3); pointer-events: none; }
.auth-deco::after { content: ""; position: absolute; top: 42px; left: 26px; width: 90px; height: 90px; border-radius: 50%; background: var(--ml-pink); }
.auth-card { width: 100%; max-width: 400px; position: relative; }
.auth-card .logo { margin-bottom: 48px; }
.auth-card h1 { margin-bottom: 8px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.auth-card .btn { height: 46px; }
.qr { background: #fff; padding: 12px; border-radius: var(--radius); width: 216px; height: 216px; }
.qr img { width: 100%; height: 100%; display: block; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; color: var(--text-2); }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; }
.codes span { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; text-align: center; }
.hint { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; height: 52px; font-family: ui-monospace, Menlo, monospace; }

/* ---------- Navigation-Icons (nur mobil sichtbar) ---------- */
.nav a svg { display: none; width: 22px; height: 22px; }

/* ---------- Aufgaben ---------- */
.tasks { display: flex; flex-direction: column; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-check { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ml-pink); flex: none; cursor: pointer; }
.task-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-weight: 500; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-2); }
.task.is-done .task-title { text-decoration: line-through; color: var(--text-3); }
.prio { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 8px;
  border-radius: 50%; background: var(--ml-pink); color: var(--ml-black); font-size: 12px; font-weight: 700; vertical-align: 1px; }
.task-group { margin-top: 28px; }
.group-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.group-title .muted { font-weight: 500; margin-left: 4px; }
details.done-group summary { cursor: pointer; padding: 8px 0; list-style: none; }
details.done-group summary::-webkit-details-marker { display: none; }
details.done-group summary::before { content: "▸ "; color: var(--text-3); }
details.done-group[open] summary::before { content: "▾ "; }
.quick-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.quick-add .input, .quick-add .select { width: auto; }
.quick-add .grow { flex: 1; min-width: 200px; }
.quick-add.compact .input[type=date] { width: 150px; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.2; margin: 6px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12px; color: var(--text-3); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-grid .card + .card { margin-top: 0; }
.events { display: flex; flex-direction: column; }
.event { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px;
  border-bottom: 1px solid var(--line); text-decoration: none; }
.event:last-child { border-bottom: 0; }
.event:hover .event-title { text-decoration: underline; }
.event-date { font-weight: 700; font-size: 13px; }
.event-main { display: flex; flex-direction: column; min-width: 0; }
.event-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-section { margin-top: 32px; }
.area-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.area-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; transition: border-color .15s; }
.area-tile:hover { border-color: var(--text-3); }
.area-tile.is-empty { opacity: .55; }
.area-count { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.1; }
.area-name { font-weight: 700; }

/* ---------- Einstellungen & Ordner ---------- */
.icon-btn.active { color: var(--text); background: var(--surface-3); }
.sub-title { margin: 24px 0 10px; }
.card-title.spaced { margin-top: 28px; margin-bottom: 10px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.steps .code-line { margin-top: 8px; }
.rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); text-decoration: none; }
.row:last-child { border-bottom: 0; }
.row .title { font-weight: 500; }
.row > div { min-width: 0; }
.row.is-revoked { opacity: .5; }
.folder-body { margin-top: 14px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.label + .code-line { margin-top: 6px; }
.spinner { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface-3);
  border-top-color: var(--ml-pink); animation: spin 0.8s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- Startseite ---------- */
.hero { margin: 8px 0 32px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 44px); margin-top: 8px; }
.hero-sub { margin: 12px 0 0; color: var(--text-2); font-size: 15px; }
.dash-section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; }
.section-head .count, .card-title .count { font-family: var(--font-body); font-size: 14px; font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.link-quiet { text-decoration: none; white-space: nowrap; }
.link-quiet:hover { color: var(--text); }
.section-note { margin: 12px 0 4px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pcard { display: flex; flex-direction: column; gap: 4px; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--text-3); transform: translateY(-1px); }
.pcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.pcard-title { font-weight: 700; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.pcard .meter { margin: 14px 0 6px; height: 4px; }
.pcard-foot { display: flex; justify-content: space-between; gap: 8px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; }
.week-day { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; min-height: 140px; border-right: 1px solid var(--line); min-width: 0; }
.week-day:last-child { border-right: 0; }
.week-day.is-past { background: var(--surface-2); }
.week-day.is-past .week-post { opacity: .6; }
.week-date { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.week-num { font-family: var(--font-display); font-size: 15px; color: var(--text); text-transform: none; letter-spacing: 0; }
.week-day.is-today .week-num { background: var(--ml-pink); color: var(--ml-black); border-radius: 999px; padding: 1px 8px; }
.week-posts { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.week-none { color: var(--text-3); font-size: 13px; }
.week-post { display: flex; flex-direction: column; gap: 1px; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--text-3); border-radius: 6px; padding: 6px 8px; }
.week-post:hover { border-color: var(--text-3); }
.week-post.st-produktion, .week-post.st-freigabe { border-left-color: var(--ml-pink-deep); }
.week-post.st-geplant { border-left-color: var(--ml-pink); }
.week-post.st-veroeffentlicht { opacity: .55; border-left-color: var(--accent-text); }
.week-post-title { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-post-meta { font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Termine ---------- */
button.event { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.events button.event:last-child { border-bottom: 0; }
.event { grid-template-columns: 92px minmax(0, 1fr) auto; }
.event-date { display: flex; flex-direction: column; gap: 2px; }
.event-time { font-weight: 500; font-size: 12px; color: var(--text-2); }
.section-note.first { margin-top: -8px; margin-bottom: 8px; }
.kind-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.kind-tag::before, .radio-chips .check-chip[class*="kind-"] span::before, .radio-chips .check-chip[class*="st-"] span::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.radio-chips .check-chip[class*="kind-"] span, .radio-chips .check-chip[class*="st-"] span { gap: 8px; }
.kind-dreh::before, .check-chip.kind-dreh span::before { background: var(--ml-pink) !important; }
.kind-shooting::before, .check-chip.kind-shooting span::before { background: var(--ml-pink-deep) !important; }
.kind-meeting::before, .check-chip.kind-meeting span::before, .kind-kunde::before, .check-chip.kind-kunde span::before { background: var(--text) !important; }
.kind-deadline::before, .check-chip.kind-deadline span::before { background: transparent !important; border: 2px solid var(--accent-text); width: 6px; height: 6px; }
.check-chip.st-produktion span::before, .check-chip.st-fertig span::before, .check-chip.st-freigabe span::before { background: var(--ml-pink-deep) !important; }
.check-chip.st-geplant span::before { background: var(--ml-pink) !important; }
.check-chip.st-veroeffentlicht span::before { background: var(--accent-text) !important; opacity: .5; }
.radio-chips .check-chip input:checked + span::before { box-shadow: 0 0 0 2px var(--bg); }
.more-details { border-top: 1px solid var(--line); padding-top: 12px; }
.more-details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-2); list-style: none; }
.more-details summary::before { content: "▸ "; }
.more-details[open] summary::before { content: "▾ "; }
.more-details[open] summary { margin-bottom: 14px; }
.week-add { display: flex; align-items: center; justify-content: center; height: 28px; border: 1px dashed var(--line); border-radius: 6px;
  background: transparent; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity .15s; }
.week-add svg { width: 14px; height: 14px; }
.week-day:hover .week-add, .week-add:focus-visible, .week-day.is-empty .week-add { opacity: 1; }
.week-add:hover { color: var(--text); border-color: var(--text-3); }
button.week-post { text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.week-post.st-fertig { border-left-color: var(--ml-pink-deep); }
.cal-item.st-fertig { border-left-color: var(--ml-pink-deep); }

/* ---------- Vertrieb & KPIs ---------- */
.mrr-list { display: flex; flex-direction: column; margin-top: 10px; border-top: 1px solid var(--line); }
.mrr-list a { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; text-decoration: none; border-bottom: 1px solid var(--line); }
.mrr-list a:last-child { border-bottom: 0; }
.mrr-list a:hover { color: var(--accent-text); }
.recurring-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; }
.stat-target { font-size: 18px; color: var(--text-3); }
/* Fortschritt: Füllung Pink, Spur = hellere Stufe derselben Farbe */
.meter { --pct: 0%; height: 6px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin: 10px 0 8px; }
.meter span { display: block; height: 100%; width: var(--pct); background: var(--ml-pink); border-radius: 999px; transition: width .4s ease; }
.goal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.cols-leads { grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1.6fr) 140px 100px; }
.next-step { margin-top: 6px; color: var(--text-2); }
.next-step-big { font-size: 22px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.timeline li { position: relative; display: flex; justify-content: space-between; gap: 8px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--surface); }
.timeline li:last-child::before { background: var(--ml-pink); }
.row-btn { width: 100%; background: transparent; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.row-btn:hover { background: var(--surface-2); }
.display-sm { font-family: var(--font-display); font-weight: 700; font-size: 18px; white-space: nowrap; }

/* ---------- Rechnungen ---------- */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.card .rows + .small { margin: 10px 0 0; }
.card .rows + .small + .select, .card p + .select { margin-top: 10px; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.row-end { display: flex; align-items: center; gap: 10px; flex: none; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- Social Media ---------- */
.month-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.month-label { font-family: var(--font-display); font-weight: 700; font-size: 16px; min-width: 150px; text-align: center; }
.cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cal-head span { padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .cal-day { min-height: 118px; padding: 6px; gap: 4px; border: 0; border-radius: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: transparent; scroll-snap-align: none; cursor: pointer; }
.cal .cal-day:nth-child(7n) { border-right: 0; }
.cal .cal-day.is-other { background: var(--surface-2); }
.cal .cal-day.is-other .cal-date { color: var(--text-3); }
.cal .cal-day:hover { background: var(--surface-2); }
.cal .cal-day.drop-target { background: var(--accent-soft); border-color: var(--line); }
.cal-date { font-size: 12px; font-weight: 700; padding: 2px 4px; }
.cal-day.is-today .cal-date span:last-child { background: var(--ml-pink); color: var(--ml-black); border-radius: 999px; padding: 2px 7px; }
.cal-item { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface-2);
  border-left: 3px solid var(--text-3); border-radius: 6px; padding: 4px 6px; cursor: grab; font: inherit; color: inherit; }
.cal-item:hover { border-color: var(--text-3); }
.cal-item-title { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item-meta { font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item.st-produktion, .cal-item.st-freigabe { border-left-color: var(--ml-pink-deep); }
.cal-item.st-geplant { border-left-color: var(--ml-pink); }
.cal-item.st-veroeffentlicht { opacity: .55; border-left-color: var(--accent-text); }
.cols-content { grid-template-columns: 110px minmax(0, 2fr) 130px minmax(0, 1fr) 170px; }
.select-sm { height: 32px; font-size: 13px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.plan-cards .card + .card { margin-top: 0; }
.plan-card { text-decoration: none; transition: border-color .15s; }
.plan-card:hover { border-color: var(--text-3); }
.plan-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.plan-stats > div { display: flex; flex-direction: column; }
.pillars { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.focus-list { display: flex; flex-direction: column; }
.focus-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.focus-row:last-child { border-bottom: 0; }
.focus-month { font-weight: 700; padding-top: 10px; }
.focus-input { min-height: 44px; }
.print-only { display: none; }
.spaced-top { margin-top: 24px; margin-bottom: 8px; }
.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; cursor: pointer; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13px; color: var(--text-2); }
.check-chip input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; }
.check-chip input:focus-visible + span { outline: 2px solid var(--ml-pink); outline-offset: 2px; }

.client-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-section .client-switch { margin-bottom: 12px; }

/* ---------- Drucken (Fahrplan für Kunden) ---------- */
@media print {
  :root, :root[data-theme="light"] {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #eee; --line: #E3E1DC;
    --text: #111; --text-2: #555; --text-3: #777; --accent-text: #C2009F; --accent-soft: #FFE8FC;
  }
  body { background: #fff; color: #111; font-size: 12px; }
  .topbar, .nav, .no-print, .toast, .back, select, .month-nav { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { break-inside: avoid; border-color: #ddd; }
  .page-break { break-before: page; }
  .focus-input { display: none; }
  .print-only { display: block; }
  .detail-grid { grid-template-columns: 1.4fr 1fr; }
  .list-head { display: grid; }
  .list-row .hide-m { display: block; }
  .list-row .show-m { display: none; }
  .focus-month { padding-top: 0; }
  .print-brand { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; padding-bottom: 12px; border-bottom: 1px solid #E3E1DC; }
  .print-brand .logo-mark { border-color: #ccc; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 16mm; }
}

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  main { padding-top: 24px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  /* Navigation als Leiste unten. backdrop-filter am Header würde position:fixed einsperren → aus */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; gap: 0;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; font-size: 11px; flex: 1; }
  .nav a svg { display: block; }
  .nav a.active { background: transparent; color: var(--text); }
  .nav a.active svg { color: var(--ml-pink); }
  .topbar-inner { justify-content: space-between; }
  .logo-word { display: inline; }
  .stats { grid-template-columns: 1fr 1fr; }
  .goal-grid { grid-template-columns: 1fr; }
  .list-row.cols-leads { grid-template-columns: 76px minmax(0, 1fr); }
  .list-row.cols-content { grid-template-columns: 76px minmax(0, 1fr); }
  .month-nav { margin-left: 0; width: 100%; justify-content: space-between; }
  /* Kalender wird zur Tagesliste: nur Tage mit Beiträgen */
  .cal-head { display: none; }
  .cal-grid { display: block; }
  .cal .cal-day { min-height: 0; border-right: 0; padding: 10px 12px; }
  .cal .cal-day.is-empty, .cal .cal-day.is-other { display: none; }
  .cal-date .show-m { display: inline; }
  .cal-date .hide-m { display: none; }
  .cal-grid:not(:has(.cal-day:not(.is-empty):not(.is-other)))::after { content: "Keine Beiträge in diesem Monat."; display: block; padding: 24px; text-align: center; color: var(--text-2); }
  .focus-row { grid-template-columns: 1fr; gap: 6px; }
  .focus-month { padding-top: 0; }
  .plan-cards { grid-template-columns: 1fr; }
  .stat-target { font-size: 14px; }
  .nav a { font-size: 10px; padding: 6px 2px; }
  .stat-value { font-size: 24px; }
  .dash-grid { grid-template-columns: 1fr; }
  .hero { margin-bottom: 24px; }
  .dash-section { margin-top: 32px; }
  .pcards { grid-template-columns: 1fr; }
  /* Social-Woche als Tagesliste: nur Tage mit Posts */
  .week { display: block; }
  .week-day { flex-direction: row; gap: 12px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .week-day:last-child { border-bottom: 0; }
  .week-add { opacity: 1; }
  .week-date { width: 44px; flex: none; flex-direction: column; gap: 2px; margin: 0; }
  .week-posts { flex: 1; }
  .section-head { flex-wrap: wrap; row-gap: 4px; }
  .section-head h2 { font-size: 20px; }
  .section-head .count { display: block; margin: 4px 0 0; }
  .event { grid-template-columns: 76px minmax(0, 1fr); }
  .event .chip, .event .kind-tag { display: none; }
  .quick-add .grow { flex-basis: 100%; }
  .quick-add .input, .quick-add .select { flex: 1; }
  .hide-s { display: none; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .topbar-inner { gap: 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .list-head { display: none; }
  .list-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; }
  .list-row .hide-m { display: none; }
  .list-row .show-m { display: block; }
  .list-row .cell-right { text-align: right; }
  .kanban { grid-auto-columns: 82vw; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .dialog-head, .dialog-body, .dialog-foot { padding-left: 18px; padding-right: 18px; }
  .toolbar-row .grow { flex-basis: 100%; }
  .toolbar .select { flex: 1 1 40%; min-width: 0; }
  .toolbar #count { display: none; }
  .chips.scroll-m { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); scrollbar-width: none; }
  .chips.scroll-m::-webkit-scrollbar { display: none; }
}
