@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url('/fonts/jost-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url('/fonts/jost-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url('/fonts/jost-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url('/fonts/jost-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'PJS'; font-weight: 400; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'PJS'; font-weight: 500; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'PJS'; font-weight: 600; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'PJS'; font-weight: 700; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'PJS'; font-weight: 800; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2'); }

/* ============================================================
   Firoza Case Management · Gestaltung v6
   Türkis (Firoza = Türkis) auf kühlem Porzellan-Grund. Ruhig, klar,
   eine Sache pro Bildschirm im Vordergrund: der nächste Schritt.
   ============================================================ */
:root {
  --ink: #0F2A2E; --np: #062A2C; --sub: #5A6A6C; --faint: #8A9799;
  --tq: #0B8F99; --tqd: #08727A; --tql: #DDF1F2; --tqx: #F0F8F8;
  --bg: #F2F5F4; --surface: #FFFFFF; --line: #DCE3E1; --line2: #EBF0EE;
  --amber: #8A520B; --amber-bg: #FCF1DE; --red: #B3261E; --red-bg: #FBE9E7; --gold: #C9A45C;
  --r: 12px; --rs: 9px;
  --side: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'PJS', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--tqd); }
a:hover { color: var(--np); }
h1, h2, h3 { font-family: 'Jost', 'PJS', sans-serif; font-weight: 500; margin: 0; letter-spacing: -.005em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 18px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(11, 143, 153, .45); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--sub); }
.small { font-size: 12.5px; }
.red { color: var(--red); }

/* ---------- Buttons ---------- */
.btn { height: 38px; padding: 0 14px; border-radius: var(--rs); border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--tq); color: var(--ink); }
.btn.primary { background: var(--tq); border-color: var(--tq); color: #fff; }
.btn.primary:hover { background: var(--tqd); border-color: var(--tqd); color: #fff; }
.btn.dark { background: var(--np); border-color: var(--np); color: #fff; }
.btn.small { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn.big { height: 46px; padding: 0 20px; font-size: 14.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--tqd); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.chip.warn { background: var(--amber-bg); color: var(--amber); }
.chip.info { background: var(--tql); color: var(--tqd); }
.chip.grey { background: var(--line2); color: var(--sub); }
.chip.dark { background: var(--np); color: #fff; }
.chip.red { background: var(--red-bg); color: var(--red); }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--sub); }
.field input, .field select, .field textarea { height: 40px; border: 1px solid var(--line); border-radius: var(--rs); padding: 0 12px; background: var(--surface); width: 100%; }
.field textarea { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inl:focus { border-color: var(--tq); outline: none; box-shadow: 0 0 0 3px rgba(11,143,153,.15); }
.field input:read-only, .field textarea:read-only { background: var(--bg); border-color: transparent; }
.rov { min-height: 40px; display: flex; align-items: center; padding: 0 12px; background: var(--bg); border-radius: var(--rs); }
.inl { height: 36px; border: 1px solid var(--line); border-radius: var(--rs); padding: 0 11px; background: var(--surface); min-width: 0; }
select.inl { padding: 0 8px; }
select.mini { height: 28px; font-size: 12px; padding: 0 6px; max-width: 170px; }
.form2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.cbx { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; min-height: 38px; cursor: pointer; }
.cbx input { width: 18px; height: 18px; accent-color: var(--tq); }
.cbxlist { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.radio { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.radio input { accent-color: var(--tq); }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.k { font-family: 'PJS', sans-serif; font-size: 13px; font-weight: 700; color: var(--ink); margin: 0; }
.okbox, .warnbox { border-radius: var(--rs); padding: 10px 14px; font-size: 13.5px; font-weight: 500; }
.okbox { background: var(--tql); color: var(--tqd); }
.warnbox { background: var(--amber-bg); color: var(--amber); }
.medbox { background: var(--tqx); border: 1px solid var(--tql); border-radius: var(--rs); padding: 12px 14px; font-size: 13.5px; }
.medbox p { margin: 4px 0 0; }
.action { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; border: 1px solid #E8C98E; background: #FFFBF3; }
.action p { margin: 0; }
.issues { margin: 6px 0 4px; padding-inline-start: 20px; }
.issues li { margin: 3px 0; }

/* ---------- Grundgerüst Team: Seitenleiste ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px 16px; background: var(--surface); border-inline-end: 1px solid var(--line); }
.side .brand { display: block; padding: 4px 10px 18px; direction: ltr; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--rs); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.side nav a svg { color: var(--sub); flex: none; }
.side nav a:hover { background: var(--bg); }
.side nav a.on { background: var(--tql); color: var(--np); }
.side nav a.on svg { color: var(--tqd); }
.side nav a .count { margin-inline-start: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--tq); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 20px; }
.side nav a .count.red { background: var(--red); }
.side .who { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.side .who b { display: block; font-weight: 700; }
.side .who .row { gap: 6px; }
.main { min-width: 0; padding: 26px 32px 60px; max-width: 1360px; width: 100%; }
.banner { margin: -26px -32px 20px; padding: 9px 32px; background: var(--np); color: #fff; font-size: 13px; }
.sysbar { margin-bottom: 16px; }
.mtop, .tabbar { display: none; }

/* ---------- Grundgerüst Partner/Patient: Kopfzeile ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); direction: ltr; }
.top .brand span { font-size: 13px; font-weight: 600; color: var(--sub); padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
[dir=rtl] .top .brand span { direction: rtl; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { padding: 8px 12px; border-radius: var(--rs); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.top nav a.on { background: var(--tql); color: var(--np); }
.top .me { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.wrap { padding: 22px 24px 48px; max-width: 1180px; margin: 0 auto; }

/* ---------- Seitenkopf, Filter ---------- */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.pagehead p { margin: 4px 0 0; color: var(--sub); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 280px; max-width: 460px; }
.search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--rs); padding: 0 12px 0 38px; background: var(--surface); }
[dir=rtl] .search input { padding: 0 38px 0 12px; }
.search svg { position: absolute; inset-inline-start: 12px; top: 12px; color: var(--faint); }
.seg { display: inline-flex; background: var(--line2); border-radius: var(--rs); padding: 3px; gap: 2px; }
.seg button, .seg label { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--sub); }
.seg button.on, .seg label.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15,42,46,.12); }
.seg button b { font-weight: 700; color: var(--faint); }
.seg.big label { padding: 10px 18px; font-size: 14px; }
.seg.big input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:focus-within { outline: 3px solid rgba(11, 143, 153, .45); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pills button { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--sub); display: inline-flex; gap: 6px; }
.pills button b { color: var(--ink); font-weight: 700; }
.pills button.on { background: var(--np); border-color: var(--np); color: #fff; }
.pills button.on b { color: #fff; }
.pills button:disabled { opacity: .45; cursor: default; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.bar input[type=search] { height: 40px; border: 1px solid var(--line); border-radius: var(--rs); padding: 0 14px; min-width: 220px; flex: 1 1 240px; max-width: 420px; background: var(--surface); }
.bar label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; font-size: 13px; color: var(--sub); }

/* ---------- Aufgaben ---------- */
.tlist { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: 10px minmax(0, 1fr) minmax(0, 1.5fr) 96px; gap: 16px; align-items: center; padding: 13px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line2); }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--tqx); color: var(--ink); }
.trow .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.trow.od .dot { background: var(--red); }
.trow.nw .dot { background: var(--tq); }
.trow .who b, .trow .what b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .what b { font-weight: 600; white-space: normal; }
.trow small { display: block; color: var(--sub); font-size: 12.5px; }
.trow .when { text-align: end; font-size: 13px; color: var(--sub); }
.trow.od .when b { color: var(--red); }
.empty { padding: 36px 20px; text-align: center; color: var(--sub); }
.empty b { display: block; font-family: 'Jost', sans-serif; font-weight: 500; font-size: 20px; color: var(--ink); margin-bottom: 4px; }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: start; font-size: 12px; font-weight: 600; color: var(--sub); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
table.click tbody tr { cursor: pointer; }
table.click tbody tr:hover td { background: var(--tqx); }
td a.name { font-weight: 700; text-decoration: none; color: var(--ink); }
td small { display: block; color: var(--sub); font-size: 12.5px; }

/* ---------- Fallseite ---------- */
.back { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; margin-bottom: 10px; font-size: 13.5px; }
.chead { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.chead h1 { font-size: 28px; }
.chead .meta { margin: 5px 0 0; color: var(--sub); font-size: 13.5px; }
.chead .k { color: var(--sub); font-weight: 600; }
.chead .sub { color: var(--sub); margin-top: 4px; }
/* Der Weg des Patienten – das eine prägnante Element */
.track { list-style: none; display: flex; padding: 0; margin: 4px 0 22px; position: relative; }
.track li { flex: 1; position: relative; padding-top: 20px; font-size: 12px; font-weight: 600; color: var(--faint); text-align: center; }
.track li::before { content: ''; position: absolute; top: 6px; inset-inline: 0; height: 3px; background: var(--line); }
.track li::after { content: ''; position: absolute; top: 2px; inset-inline-start: calc(50% - 5.5px); width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); box-sizing: border-box; }
.track li.d { color: var(--sub); }
.track li.d::before { background: var(--tq); }
.track li.d::after { background: var(--tq); border-color: var(--tq); }
.track li.c { color: var(--np); font-weight: 700; }
.track li.c::before { background: linear-gradient(90deg, var(--tq) 50%, var(--line) 50%); }
[dir=rtl] .track li.c::before { background: linear-gradient(270deg, var(--tq) 50%, var(--line) 50%); }
.track li.c::after { width: 17px; height: 17px; top: -1px; inset-inline-start: calc(50% - 8.5px); background: var(--tq); border: 4px solid var(--tql); box-shadow: 0 0 0 1px var(--tq); }
.track li.x { text-decoration: line-through; opacity: .55; }
.cgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.cgrid > aside { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 14px; }
.now { border: 1px solid var(--tq); box-shadow: 0 0 0 3px var(--tqx); }
.now .nowhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.now .nowhead h2 { font-size: 21px; }
.chk { display: flex; align-items: center; gap: 11px; min-height: 38px; font-size: 14px; cursor: pointer; padding: 2px 0; }
.chk input { width: 20px; height: 20px; accent-color: var(--tq); flex: none; }
.chk.done span { color: var(--sub); text-decoration: line-through; }
.chk.locked { cursor: default; }
.chk.locked span { color: var(--sub); }
.chk small { margin-inline-start: auto; color: var(--faint); font-size: 12px; text-align: end; }
.stepbody { border-top: 1px solid var(--line2); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.stepbody > .k { color: var(--sub); }
/* Aufklappbare Bereiche */
details.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
details.sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: ''; width: 8px; height: 8px; border-inline-end: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); margin-inline-start: auto; flex: none; transition: transform .15s; }
details.sec[open] > summary::after { transform: rotate(225deg); }
details.sec > summary .st { font-weight: 700; }
details.sec > summary .ss { color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
details.sec > .sb { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
details.sec.warn { border-color: #E8C98E; background: #FFFBF3; }
/* Kurzinfo rechts */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--sub); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.aside-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.aside-card .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aside-card .big { font-family: 'Jost', sans-serif; font-size: 24px; }
/* Menü „Mehr“ */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .mlist { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 14px 40px rgba(15,42,46,.16); padding: 6px; display: flex; flex-direction: column; }
details.menu .mlist button { text-align: start; border: 0; background: none; padding: 9px 12px; border-radius: 8px; font-weight: 500; font-size: 13.5px; }
details.menu .mlist button:hover { background: var(--bg); }
details.menu .mlist button.danger { color: var(--red); }
details.menu .mlist hr { border: 0; border-top: 1px solid var(--line2); margin: 4px 0; }
/* Listen, Geld */
.list > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.list > div:last-child { border-bottom: 0; }
.money > div { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line2); font-size: 13.5px; }
.money > div.tot { font-weight: 700; font-size: 15px; border-bottom: 0; }
.money > div.svc { color: var(--tqd); font-weight: 600; }
.money input.num { width: 130px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; text-align: end; background: var(--surface); }
.settle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; font-size: 12.5px; background: var(--bg); border-radius: var(--rs); padding: 10px 12px; }
.settle > div { display: flex; flex-direction: column; gap: 3px; }
.settle span { display: flex; justify-content: space-between; gap: 8px; }
.settle em { font-style: normal; color: var(--sub); }
.settle .sum { border-top: 1px solid var(--line); padding-top: 3px; font-weight: 700; }
.settle .bal { grid-column: 1 / -1; display: flex; justify-content: space-between; font-weight: 700; font-size: 13.5px; }
.settle .bal.neg { color: var(--amber); }
.offer { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.offer .big { font-family: 'Jost', sans-serif; font-size: 30px; color: var(--np); }
.note { padding: 9px 0; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 2px; }
.note.sys { color: var(--sub); font-size: 12.5px; }
.note .by { font-size: 12px; color: var(--faint); }
.upf { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding-top: 4px; }
.upf input[type=file] { font-size: 12.5px; min-width: 0; }
.upf input[type=file]::file-selector-button { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; margin-inline-end: 8px; }
.docs > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.docs > div:last-child { border-bottom: 0; }
.docs a { font-weight: 600; text-decoration: none; }

/* ---------- Nachrichten ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px -20px 4px; padding: 0 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 10px; font-weight: 600; font-size: 13.5px; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--np); border-bottom-color: var(--tq); }
.tabs button b { font-weight: 700; color: var(--tq); }
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 6px 2px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { font-size: 11.5px; color: var(--sub); white-space: normal; }
.msg.firoza { align-self: flex-end; background: var(--tql); border-end-end-radius: 4px; }
.msg.partner { align-self: flex-start; background: var(--bg); border-end-start-radius: 4px; }
.msg.system { align-self: center; background: transparent; color: var(--sub); font-size: 12px; text-align: center; max-width: 95%; padding: 2px 8px; }
.msg.err { box-shadow: inset 0 0 0 1px var(--red); }
.composer { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line2); padding-top: 12px; }
.composer input[name=text] { flex: 1 1 240px; }

/* ---------- Eingang (zweispaltig wie ein Messenger) ---------- */
.inbox2 { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 560px; overflow: hidden; }
details.upd > summary { list-style: none; width: max-content; }
details.upd > summary::-webkit-details-marker { display: none; }
details.upd[open] > summary { margin-bottom: 8px; }
.clist { border-inline-end: 1px solid var(--line); overflow-y: auto; max-height: 72vh; }
.citem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 12px 16px; border-bottom: 1px solid var(--line2); cursor: pointer; text-align: start; width: 100%; background: none; border-inline: 0; border-top: 0; }
.citem:hover { background: var(--bg); }
.citem.on { background: var(--tqx); box-shadow: inset 3px 0 0 var(--tq); }
.citem b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem .t { color: var(--faint); font-size: 12px; }
.citem .p { grid-column: 1 / -1; color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem .n { justify-self: end; }
.cview { display: flex; flex-direction: column; min-width: 0; }
.cview .chd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line2); }
.cview .chd p { margin: 2px 0 0; color: var(--sub); font-size: 13px; }
.cview .thread { flex: 1; max-height: none; padding: 16px 18px; }
.cview .cft { border-top: 1px solid var(--line2); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cbk { display: none; }

/* ---------- Partnerportal, Patient ---------- */
.phero { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; padding: 20px 22px; margin-bottom: 16px; }
.phero h1 { font-size: 24px; }
.phero p { margin: 4px 0 0; max-width: 620px; }
.plist { display: flex; flex-direction: column; }
.pcard { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px 20px; align-items: center; padding: 14px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line2); }
.pcard:last-child { border-bottom: 0; }
.pcard:hover { background: var(--tqx); color: var(--ink); }
.pc1 { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pc1 b { font-size: 15px; }
.pc2 { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.todo { font-size: 13px; font-weight: 600; color: var(--amber); }
.stepper { list-style: none; display: flex; padding: 0; margin: 0 0 18px; gap: 4px; }
.stepper li { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--faint); padding-top: 9px; border-top: 4px solid var(--line); }
.stepper li.d { border-color: var(--tq); color: var(--tqd); }
.stepper li.c { border-color: var(--np); color: var(--np); font-weight: 700; }
.stepper li.x { opacity: .55; }
.stepper.small3 { margin: 0; }
.steps { display: flex; gap: 4px; margin-top: 10px; max-width: 560px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.d { background: var(--tq); }
.steps span.c { background: var(--np); }
.steps span.x { background: repeating-linear-gradient(90deg, var(--line) 0 3px, transparent 3px 6px); }
.steplbl { display: flex; gap: 4px; max-width: 560px; margin-top: 4px; }
.steplbl span { flex: 1; font-size: 10px; color: var(--sub); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.steplbl span.c { color: var(--ink); font-weight: 700; }
.mri { display: flex; flex-direction: column; gap: 8px; background: var(--bg); border-radius: var(--rs); padding: 12px 14px; margin-top: 8px; }
.op-only, .cu-only { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-family: 'Jost', sans-serif; font-weight: 500; font-size: 28px; color: var(--np); }
.kpi span:first-child { font-size: 12.5px; font-weight: 600; color: var(--sub); }
.kpi b.red { color: var(--red); }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbars div { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto; gap: 8px; align-items: center; font-size: 12.5px; }
.hbars i { display: block; height: 10px; border-radius: 5px; background: var(--tq); min-width: 2px; }
.hbars b { font-size: 12px; white-space: nowrap; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel div { display: grid; grid-template-columns: 170px 1fr 48px 44px; gap: 8px; align-items: center; font-size: 13px; }
.funnel i { display: block; height: 18px; border-radius: 4px; background: var(--tq); min-width: 2px; }
.funnel em { font-style: normal; color: var(--sub); font-size: 11.5px; }
details summary { cursor: pointer; font-weight: 700; }

/* ---------- Anmeldung ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--np); background-image: radial-gradient(90% 70% at 20% 0%, #0E4A4E 0%, transparent 70%); }
.login form { width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px; padding: 30px 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.login .logo { margin-bottom: 6px; direction: ltr; }
.login .btn.primary { height: 44px; justify-content: center; }

/* ---------- Dialoge, Meldungen ---------- */
dialog { border: none; border-radius: 16px; padding: 0; width: min(560px, 94vw); box-shadow: 0 30px 80px rgba(0,0,0,.3); color: var(--ink); }
dialog::backdrop { background: rgba(6,42,44,.45); }
dialog form { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--np); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.25); z-index: 50; max-width: 90vw; }
.toast.bad { background: var(--red); }

/* ---------- Sprachen: Arabisch von rechts nach links ---------- */
[dir=rtl] body, [dir=rtl] input, [dir=rtl] select, [dir=rtl] textarea, [dir=rtl] button { font-family: 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Geeza Pro', Tahoma, system-ui, sans-serif; }
[dir=rtl] .back { display: inline-block; }
.langsel { height: 32px; font-size: 12.5px; }
svg { direction: ltr; unicode-bidi: isolate; }
.logo, .brand { direction: ltr; }

/* ---------- Upload-Seite (ohne Anmeldung) ---------- */
.uppage { background: var(--bg); }
.upwrap { max-width: 620px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.upwrap h1 { font-size: 25px; margin: 6px 0 0; }
.upwrap .card.panel { margin: 0; }
.upreq { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.upreq:last-child { border-bottom: 0; }
.up1 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.filebtn { position: relative; cursor: pointer; }
.fname { flex: 1 1 140px; word-break: break-all; }

/* ---------- Handy ---------- */
@media (max-width: 960px) {
  .cgrid { grid-template-columns: minmax(0, 1fr); }
  .cgrid > aside { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; direction: ltr; }
  .mtop .who { font-size: 12.5px; color: var(--sub); text-align: end; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; text-decoration: none; color: var(--sub); font-size: 11px; font-weight: 600; position: relative; }
  .tabbar a.on { color: var(--tqd); }
  .tabbar a .count { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); min-width: 17px; padding: 0 5px; border-radius: 9px; background: var(--tq); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; }
  .main { padding: 16px 14px 90px; }
  .banner { margin: -16px -14px 14px; padding: 8px 14px; }
  .form2, .form3, .grid3, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trow { grid-template-columns: 9px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; }
  .trow .what { grid-column: 2 / -1; grid-row: 2; }
  .trow .when { grid-row: 1; grid-column: 3; }
  .track li { font-size: 0; }
  .track li.c { font-size: 11px; }
  .chead h1 { font-size: 23px; }
  .inbox2 { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .top .me > span { display: none; }
  .top .langsel { width: auto; }
  .inbox2.sel .clist { display: none; }
  .inbox2:not(.sel) .cview { display: none; }
  .clist { border: 0; max-height: none; }
  .cbk { display: inline-flex; }
  .upf { grid-template-columns: minmax(0, 1fr); }
  .msg { max-width: 94%; }
  .pcard { grid-template-columns: minmax(0, 1fr); }
  .stepper li { font-size: 0; }
  .stepper li.c { font-size: 11px; }
  .wrap { padding: 14px 14px 40px; }
  .top { padding: 10px 14px; }
  .top .me { margin-inline-start: 0; width: 100%; justify-content: space-between; }
  .cbxlist { grid-template-columns: 1fr; }
  .funnel div { grid-template-columns: 120px 1fr 40px 40px; }
  details.menu .mlist { position: fixed; inset-inline: 10px; top: auto; bottom: 74px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Check-up: Gestaltung, Befunde, Bericht ---------- */
.cud { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); vertical-align: middle; flex: none; }
.cud.green { background: #2F9E6B; } .cud.yellow { background: #D99A1E; } .cud.red { background: #CF4A3F; } .cud.na { background: #A3B1B1; }
.pill { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--line2); }
.pill.green { background: #E3F3EB; color: #1E6E4A; } .pill.yellow { background: var(--amber-bg); color: var(--amber); } .pill.red { background: var(--red-bg); color: var(--red); }
.cutab { width: 100%; border-collapse: collapse; }
.cutab th { text-align: start; font-size: 12px; color: var(--sub); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cutab td { padding: 12px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.cutab tr[data-href] { cursor: pointer; }
.cutab tr[data-href]:hover td { background: var(--tqx); }
.cutab tr.off td { opacity: .55; }
.cutab td a { color: var(--ink); text-decoration: none; }
.cu-pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cu-sum { position: sticky; top: 16px; }
.cumap { position: relative; width: 100%; max-width: 170px; aspect-ratio: 608 / 1164; margin: 0 auto; background: #020B0C; border-radius: 12px; overflow: hidden; }
.cumap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cubd { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1.5px solid #fff; background: #A3B1B1; }
.cubd.off { opacity: .35; } .cubd.on { background: #2ED3DC; box-shadow: 0 0 10px 3px rgba(46,211,220,.6); }
.cubd.green { background: #2F9E6B; box-shadow: 0 0 10px 3px rgba(47,158,107,.6); } .cubd.yellow { background: #D99A1E; box-shadow: 0 0 10px 3px rgba(217,154,30,.65); } .cubd.red { background: #CF4A3F; box-shadow: 0 0 12px 4px rgba(207,74,63,.7); }
.cumods { border: 0; padding: 0; margin: 0 0 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.cumods legend { font-weight: 700; font-size: 12.5px; color: var(--tqd); padding: 8px 0 4px; }
.cumods .cbx { align-items: flex-start; padding: 6px 0; }
.cumods .cbx input { margin-top: 3px; }
.cu-ed { display: grid; grid-template-columns: 250px minmax(0, 1fr) 230px; gap: 14px; align-items: start; }
.modnav { display: flex; flex-direction: column; padding: 6px; position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow: auto; }
.modnav button { display: flex; gap: 10px; align-items: center; text-align: start; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--ink); line-height: 1.3; }
.modnav button:hover { background: var(--line2); }
.modnav button.on { background: var(--tql); font-weight: 700; }
.modnav .sumbtn { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; padding-top: 12px; }
.cu-side { position: sticky; top: 16px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.vcell { display: grid; gap: 4px; background: var(--tqx); border-radius: var(--rs); padding: 10px 12px; }
.vl { font-size: 12.5px; font-weight: 600; }
.vi { display: flex; align-items: center; gap: 8px; }
.vi input { width: 90px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; font-variant-numeric: tabular-nums; }
.vi .u { font-size: 12px; color: var(--sub); flex: 1; }
.stbtns { border: 0; padding: 0; margin: 0; }
.stbtns legend { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.stbtns .seg { flex-wrap: wrap; }
.imgpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.ip { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: var(--rs); padding: 8px; position: relative; }
.ip input[type=checkbox] { position: absolute; top: 12px; inset-inline-start: 12px; width: 18px; height: 18px; }
.ip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #000; }
.ip .inl { height: 30px; font-size: 12.5px; }
.cu-pat { border-color: var(--tq); background: var(--tqx); }
@media (max-width: 1100px) { .cu-ed { grid-template-columns: 220px minmax(0, 1fr); } .cu-side { grid-column: 1 / -1; position: static; } .cu-pgrid { grid-template-columns: 1fr; } .cu-sum { position: static; } }
@media (max-width: 760px) { .cu-ed { grid-template-columns: 1fr; } .modnav { position: static; max-height: none; flex-direction: row; overflow-x: auto; } .modnav button { white-space: nowrap; } }
.main > .tabs { margin: 0 0 16px; padding: 0; }
.brand svg, .logo svg { direction: ltr; }
