/* Praxisbereich, Leitstand, Start- und Postfach-Seite
   Gestaltung nach der Prameda-Marke: Nachtgrün für die Navigation, Waldgrün für Schaltflächen, Mint für Flächen.
   Bunte Farben tragen Bedeutung (Behandler, Stationen, Abwesenheitsarten).
   Schrift: Inter Tight (SIL Open Font License, selbst gehostet – keine Verbindung zu Google). */
@font-face { font-family: "Inter Tight"; src: url("/static/shared/intertight.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  /* Prameda-Farben (marke/MARKE.md): Nachtgrün, Waldgrün, Mint – dazu Signalfarben mit Bedeutung */
  --tinte: #071719; --tinte-2: #17281f; --tinte-ink: #eef2ef; --tinte-muted: #9fb2a7;
  --brand: #17281f; --brand-dark: #263c31; --brand-ink: #fff; --brand-soft: #eef2ef; --mint: #cfd9d2;
  --sonne: #ffcf5c; --sonne-soft: #fff6dc; --koralle: #f0605d; --flieder: #7464d6;
  --ink: #161616; --muted: #5b6760; --line: #e2e8e4; --line-2: #ccd6cf; --bg: #f4f6f4; --card: #fff; --soft: #eef2ef; --field-bg: #f7f9f8;
  --warn: #fff3dc; --warn-ink: #7a4a00; --err: #fdecec; --err-ink: #a12020; --ok: #e5f6ec; --ok-ink: #11643a;
  --k-urlaub: #22a06b; --k-krank: #e5484d; --k-fortbildung: #7464d6; --k-schule: #0ea5e9; --k-sonstiges: #8796a8; --k-geschlossen: #475569; --k-feiertag: #94a3b8;
  --radius: 14px; --radius-s: 10px; --slot-h: 18px;
  --shadow: 0 1px 2px rgba(7, 23, 25, .05), 0 8px 24px rgba(7, 23, 25, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; font-family: "Inter Tight", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 15px; color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.7rem; line-height: 1.15; font-weight: 750; letter-spacing: -.015em; margin: 0 0 12px; }
h2 { font-size: 1.12rem; font-weight: 700; margin: 0 0 10px; letter-spacing: -.005em; }
h3 { font-size: 1rem; font-weight: 700; margin: 16px 0 8px; }
a { color: var(--brand-dark); }
.muted { color: var(--muted); }
.num, time, .t, .tnum { font-variant-numeric: tabular-nums; }
code { background: var(--soft); padding: 1px 6px; border-radius: 5px; font-size: .92em; }
:focus-visible { outline: 3px solid #3f7d61; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Bedienelemente ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 15px; border-radius: var(--radius-s);
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--card); }
.btn.ghost { background: transparent; border-color: transparent; color: inherit; }
.btn.ghost:hover { background: rgba(127, 140, 160, .12); }
.btn.danger { background: #c62f2f; border-color: #c62f2f; color: #fff; }
.btn.danger:hover { background: #a82424; }
.btn.small { min-height: 31px; padding: 3px 11px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

input, select, textarea { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=tel], input[type=color], input[type=search], select, textarea {
  min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: #fff; max-width: 100%; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #a9b6c6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(23, 40, 31, .12); }
input[type=color] { padding: 2px; width: 60px; }
label.f { display: block; margin: 0 0 12px; }
label.f > span { display: block; font-weight: 650; font-size: .9rem; margin-bottom: 4px; }
label.f > small, .hint { display: block; color: var(--muted); font-size: .84rem; margin-top: 3px; }
label.c { display: flex; gap: 9px; align-items: flex-start; margin: 6px 0; cursor: pointer; }
label.c input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: 0 0 auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.row > * { flex: 1 1 180px; }
fieldset { border: 0; padding: 0; margin: 0 0 10px; }
legend { padding: 0; margin-bottom: 4px; font-size: .9rem; }
.note { padding: 11px 14px; border-radius: var(--radius-s); background: var(--soft); margin: 0 0 12px; border-left: 4px solid var(--line-2); }
.note.warn { background: var(--warn); color: var(--warn-ink); border-left-color: #f0a500; }
.note.err { background: var(--err); color: var(--err-ink); border-left-color: var(--koralle); }
.note.ok { background: var(--ok); color: var(--ok-ink); border-left-color: #22a06b; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok); color: var(--ok-ink); } .pill.warn { background: var(--warn); color: var(--warn-ink); } .pill.err { background: var(--err); color: var(--err-ink); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--koralle); color: #fff; font-size: .74rem; font-weight: 700; text-align: center; margin-left: auto; line-height: 19px; }
.badge[hidden] { display: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card > h2:first-child { margin-top: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 13px; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; border-radius: 7px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 42, 70, .14); }

/* ---------- Rahmen Praxisbereich: Navigation links ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--tinte) 240px, transparent 240px); }
.sidenav { background: var(--tinte); color: var(--tinte-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 18px 12px 14px; gap: 2px; }
.sn-praxis { display: flex; gap: 11px; align-items: center; padding: 4px 8px 18px; }
.sn-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; flex: 0 0 auto; }
.sn-name { font-weight: 750; line-height: 1.2; font-size: .98rem; }
.sn-name small { display: block; font-weight: 500; color: var(--tinte-muted); font-size: .78rem; margin-top: 2px; }
.sn-group { color: var(--tinte-muted); font-size: .78rem; font-weight: 600; padding: 14px 10px 5px; }
.nav-item { --c: var(--brand); display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--tinte-ink); font: inherit; font-weight: 550; text-align: left; cursor: pointer; text-decoration: none; position: relative; }
.nav-item:hover { background: rgba(255, 255, 255, .07); }
.nav-item[aria-current="page"] { background: rgba(255, 255, 255, .12); font-weight: 700; }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.glyph { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: color-mix(in srgb, var(--c) 24%, transparent); color: var(--c); }
.nav-item[aria-current="page"] .glyph { background: var(--c); color: var(--tinte); }
.glyph svg { width: 18px; height: 18px; }
.sn-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 2px; }
.sn-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; background: none; border: 0; color: inherit; font: inherit; text-align: left; width: 100%; }
.sn-user:hover, .sn-user[aria-current="page"] { background: rgba(255, 255, 255, .08); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: .82rem; color: #fff; flex: 0 0 auto; background: var(--c, var(--flieder)); }
.sn-user span { min-width: 0; font-size: .9rem; line-height: 1.2; }
.sn-user small { display: block; color: var(--tinte-muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; }
.sn-made { display: flex; align-items: center; gap: 8px; padding: 12px 10px 2px; color: var(--tinte-muted); font-size: .74rem; text-decoration: none; }
.sn-made img { height: 20px; width: auto; opacity: .9; }
.topbar .brand img { height: 26px; width: auto; display: block; }
.brand small { font-weight: 550; color: var(--tinte-muted); font-size: .9rem; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.2); }
.start-logo { height: 34px; width: auto; display: block; margin-bottom: 22px; }
.made-foot { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .8rem; margin: 40px 0 0; }
.made-foot img { height: 20px; width: auto; }
.page { padding: 26px 30px 48px; max-width: 1480px; }
@media (max-width: 900px) {
  /* Reiterleiste immer in ihrer eigenen Höhe – ohne feste Zeilen verteilt das Raster bei kurzem Inhalt (z. B. Anfragen) den Platz auf beide */
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; background: none; }
  .sidenav { position: sticky; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 8px; gap: 4px; z-index: 30; }
  .sn-praxis, .sn-group { display: none; }
  .nav-item { width: auto; flex: 0 0 auto; padding: 6px 9px; }
  .nav-item .lbl { font-size: .85rem; }
  .nav-item[aria-current="page"]::before { display: none; }
  .sn-foot { margin: 0; padding: 0; border: 0; flex-direction: row; }
  .sn-user span { display: none; }
  .page { padding: 18px 16px 40px; }
}

/* Kopf jeder Seite */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.ph h1 { margin: 0; }
.ph p { margin: 4px 0 0; color: var(--muted); }
.ph .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.datenav { display: inline-flex; align-items: center; gap: 4px; }
.datenav .btn { min-width: 38px; padding: 6px 10px; }

/* ---------- Leitstand: Kopfleiste ---------- */
.topbar { background: var(--tinte); color: var(--tinte-ink); position: sticky; top: 0; z-index: 20; }
.topbar .in { display: flex; align-items: center; gap: 6px; padding: 8px 16px; flex-wrap: wrap; }
.brand { font-weight: 800; margin-right: 16px; color: #fff; display: inline-flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.tab { background: none; border: 0; padding: 9px 13px; border-radius: 9px; font: inherit; font-weight: 550; cursor: pointer; color: var(--tinte-ink); position: relative; text-decoration: none; }
.tab:hover { background: rgba(255, 255, 255, .08); }
.topbar .tab[aria-current="page"] { background: rgba(255, 255, 255, .14); font-weight: 700; color: #fff; }
.topbar .user { font-size: .88rem; color: var(--tinte-muted); }
.topbar .btn.ghost { color: var(--tinte-ink); }

/* ---------- Anmeldung ---------- */
body:has(.login) { background: linear-gradient(135deg, #f6f8f6 0%, var(--soft) 45%, var(--mint) 100%); min-height: 100vh; }
.login { max-width: 470px; margin: 0 auto; padding: 11vh 18px 40px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 28px; text-align: center; }
.login-brand img { height: 40px; width: auto; }
.login-brand span { color: var(--muted); font-size: .95rem; }
.login .card { padding: 34px 36px 36px; border: 0; border-radius: 20px; box-shadow: 0 2px 4px rgba(7, 23, 25, .04), 0 24px 60px rgba(7, 23, 25, .10); }
.login h1 { font-size: 1.75rem; margin-bottom: 6px; }
.login .card > p.muted:first-of-type { margin: 0 0 24px; }
.login .btn[type=submit] { width: 100%; min-height: 50px; font-size: 1.02rem; border-radius: 12px; margin-top: 6px; }
.login-foot { text-align: center; color: var(--muted); font-size: .84rem; margin-top: 26px; }
@media (max-width: 480px) { .login .card { padding: 26px 20px; } }

/* ---------- Eingabefelder: Beschriftung im Feld (schwebend) ---------- */
label.f { position: relative; }
label.f > span { position: absolute; left: 13px; top: 7px; z-index: 1; margin: 0; font-size: .72rem; font-weight: 650; letter-spacing: .01em; color: var(--muted); pointer-events: none; transition: top .14s, font-size .14s, color .14s, transform .14s; }
label.f > input:not([type=checkbox]):not([type=radio]):not([type=color]), label.f > select, label.f > textarea { min-height: 54px; padding: 23px 13px 6px; background: var(--field-bg); border: 1px solid var(--line-2); border-radius: 12px; }
label.f > textarea { padding-top: 26px; }
label.f > input:not([type=checkbox]):not([type=color]):focus, label.f > select:focus, label.f > textarea:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(23, 40, 31, .10); }
label.f:focus-within > span { color: var(--brand); }
label.f > input::placeholder, label.f > textarea::placeholder { color: transparent; transition: color .14s; }
label.f > input:focus::placeholder, label.f > textarea:focus::placeholder { color: #9aa79f; }
/* leer und nicht ausgewählt: Beschriftung groß in der Feldmitte (wie ein Platzhalter) */
label.f:has(> input:placeholder-shown:not(:focus)) > span, label.f:has(> textarea:placeholder-shown:not(:focus)) > span { top: 27px; transform: translateY(-50%); font-size: .98rem; font-weight: 450; color: #7b8780; letter-spacing: 0; }
label.f:has(> textarea:placeholder-shown:not(:focus)) > span { top: 18px; transform: none; }
/* Farbwähler: Beschriftung bleibt darüber */
label.f.nofl > span, label.f:has(> input[type=color]) > span { position: static; display: block; font-size: .88rem; color: var(--ink); margin-bottom: 4px; }
label.f > input[aria-invalid="true"] { border-color: var(--err-ink); }
/* Augen-Knopf im Passwortfeld (public/shared/anmeldung.js) */
label.f.has-eye > input:not([type=checkbox]):not([type=radio]):not([type=color]) { padding-right: 48px; }
label.f > input::-ms-reveal { display: none; }
.pw-eye { position: absolute; right: 6px; top: 27px; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-eye:hover { background: var(--soft); color: var(--ink); }
.pw-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-eye svg { width: 20px; height: 20px; }
/* QR-Code für die Zwei-Faktor-Anmeldung */
svg.qr { display: block; width: 200px; max-width: 100%; height: auto; margin: 10px 0 6px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- Heute ---------- */
.today-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .today-grid { grid-template-columns: 1fr; } }
.agenda { list-style: none; margin: 0; padding: 0; position: relative; }
.agenda li { --c: var(--brand); display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); position: relative; }
.agenda li:first-child { border-top: 0; }
.agenda .when { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); padding-left: 14px; position: relative; }
.agenda .when::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 5px; border-radius: 3px; background: var(--c); }
.agenda .when small { display: block; color: var(--muted); font-weight: 500; }
.agenda .what b { display: block; }
.agenda .what span { color: var(--muted); font-size: .9rem; }
.agenda li.pause .what b, .agenda li.pause .when { color: var(--muted); font-weight: 550; }
.agenda li.pause .when::before { background: repeating-linear-gradient(180deg, var(--line-2) 0 4px, transparent 4px 7px); }
.agenda li.patient { padding-left: 22px; }
.agenda li.patient .when { font-weight: 600; }
.agenda li.patient .when::before { width: 3px; opacity: .8; }
.agenda li.now { background: var(--sonne-soft); border-radius: 10px; border-top-color: transparent; margin: 2px -10px; padding: 10px; }
.agenda li.now + li { border-top-color: transparent; }
.agenda li.past { opacity: .55; }
.nowtag { display: inline-block; background: var(--sonne); color: #4a3500; font-size: .74rem; font-weight: 750; padding: 0 8px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }
.offday { display: flex; gap: 18px; align-items: center; padding: 26px; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 30%, white); }
.offday .big { font-size: 1.4rem; font-weight: 800; color: color-mix(in srgb, var(--c) 75%, black); }
.offday svg { width: 46px; height: 46px; color: var(--c); flex: 0 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { --c: var(--brand); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; text-align: left; font: inherit; color: inherit; }
button.tile { cursor: pointer; } button.tile:hover { border-color: var(--c); }
.tile::after { content: ""; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--c) 16%, transparent); }
.tile b { display: block; font-size: 1.85rem; font-weight: 800; line-height: 1.1; color: color-mix(in srgb, var(--c) 80%, black); font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .88rem; }
.who-away { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.who-away li { display: flex; align-items: center; gap: 10px; }
.who-away .avatar { width: 28px; height: 28px; font-size: .74rem; }

/* Tagesband: Team auf einer Zeitachse */
.ribbon { --cols: 12; position: relative; }
.rb-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; min-height: 46px; border-top: 1px solid var(--line); }
.rb-row:first-child { border-top: 0; }
.rb-who { display: flex; align-items: center; gap: 10px; padding-right: 10px; min-width: 0; }
.rb-who .avatar { width: 30px; height: 30px; font-size: .76rem; }
.rb-who b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-who small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-track { position: relative; height: 34px; border-radius: 8px;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--cols) - 1px), var(--line) calc(100% / var(--cols) - 1px) calc(100% / var(--cols))); }
.rb-bar { --c: var(--brand); position: absolute; top: 3px; bottom: 3px; border-radius: 7px; background: color-mix(in srgb, var(--c) 20%, white); border: 1px solid color-mix(in srgb, var(--c) 45%, white); border-left: 4px solid var(--c);
  font-size: .78rem; font-weight: 650; color: color-mix(in srgb, var(--c) 70%, black); padding: 0 7px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.rb-bar.task { top: auto; bottom: -4px; height: 9px; border: 0; border-radius: 4px; background: var(--c); padding: 0; }
.rb-off { position: absolute; inset: 3px 0; border-radius: 7px; display: flex; align-items: center; padding: 0 12px; font-size: .84rem; font-weight: 650; color: color-mix(in srgb, var(--c) 75%, black);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, white) 0 8px, color-mix(in srgb, var(--c) 7%, white) 8px 16px); border: 1px dashed color-mix(in srgb, var(--c) 45%, white); }
.rb-scale { display: grid; grid-template-columns: 190px minmax(0, 1fr); }
.rb-scale div { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-bottom: 4px; }
.rb-now { position: absolute; top: -4px; bottom: 0; width: 2px; background: var(--koralle); z-index: 3; pointer-events: none; }
.rb-now::before { content: attr(data-t); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); background: var(--koralle); color: #fff; font-size: .7rem; font-weight: 700; padding: 0 6px; border-radius: 99px; white-space: nowrap; }
@media (max-width: 700px) { .rb-row, .rb-scale { grid-template-columns: 110px minmax(0, 1fr); } .rb-who small { display: none; } }

/* ---------- Kalender ---------- */
.caltools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.caltools h2 { margin: 0 10px 0 6px; font-size: 1.2rem; min-width: 230px; }
.prfilter { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.prfilter button { --c: var(--brand); display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--card); border-radius: 99px; padding: 4px 12px 4px 8px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.prfilter button[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 15%, white); border-color: var(--c); }
.cal { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 210px); position: relative; box-shadow: var(--shadow); }
.cal-head { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); padding: 9px 6px 8px; font-weight: 700; text-align: center; font-size: .92rem; }
.cal-head a { color: var(--ink); text-decoration: none; } .cal-head a:hover { color: var(--brand-dark); }
.cal-head small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.cal-head.hol { color: #b42318; } .cal-head.hol small { color: #b42318; }
.cal-head.today { background: var(--sonne-soft); box-shadow: inset 0 -3px 0 var(--sonne); }
.cal-head .lanes { display: flex; gap: 2px; margin-top: 6px; }
.cal-head .lanes i { flex: 1; height: 4px; border-radius: 2px; }
.cal-corner { position: sticky; top: 0; left: 0; z-index: 6; background: var(--card); border-bottom: 1px solid var(--line); }
.cal-times { position: sticky; left: 0; z-index: 4; background: var(--card); border-right: 1px solid var(--line); border-top: 12px solid var(--card); }
.cal-times div { height: calc(var(--slot-h) * 4); font-size: .74rem; color: var(--muted); text-align: right; padding: 0 7px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
/* border-top: Luft über der ersten Stunde, damit deren Uhrzeit nicht unter der Kopfzeile verschwindet */
.cal-col { position: relative; border-right: 1px solid var(--line); border-top: 12px solid var(--card); min-width: 150px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--slot-h) * 2 - 1px), #f1f4f7 calc(var(--slot-h) * 2 - 1px), #f1f4f7 calc(var(--slot-h) * 2), transparent calc(var(--slot-h) * 2), transparent calc(var(--slot-h) * 4 - 1px), var(--line) calc(var(--slot-h) * 4 - 1px), var(--line) calc(var(--slot-h) * 4)); }
.cal-col.today { background-color: #fffdf6; border-top-color: #fffdf6; }
.cal-col .off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f1f4f7 0 6px, #e9eef3 6px 12px); pointer-events: none; }
.cal-col.drop { outline: 2px dashed var(--brand); outline-offset: -2px; }
.ev { --c: #64748b; position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 3px 7px; font-size: .8rem; line-height: 1.25; overflow: hidden; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--c) 35%, white); border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 13%, white); color: var(--ink); text-align: left; font-family: inherit; }
.ev:hover { box-shadow: 0 4px 14px rgba(23, 42, 70, .18); z-index: 3; }
.ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.ev .t { color: color-mix(in srgb, var(--c) 55%, #33404f); font-size: .76rem; }
.ev.req { border-style: dashed; border-left-style: solid; background: repeating-linear-gradient(135deg, var(--sonne-soft) 0 6px, #fff 6px 12px); }
.ev.online::after { content: "online"; position: absolute; top: 3px; right: 5px; font-size: .64rem; font-weight: 700; color: color-mix(in srgb, var(--c) 70%, black); background: rgba(255, 255, 255, .8); padding: 0 4px; border-radius: 4px; }
.ev.block { background: repeating-linear-gradient(135deg, #eef1f5 0 6px, #e4e9ef 6px 12px); border-color: #cbd3dd; border-left-color: #64748b !important; color: #364152; }
.ev.absent { --c: var(--k-urlaub); cursor: default; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 16%, white) 0 8px, color-mix(in srgb, var(--c) 8%, white) 8px 16px); border-style: dashed; }
.ev.cancelled { opacity: .45; text-decoration: line-through; }
.ev.short { display: flex; gap: 6px; align-items: center; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
.ev.short b { flex: 0 1 auto; } .ev.short .t { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.ev.short.online::after { display: none; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--koralle); z-index: 4; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--koralle); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); margin: 10px 0 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Dienstplan ---------- */
.duty-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.duty { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 860px; }
.duty th, .duty td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; padding: 8px; text-align: left; }
.duty tr > :last-child { border-right: 0; }
.duty tbody tr:last-child > * { border-bottom: 0; }
.duty thead th { background: #f8fafc; font-size: .9rem; position: sticky; top: 0; z-index: 2; }
.duty thead th small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
.duty thead th.today { background: var(--sonne-soft); box-shadow: inset 0 -3px 0 var(--sonne); }
.duty thead th.hol, .duty thead th.hol small { color: #b42318; }
.duty th.who { width: 200px; min-width: 180px; background: #fbfcfd; }
.duty .person { display: flex; gap: 10px; align-items: center; }
.duty .person b { display: block; }
.duty .person small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.duty .hrs { margin-top: 6px; font-size: .78rem; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.duty td.cell { min-width: 128px; }
.duty td.cell.edit { cursor: pointer; }
.duty td.cell.edit:hover { background: #f7fafc; box-shadow: inset 0 0 0 2px var(--brand-soft); }
.duty td.cell.today { background: #fffdf5; }
.shift { --c: var(--brand); display: block; border-radius: 8px; padding: 4px 8px 5px; margin-bottom: 4px; background: color-mix(in srgb, var(--c) 13%, white); border-left: 4px solid var(--c); font-size: .84rem; line-height: 1.25; }
.shift b { font-variant-numeric: tabular-nums; font-weight: 700; }
.shift span { display: block; color: color-mix(in srgb, var(--c) 65%, #2c3644); font-size: .78rem; font-weight: 600; }
.offtag { --c: var(--k-sonstiges); display: block; border-radius: 8px; padding: 6px 8px; font-size: .84rem; font-weight: 700; color: color-mix(in srgb, var(--c) 80%, black);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 15%, white) 0 7px, color-mix(in srgb, var(--c) 7%, white) 7px 14px); }
.offtag small { display: block; font-weight: 500; }
.pendtag { display: block; margin-top: 4px; font-size: .76rem; font-weight: 650; color: #6b4f00; border: 1px dashed #e0b33a; border-radius: 6px; padding: 2px 6px; background: var(--sonne-soft); }
.changed { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--flieder); background: #efedfb; border-radius: 99px; padding: 0 7px; margin-bottom: 4px; }
.freetag { color: #a6b1be; font-size: .84rem; }
.duty tr.tasks td, .duty tr.tasks th { background: #faf9ff; }
.task { --c: var(--flieder); display: flex; gap: 6px; font-size: .78rem; line-height: 1.25; margin-bottom: 3px; }
.task::before { content: ""; width: 3px; border-radius: 2px; background: var(--c); flex: 0 0 auto; }
.task b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.blk-row select[hidden] { display: none; }
.staff-card summary { list-style: none; }
.staff-card summary::-webkit-details-marker { display: none; }
.staff-card[open] summary { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.blk-row { display: grid; grid-template-columns: 118px 118px minmax(120px, 1fr) minmax(120px, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 640px) { .blk-row { grid-template-columns: 1fr 1fr; } }
.pattern { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pattern .pd { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); align-items: start; }
.pattern .pd:first-child { border-top: 0; }
.pattern .pd > b { padding-top: 8px; }
.staff-card { border-left: 6px solid var(--c, var(--brand)); }

/* ---------- Urlaub ---------- */
.konten { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 18px; }
.konto { --c: var(--brand); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.konto-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.konto-top b { display: block; }
.konto-top small { color: var(--muted); }
.konto .rest { margin-left: auto; text-align: right; font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--k-urlaub); font-variant-numeric: tabular-nums; }
.konto .rest small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.meter { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--soft); }
.meter i { display: block; height: 100%; }
.meter .m-taken { background: var(--k-urlaub); } .meter .m-planned { background: color-mix(in srgb, var(--k-urlaub) 45%, white); }
.meter .m-req { background: repeating-linear-gradient(135deg, #f0b429 0 4px, #ffe39a 4px 8px); }
.konto ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); }
.konto ul i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.months { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.months button { border: 1px solid var(--line-2); background: var(--card); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.months button[aria-pressed="true"] { background: var(--tinte); color: #fff; border-color: var(--tinte); }
.yearplan { overflow-x: auto; }
table.mplan { border-collapse: collapse; font-size: .78rem; }
.mplan th, .mplan td { padding: 0; text-align: center; }
.mplan thead th { font-weight: 600; color: var(--muted); padding: 2px 0 6px; width: 26px; min-width: 26px; font-variant-numeric: tabular-nums; }
.mplan thead th small { display: block; font-size: .66rem; font-weight: 500; }
.mplan thead th.we { color: #b0bac6; }
.mplan thead th.today { color: var(--ink); } .mplan thead th.today span { background: var(--sonne); border-radius: 6px; padding: 0 4px; }
.mplan th.who { text-align: left; padding: 4px 12px 4px 0; white-space: nowrap; font-weight: 650; font-size: .86rem; color: var(--ink); min-width: 150px; }
.mplan td { height: 30px; border-left: 2px solid #fff; border-top: 2px solid #fff; background: #eef2f6; }
.mplan td.we { background: #f6f8fa; }
.mplan td.hol { background: repeating-linear-gradient(135deg, #e5e9ef 0 4px, #f2f4f7 4px 8px); }
.mplan td.k { background: var(--c); }
.mplan td.k.pend { background: repeating-linear-gradient(135deg, var(--c) 0 4px, color-mix(in srgb, var(--c) 35%, white) 4px 8px); }
.mplan td.k.first { border-radius: 7px 0 0 7px; } .mplan td.k.last { border-radius: 0 7px 7px 0; } .mplan td.k.first.last { border-radius: 7px; }
.kinds { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); margin-top: 10px; }
.kinds i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.reqlist { display: flex; flex-direction: column; gap: 8px; }
.reqitem { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--sonne-soft); border: 1px solid #f3dc93; }
.reqitem .grow { flex: 1; min-width: 200px; }

/* ---------- Tabellen ---------- */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .82rem; color: var(--muted); font-weight: 650; }
.tbl tbody tr:hover { background: #fafcfd; }
.tbl tbody tr:last-child td { border-bottom: 0; }
tr.inactive { opacity: .55; }

/* ---------- Einstellungen ---------- */
.settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .settings { grid-template-columns: 1fr; } .side { position: static !important; flex-direction: row !important; flex-wrap: wrap; } }
.side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.side button { text-align: left; background: none; border: 0; padding: 8px 11px; border-radius: 8px; font: inherit; font-size: .93rem; cursor: pointer; color: var(--ink); }
.side button:hover { background: var(--soft); }
.side button[aria-current="true"] { background: var(--brand-soft); font-weight: 700; color: var(--brand-dark); }
.hours { border-collapse: collapse; }
.hours td { padding: 4px 6px; }
.hours input[type=time] { width: 124px; }
.item { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: #fff; box-shadow: var(--shadow); }
.item.inactive { opacity: .6; }
.wizard { background: var(--brand-soft); border: 1px solid var(--mint); border-left: 6px solid var(--brand); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 4px 11px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: .85rem; }
.steps li::before { content: counter(s) ". "; font-weight: 700; }
.steps li.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.steps li.ok { border-color: var(--mint); background: #fff; }
pre.code { background: var(--tinte); color: #e2e8f0; padding: 13px; border-radius: 10px; overflow-x: auto; font-size: .85rem; white-space: pre-wrap; word-break: break-all; }
.settings .row > label.f { flex: 1 1 220px; }
label.f input:not([type=checkbox]):not([type=color]), label.f select, label.f textarea { width: 100%; }

/* ---------- Kennzahlen ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { --c: var(--brand); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); border-top: 4px solid var(--c); color: var(--muted); font-size: .9rem; }
.kpi:nth-child(4n+2) { --c: #3b82f6; } .kpi:nth-child(4n+3) { --c: var(--koralle); } .kpi:nth-child(4n+4) { --c: #f59e0b; }
.kpi b { display: block; font-size: 1.75rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 8px 0; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font-size: .75rem; color: var(--muted); height: 100%; }
.bars span { width: 100%; background: linear-gradient(180deg, var(--brand), #5d8a73); border-radius: 6px 6px 2px 2px; min-height: 2px; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(580px, calc(100vw - 24px)); box-shadow: 0 24px 70px rgba(23, 42, 70, .32); }
dialog.wide { width: min(780px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(23, 42, 70, .5); }
dialog .dh { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
dialog .dh h2 { margin: 0; }
dialog .db { padding: 18px 20px; max-height: 70vh; overflow: auto; }
dialog .df { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 13px 20px; border-top: 1px solid var(--line); background: #f8fafc; border-radius: 0 0 16px 16px; }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 5px 12px; margin: 0 0 12px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.hist { font-size: .85rem; color: var(--muted); margin: 0; padding-left: 18px; }
.timechips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.timechips button { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 4px 9px; cursor: pointer; font: inherit; font-variant-numeric: tabular-nums; }
.timechips button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
/* Verschieben: freie Zeiten je Behandler */
.mvnow { margin: 0 0 12px; }
.mvnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.mvnav label.f { margin: 0; min-width: 170px; }
.mvday { font-weight: 600; color: var(--muted); }
.mvgrid { display: grid; gap: 8px; margin: 8px 0; max-height: 46vh; overflow: auto; padding-right: 4px; }
.mvrow { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.mvrow.empty { background: var(--soft); }
.mvwho { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mvrow.empty .mvwho { margin-bottom: 0; }
.mvwho small { margin-left: auto; }
.mvpart { display: flex; gap: 10px; align-items: baseline; }
.mvlbl { flex: 0 0 82px; font-size: .82rem; color: var(--muted); }
.mvpart .timechips { margin: 4px 0; }
.mvpick { margin: 8px 0 4px; min-height: 1.5em; }
.mvexact { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 10px 0 0; }
.mvexact label.f { margin: 0; }
.mvexact label.f:first-child { flex: 0 0 160px; }
.mvexact label.f:last-child { flex: 1 1 220px; }
@media (max-width: 560px) { .mvpart { flex-direction: column; gap: 0; } }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--tinte); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 100; box-shadow: 0 10px 30px rgba(23, 42, 70, .35); font-weight: 600; border-left: 5px solid var(--mint); }

/* ---------- Start- und Postfach-Seite ---------- */
body.start { background: linear-gradient(var(--tinte) 0 230px, var(--bg) 230px) no-repeat, var(--bg); }
.start-wrap { max-width: 940px; margin: 0 auto; padding: 44px 18px 60px; position: relative; }
.start-wrap.wide { max-width: 1240px; }
.start-wrap > h1, .start-wrap > .muted:first-of-type { color: #fff; }
.start-wrap > h1 { margin-top: 0; }
.start-wrap > .muted:first-of-type { color: var(--tinte-muted); max-width: 60ch; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 26px 0 32px; }
.start-card { --c: var(--brand); display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 22px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.start-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.start-card:nth-child(1) { --c: #3f7d61; } .start-card:nth-child(2) { --c: #f59e0b; } .start-card:nth-child(3) { --c: #3b82f6; } .start-card:nth-child(4) { --c: var(--flieder); } .start-card:nth-child(5) { --c: #e0518f; } .start-card:nth-child(6) { --c: #64748b; }
.start-card:hover { border-color: var(--c); }
.start-card strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 1.04rem; }
.start-card span { color: var(--muted); font-size: .92rem; }
.start-wrap .tbl { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.mailbox { display: grid; grid-template-columns: 360px 1fr; gap: 16px; }
@media (max-width: 800px) { .mailbox { grid-template-columns: 1fr; } }
.maillist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); max-height: 75vh; overflow: auto; box-shadow: var(--shadow); }
.mailitem { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 11px 14px; cursor: pointer; font: inherit; }
.mailitem.active { background: var(--brand-soft); }
.mailitem span { display: block; font-size: .82rem; color: var(--muted); }
.mail { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-height: 300px; box-shadow: var(--shadow); }
.mailbody { white-space: pre-wrap; font-family: inherit; background: var(--soft); padding: 13px; border-radius: 10px; }
.mailframe { width: 100%; height: 640px; border: 1px solid var(--line, #dfe5e1); border-radius: 10px; background: #f3f5f4; }
.start-wrap > p > .btn.secondary { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }

/* ---------- Farb-Editor ---------- */
.te { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 440px); gap: 20px; align-items: start; }
@media (max-width: 960px) { .te { grid-template-columns: 1fr; } }
.te-left { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.te-right { position: sticky; top: 20px; }
.te-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.te-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.te-preset { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 10px 4px 4px; cursor: pointer; font: inherit; font-size: .85rem; }
.te-swatch { width: 22px; height: 22px; border-radius: 50%; border: 3px solid; display: grid; place-items: center; }
.te-swatch i { width: 8px; height: 8px; border-radius: 50%; }
.te-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.te-label small { display: block; color: var(--muted); font-size: .8rem; }
.te-ctrl { display: flex; gap: 6px; align-items: center; }
.te-ctrl input[type=color] { width: 44px; height: 36px; padding: 2px; }
.te-ctrl input[type=text] { width: 96px; font-family: ui-monospace, Consolas, monospace; }
.te-checks { list-style: none; padding: 0; margin: 0 0 12px; font-size: .88rem; }
.te-checks li { padding: 2px 0; }
.te-checks .ok { color: var(--ok-ink); } .te-checks .bad { color: var(--err-ink); font-weight: 600; }
.te-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Betreiber-Leitstand ---------- */
.op-wrap { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 54px); }
@media (max-width: 860px) { .op-wrap { grid-template-columns: 1fr; } .op-side { position: static !important; max-height: none !important; } }
.op-side { background: var(--card); border-right: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 54px; max-height: calc(100vh - 54px); overflow: auto; }
.op-search { width: 100%; }
.op-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.op-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.op-item:hover { background: var(--soft); }
.op-item[aria-current="page"] { background: var(--brand-soft); box-shadow: inset 4px 0 0 var(--brand); }
.op-all { font-weight: 700; }
.op-dot { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; }
.op-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-name small { display: block; color: var(--muted); font-size: .78rem; }
.op-st { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #9ca3af; }
.op-st.ok { background: #16a34a; } .op-st.err { background: #dc2626; } .op-st.warn { background: #d97706; }
.op-main { padding: 22px 26px; min-width: 0; }
.op-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.op-head h1 { margin: 0; }
.op-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.op-card { background: var(--card); border: 1px solid var(--line); border-left: 8px solid; border-radius: var(--radius); padding: 15px 17px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.op-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.op-card-name { font-weight: 750; font-size: 1.08rem; color: var(--ink); text-decoration: none; }
.op-card-name:hover { text-decoration: underline; }
.small { font-size: .85rem; }
.op-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; }
.op-stats dt { font-size: .76rem; color: var(--muted); }
.op-stats dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.op-issues { margin: 0; padding: 8px 10px 8px 26px; background: var(--warn); color: var(--warn-ink); border-radius: 9px; font-size: .85rem; }
.op-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.op-tabs .tab { color: var(--muted); }
.op-tabs .tab:hover { background: var(--soft); }
.op-tabs .tab[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--brand); border-radius: 8px 8px 0 0; }
.op-swatch { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); cursor: pointer; }
.op-swatch input { width: 36px; height: 30px; padding: 2px; }
.op-danger { border-color: #f2b8b5; }
.op-main .row, .settings .row { align-items: flex-start; }

/* ---------- Übertragungsliste (DS-Win) ---------- */
.pvs-list { display: flex; flex-direction: column; gap: 10px; }
.pvs-item { background: var(--card); border: 1px solid var(--line); border-left: 6px solid #22a06b; border-radius: var(--radius); padding: 13px 16px; box-shadow: var(--shadow); }
.pvs-item.warn { border-left-color: #f0a500; } .pvs-item.err { border-left-color: var(--koralle); }
.pvs-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.pvs-top input { width: 18px; height: 18px; accent-color: var(--brand); }
.pvs-when { font-size: 1.02rem; }
.pvs-todo { margin-left: auto; font-size: .88rem; }
.pvs-kv { grid-template-columns: 120px 1fr; margin: 0; }
.cp { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; font: inherit; font-size: .75rem; padding: 1px 7px; cursor: pointer; color: var(--brand-dark); }
/* Löschfrist (ab 0.21): bald gelöschte Einträge oben und hervorgehoben, Hinweis-Leiste im Praxisbereich */
.pvs-item.frist { background: #fff8f7; border-color: #f2b8b5; }
.loeschleiste { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.loeschleiste > span { flex: 1 1 260px; }
.loeschleiste a { color: inherit; font-weight: 600; }
details.card summary { cursor: pointer; }

/* Werbequellen */
.q-tbl th.num, .q-tbl td.num { text-align: right; white-space: nowrap; }
.q-tbl tfoot th { border-top: 2px solid var(--line); }
.q-card .kv { grid-template-columns: 150px 1fr; margin-top: 8px; }
.q-card .kv small.hint { display: block; }
.q-form { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

@media print {
  .sidenav, .topbar, .no-print, .toast, .note.warn { display: none !important; }
  .shell { display: block; }
  body, .page { background: #fff; padding: 0; }
  .card, .duty-wrap, .pvs-item { box-shadow: none; }
  .pvs-item { break-inside: avoid; border: 1px solid #999; border-left-width: 6px; }
  .duty-wrap { overflow: visible; border: 0; }
  table.duty { min-width: 0; font-size: 11px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.ev.absent { overflow: visible; }
.ev.absent b { position: sticky; top: 68px; white-space: normal; }
[hidden] { display: none !important; }
input[type=file] { font: inherit; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 650; padding: 8px 15px; margin-right: 12px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--brand); }
.tbl td.tnum { white-space: nowrap; }
label.f:not(.nofl) > span { right: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Terminketten & Kommentare */
.chaintag { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-right: 4px; border-radius: 5px; background: var(--c); color: #fff; font-size: .66rem; font-weight: 800; vertical-align: 1px; }
.notetag { font-weight: 400; }
.chainlist { margin: 6px 0 0; padding-left: 20px; font-size: .9rem; }
.chainlist li { margin: 2px 0; }
.chainlist li.cur { font-weight: 700; }
.chainlist li.gone { text-decoration: line-through; color: var(--muted); }
.notebox { background: var(--soft); border-radius: 12px; padding: 12px 12px 10px; margin: 6px 0 4px; }
.notebox label.f { margin-bottom: 8px; }
.notebox textarea { width: 100%; }
.steprows { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.steprow { display: grid; grid-template-columns: 28px minmax(160px, 1.4fr) minmax(130px, .8fr) minmax(140px, 1fr) 36px; gap: 8px; align-items: center; }
.steprow.sug { grid-template-columns: 28px minmax(160px, 1.4fr) 150px 120px auto; }
.stepno { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.offs { display: flex; gap: 6px; align-items: center; } .offs input { width: 76px; }
@media (max-width: 700px) { .steprow, .steprow.sug { grid-template-columns: 28px 1fr 1fr; } }
.calls { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.calls li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; }
.calls li input { width: 18px; height: 18px; accent-color: var(--brand); }
.calls li small { display: block; }
.calls li.done b { text-decoration: line-through; color: var(--muted); }

/* Teilnahme-Bestätigung nach Nichterscheinen */
.attendtag { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; margin-left: 4px; border-radius: 8px; font-size: 11px; font-weight: 700; padding: 0 4px; vertical-align: 1px; }
.attendtag.open { background: #f5c451; color: #3d2a00; }
.attendtag.ok { background: #cfe9d6; color: #14532d; }
.calls .pill { margin-top: 3px; display: inline-block; }

/* Ziehen & Ablegen im Kalender */
.ev.dragging { opacity: .45; }
.dropmark { position: absolute; z-index: 5; pointer-events: none; border: 2px dashed var(--c, var(--brand)); border-radius: 8px;
  background: color-mix(in srgb, var(--c, var(--brand)) 14%, transparent); font-size: .78rem; font-weight: 700; padding: 2px 6px;
  color: color-mix(in srgb, var(--c, var(--brand)) 70%, black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Cockpit (Tarif Pro) ===== */
.probadge { margin-left: auto; font-size: .68rem; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; background: #f5c451; color: #3d2a00; }
.cptools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cptools select { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 9px; font: inherit; background: var(--card); }
.cphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cphead h2 { margin: 0; }
.cpchart { position: relative; display: grid; grid-template-columns: 64px 1fr; grid-template-rows: 200px auto; margin-top: 10px; }
.cpgrid { grid-row: 1; grid-column: 1; display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--muted); text-align: right; padding-right: 8px; font-variant-numeric: tabular-nums; }
.cpbars { grid-row: 1; grid-column: 2; display: flex; align-items: stretch; gap: 3px; border-bottom: 1px solid var(--line-2);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 50%; }
.cpcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; min-width: 8px; position: relative; outline: none; cursor: default; }
.cpcol small { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cpstack { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.cpstack i { display: block; min-height: 2px; border-radius: 4px 4px 0 0; }
.cpstack i + i { border-radius: 0; }
.cpcol:hover .cpstack i, .cpcol:focus .cpstack i { filter: brightness(1.12); }
.cpcol:focus-visible { box-shadow: 0 0 0 2px var(--brand); border-radius: 4px; }
.cpweeks { grid-row: 2; grid-column: 2; display: flex; gap: 3px; margin-top: 20px; font-size: .7rem; color: var(--muted); }
.cpweeks span { flex: 1; min-width: 8px; white-space: nowrap; overflow: visible; }
.cptip { position: absolute; top: 0; width: 220px; z-index: 5; background: #161616; color: #fff; border-radius: 9px; padding: 8px 10px; font-size: .8rem; display: grid; gap: 2px; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.18); margin-left: 64px; }
.cplegend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 4px 0 6px; }
.cplegend span { display: inline-flex; align-items: center; gap: 6px; }
.cplegend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cpdetails { margin-top: 26px; }
.cpdetails summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.cpmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.cpamt { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.cpamt legend { font-size: .82rem; color: var(--muted); padding: 0 4px; }
ol.steps { padding-left: 20px; margin: 6px 0 10px; } ol.steps li { margin: 4px 0; }
.filebtn { cursor: pointer; }
input[type=file]#rv-file, input[type=file]#bw-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tbl td.tnum, .tbl th.tnum { text-align: right; }
.ev .money { display: block; font-size: .7rem; font-weight: 700; color: #0f5c3c; font-variant-numeric: tabular-nums; }
.ev .money.est { font-weight: 600; color: #3d6b55; }
.moneyrow small { color: var(--muted); }

/* ---------- Farbverlauf der Balken & Werbung messen (ROAS) ---------- */
.heatlegend { display: inline-flex; align-items: center; gap: 6px; }
.heatlegend i { width: 96px !important; height: 10px !important; border-radius: 5px !important; display: inline-block; }
.heatlegend small { font-size: .78rem; color: var(--muted); }
.cpstack i.est, .cplegend i.est { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.6) 0 3px, transparent 3px 7px); }
.roaskpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.roaskpis .kpi small.roassub { display: block; margin-top: 4px; font-size: .78rem; }
.roasbig b { display: flex !important; align-items: center; gap: 10px; }
.roasdot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.roaschart { grid-template-rows: 220px auto; padding-bottom: 26px; }
.roasbars { grid-row: 1; grid-column: 2; display: flex; align-items: stretch; gap: 12px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(to bottom, transparent calc(50% - .5px), var(--line) calc(50% - .5px), var(--line) calc(50% + .5px), transparent calc(50% + .5px)); }
.roasgrp { flex: 1; display: flex; flex-direction: column; position: relative; outline: none; min-width: 26px; }
.roasgrp small { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.roasgrp:focus-visible { box-shadow: 0 0 0 2px var(--brand); border-radius: 4px; }
.roaspair { flex: 1; display: flex; gap: 3px; align-items: stretch; justify-content: center; }
.roascol { flex: 1; max-width: 34px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.roascol i { display: block; min-height: 2px; border-radius: 4px 4px 0 0; }
.roascol i + i { border-radius: 0; }
.roascol i.spend { background: #b8c1bc; }
.roascol i.erw, .cplegend i.erwleg { background: repeating-linear-gradient(135deg, var(--c, #65a30d) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1px var(--c, #65a30d); opacity: .75; }
.roasgrp:hover i, .roasgrp:focus i { filter: brightness(1.1); }
.roaschip { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 0; }
.spendtbl td, .spendtbl th { white-space: nowrap; }
.spendin { width: 84px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; text-align: right; background: var(--field-bg); font-variant-numeric: tabular-nums; }
.spendin.bad { border-color: var(--koralle); background: var(--err); }
.roashow summary { cursor: pointer; font-weight: 650; }
.roashow ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
/* Doctolib-Übernahme im Leitstand */
.dl-drop { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 18px; background: var(--field-bg); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.dl-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.dl-cals { display: grid; gap: 10px; }
.dl-cal { display: grid; grid-template-columns: 14px minmax(160px, 1fr) minmax(200px, 2fr); gap: 10px; align-items: center; }
.dl-cal i { width: 14px; height: 14px; border-radius: 4px; }
.dl-cal input { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 9px; font: inherit; }
.dl-hours { font-size: .82rem; color: var(--muted); }
.dl-types { columns: 2 260px; font-size: .86rem; margin: 6px 0 0; padding-left: 18px; }
.dl-types li { break-inside: avoid; }
