/* =====================================================================
   NutriPlan - Design-System
   Farbwelt aus den NutriCampus-Entwuerfen (Blau, Gruen, Orange).
   Systemschriften, damit ohne externe Ressourcen gerendert wird
   (die Content-Security-Policy lässt keine Fremdquellen zu).
   ===================================================================== */

:root {
    --blue-dark:   #2A5A9E;
    --blue-main:   #376AB1;
    --blue-mid:    #4A7EC5;
    --blue-light:  #DDEDF8;
    --blue-pale:   #EEF5FB;
    --blue-ghost:  #F6FAFD;

    --green:       #3DAA6D;
    --green-dark:  #2E8B57;
    --green-pale:  #E7F6ED;
    --orange:      #E8913A;
    --orange-pale: #FDF2E4;
    --red:         #C4443B;
    --red-pale:    #FBEDEC;

    --white:       #FFFFFF;
    --gray-50:     #F7F9FC;
    --gray-100:    #EDF0F7;
    --gray-200:    #D8DDE8;
    --gray-300:    #B4BDD0;
    --gray-500:    #6B7A94;
    --gray-700:    #3D4A5C;
    --gray-900:    #1A2332;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(42, 90, 158, 0.08);
    --shadow:    0 2px 10px rgba(42, 90, 158, 0.09);
    --shadow-lg: 0 8px 28px rgba(42, 90, 158, 0.14);

    --sidebar-w: 244px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 .8rem; }

a { color: var(--blue-main); text-decoration: none; }
a:hover { text-decoration: underline; }

small, .small { font-size: .85rem; }
.muted { color: var(--gray-500); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------- Layout */

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: .6rem;
}
.sidebar-brand .logo {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--blue-main), var(--blue-mid));
    color: #fff; font-weight: 700; font-size: .95rem;
    display: grid; place-items: center;
}
.sidebar-brand .name { font-weight: 650; font-size: 1rem; color: var(--gray-900); }
.sidebar-brand .practice { font-size: .78rem; color: var(--gray-500); }

.sidebar-actions { padding: .9rem 1rem .4rem; display: grid; gap: .5rem; }

.nav { padding: .5rem .6rem 1.5rem; }
.nav-group-title {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--gray-300); padding: .9rem .65rem .3rem; font-weight: 600;
}
.nav a {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .65rem; margin-bottom: 1px;
    border-radius: var(--radius-sm);
    color: var(--gray-700); font-size: .92rem; text-decoration: none;
}
.nav a:hover { background: var(--blue-ghost); color: var(--blue-dark); }
.nav a.active { background: var(--blue-light); color: var(--blue-dark); font-weight: 600; }
.nav a .ico { width: 18px; text-align: center; opacity: .85; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: .75rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 1.05rem; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }

.content { padding: 1.5rem; max-width: 1400px; width: 100%; }

.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--blue-light); color: var(--blue-dark);
    display: grid; place-items: center; font-size: .8rem; font-weight: 650;
}

/* ---------------------------------------------------------------- Karten */

.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}
.card-head {
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 1.1rem; }
.card-body.tight { padding: .6rem 1.1rem; }
.card-foot {
    padding: .75rem 1.1rem; border-top: 1px solid var(--gray-100);
    background: var(--gray-50); border-radius: 0 0 var(--radius) var(--radius);
}

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-sidebar { grid-template-columns: 1fr; }
}
.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 38px; height: 38px;
    margin-right: .6rem; padding: 0 8px; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 8px; background: #fff; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; background: var(--gray-900, #111827); border-radius: 2px; }
.menu-toggle[aria-expanded="true"] { background: var(--gray-100, #f3f4f6); }
@media (max-width: 780px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .sidebar { position: fixed; top: 0; bottom: 0; left: -260px; z-index: 60; transition: left .2s; overflow-y: auto; }
    .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(17, 24, 39, .4); }
    .sidebar-backdrop[hidden] { display: none; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 1rem; }
}

/* Kennzahlen */
.stat {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 1rem 1.1rem;
}
.stat .label { font-size: .8rem; color: var(--gray-500); }
.stat .value { font-size: 1.7rem; font-weight: 650; color: var(--blue-dark); line-height: 1.2; }
.stat .hint { font-size: .78rem; color: var(--gray-500); }

/* ---------------------------------------------------------------- Buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .52rem .95rem;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font: inherit; font-size: .9rem; font-weight: 550;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue-main); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-outline { background: var(--white); border-color: var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--blue-mid); color: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a83a32; color: #fff; }
.btn-sm { padding: .32rem .65rem; font-size: .82rem; }
.btn-lg { padding: .7rem 1.3rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- Formulare */

.form-row { margin-bottom: 1rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } }

label { display: block; font-size: .86rem; font-weight: 550; color: var(--gray-700); margin-bottom: .3rem; }
label .req { color: var(--red); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=tel], input[type=search],
input[type=url], select, textarea {
    width: 100%; padding: .5rem .65rem;
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    font: inherit; font-size: .92rem; color: var(--gray-900); background: var(--white);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--blue-mid);
    box-shadow: 0 0 0 3px rgba(74, 126, 197, .16);
}
input[disabled], select[disabled], textarea[disabled] { background: var(--gray-50); color: var(--gray-500); }
textarea { min-height: 90px; resize: vertical; }
.field-hint { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; }
.field-error { font-size: .8rem; color: var(--red); margin-top: .25rem; }
input.has-error, select.has-error, textarea.has-error { border-color: var(--red); }

.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .9rem; }
.check input { width: auto; margin-top: .2rem; }
.check label { margin: 0; font-weight: 400; }

.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Tabellen */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
    text-align: left; font-weight: 600; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500);
    padding: .55rem .7rem; border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
table.data td { padding: .6rem .7rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
table.data tbody tr:hover { background: var(--blue-ghost); }
table.data tr.clickable { cursor: pointer; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 600; border-top: 2px solid var(--gray-200); }

.empty {
    padding: 2.5rem 1rem; text-align: center; color: var(--gray-500);
}
.empty .big { font-size: 2rem; margin-bottom: .5rem; }

/* ---------------------------------------------------------------- Hinweise */

.alert {
    padding: .75rem 1rem; border-radius: var(--radius-sm);
    border: 1px solid transparent; margin-bottom: 1rem; font-size: .9rem;
}
.alert-success { background: var(--green-pale); border-color: #BFE5CE; color: #1F6B41; }
.alert-info    { background: var(--blue-pale);  border-color: #C6DEF3; color: var(--blue-dark); }
.alert-warning { background: var(--orange-pale);border-color: #F3D5AE; color: #8A5410; }
.alert-error   { background: var(--red-pale);   border-color: #F0C7C4; color: #8E2C25; }

.badge {
    display: inline-block; padding: .15rem .5rem; border-radius: 999px;
    font-size: .75rem; font-weight: 600; line-height: 1.5;
}
.badge-blue   { background: var(--blue-light); color: var(--blue-dark); }
.badge-green  { background: var(--green-pale); color: var(--green-dark); }
.badge-orange { background: var(--orange-pale); color: #8A5410; }
.badge-red    { background: var(--red-pale); color: #8E2C25; }
.badge-gray   { background: var(--gray-100); color: var(--gray-700); }

/* Ampel für Teilnahmequoten und Zielabgleich */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; }
.dot-green { background: var(--green); }
.dot-orange { background: var(--orange); }
.dot-red { background: var(--red); }
.dot-gray { background: var(--gray-300); }

.progress { height: 8px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.progress.warn > span { background: var(--orange); }
.progress.bad > span { background: var(--red); }

/* ---------------------------------------------------------------- Anmeldung */

.auth-wrap {
    min-height: 100vh; display: grid; place-items: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, var(--blue-pale) 0%, var(--gray-50) 55%, var(--white) 100%);
}
.auth-card {
    width: 100%; max-width: 430px;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 2rem 1.85rem;
}
.auth-card.wide { max-width: 620px; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .logo {
    width: 52px; height: 52px; border-radius: 14px; margin: 0 auto .7rem;
    background: linear-gradient(135deg, var(--blue-main), var(--blue-mid));
    color: #fff; font-weight: 700; font-size: 1.3rem; display: grid; place-items: center;
}
.auth-brand h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.auth-brand p { color: var(--gray-500); font-size: .9rem; margin: 0; }
.auth-foot { margin-top: 1.4rem; text-align: center; font-size: .87rem; color: var(--gray-500); }
.auth-legal { margin-top: 1.5rem; text-align: center; font-size: .8rem; }
.auth-legal a { color: var(--gray-500); }

/* Wiederherstellungscode */
.code-box {
    font-family: var(--mono); font-size: 1.15rem; letter-spacing: .06em;
    background: var(--blue-ghost); border: 1px dashed var(--blue-mid);
    border-radius: var(--radius); padding: 1rem; text-align: center;
    word-break: break-all; color: var(--blue-dark);
}
.code-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; font-family: var(--mono); }
.code-list span { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 6px; padding: .35rem .5rem; text-align: center; }

/* Kleinigkeiten */
.divider { height: 1px; background: var(--gray-200); margin: 1.25rem 0; }
.inline-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: .35rem 1rem; font-size: .9rem; }
.kv dt { color: var(--gray-500); }
.kv dd { margin: 0; }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- Kalender */

.cal-toolbar {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    padding: .7rem 1.1rem; border-bottom: 1px solid var(--gray-100);
}
.cal-title { font-weight: 600; font-size: 1.05rem; min-width: 210px; }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--gray-200); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--gray-200); }

.cal-head {
    background: var(--gray-50); padding: .45rem .6rem; text-align: center;
    font-size: .78rem; font-weight: 600; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: .04em;
}
.cal-day {
    background: var(--white); min-height: 130px; padding: .4rem;
    display: flex; flex-direction: column; gap: .25rem;
}
.cal-day.outside { background: var(--gray-50); }
.cal-day.today { background: var(--blue-ghost); }
.cal-day.closed { background: repeating-linear-gradient(45deg, #fff, #fff 6px, var(--gray-50) 6px, var(--gray-50) 12px); }
.cal-daynum { font-size: .8rem; font-weight: 600; color: var(--gray-500); display: flex; justify-content: space-between; }
.cal-day.today .cal-daynum { color: var(--blue-dark); }
.cal-daynum a { opacity: 0; font-weight: 400; }
.cal-day:hover .cal-daynum a { opacity: 1; }

.appt {
    display: block; padding: .28rem .4rem; border-radius: 5px; font-size: .78rem;
    background: var(--blue-light); color: var(--blue-dark); text-decoration: none;
    border-left: 3px solid var(--blue-main); line-height: 1.35;
}
.appt:hover { text-decoration: none; filter: brightness(.97); }
.appt .t { font-weight: 600; }
.appt.status-confirmed { background: var(--green-pale); color: var(--green-dark); border-left-color: var(--green); }
.appt.status-completed { background: var(--gray-100); color: var(--gray-700); border-left-color: var(--gray-300); }
.appt.status-no_show   { background: var(--red-pale); color: #8E2C25; border-left-color: var(--red); }
.appt.is-event         { background: var(--orange-pale); color: #8A5410; border-left-color: var(--orange); }

@media (max-width: 900px) {
    .cal-week, .cal-month { grid-template-columns: 1fr; }
    .cal-head { text-align: left; }
    .cal-day { min-height: auto; }
}

/* ---------------------------------------------------------- Speiseplan */

.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
@media (max-width: 1150px) { .plan-layout { grid-template-columns: 1fr; } }

.day-tabs { display: flex; gap: .3rem; flex-wrap: wrap; padding: .7rem 1.1rem; border-bottom: 1px solid var(--gray-100); }
.day-tabs a {
    padding: .35rem .75rem; border-radius: var(--radius-sm); font-size: .87rem;
    color: var(--gray-700); text-decoration: none; border: 1px solid transparent;
}
.day-tabs a:hover { background: var(--gray-50); text-decoration: none; }
.day-tabs a.active { background: var(--blue-main); color: #fff; }

.meal { border-bottom: 1px solid var(--gray-100); }
.meal:last-child { border-bottom: 0; }
.meal-head {
    display: flex; align-items: center; gap: .6rem;
    padding: .6rem 1.1rem; background: var(--gray-50);
}
.meal-head .name { font-weight: 600; }
.meal-head .time { color: var(--gray-500); font-size: .85rem; }
.meal-head .kcal { margin-left: auto; font-size: .85rem; color: var(--gray-500); font-variant-numeric: tabular-nums; }

.item-row {
    display: grid; grid-template-columns: 1fr 190px 90px 110px;
    gap: .5rem; align-items: center;
    padding: .4rem 1.1rem; border-top: 1px solid var(--gray-100);
}
.item-row:first-child { border-top: 0; }
.item-row.child { padding-left: 2.4rem; background: var(--blue-ghost); }
.item-row .item-name { font-size: .92rem; }
.item-row .item-name .sub { font-size: .76rem; color: var(--gray-500); }
.item-row .amount { display: flex; gap: .3rem; align-items: center; }
.item-row .amount input { width: 68px; padding: .28rem .4rem; font-size: .85rem; }
.item-row .amount select { padding: .28rem .4rem; font-size: .85rem; }
.item-row .kcal { text-align: right; font-variant-numeric: tabular-nums; font-size: .88rem; }
.item-row .actions { display: flex; gap: .2rem; justify-content: flex-end; }
.item-row .actions button {
    border: 0; background: transparent; cursor: pointer; color: var(--gray-500);
    padding: .18rem .35rem; border-radius: 4px; font-size: .8rem;
}
.item-row .actions button:hover { background: var(--gray-100); color: var(--blue-dark); }
.item-row .actions button.danger:hover { background: var(--red-pale); color: var(--red); }
@media (max-width: 760px) {
    .item-row { grid-template-columns: 1fr; gap: .25rem; }
    .item-row .kcal, .item-row .actions { justify-self: start; text-align: left; }
}

.add-row { padding: .5rem 1.1rem .8rem; position: relative; }
.add-row input.search { width: 100%; max-width: 460px; }
.search-results {
    position: absolute; z-index: 40; background: #fff; border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    max-height: 320px; overflow-y: auto; width: 460px; max-width: 92vw; margin-top: 2px;
}
.search-results .res {
    padding: .45rem .7rem; cursor: pointer; border-bottom: 1px solid var(--gray-100); font-size: .9rem;
}
.search-results .res:last-child { border-bottom: 0; }
.search-results .res:hover, .search-results .res.sel { background: var(--blue-pale); }
.search-results .res .sub { font-size: .76rem; color: var(--gray-500); }
.search-results .res .kc { float: right; color: var(--gray-500); font-size: .8rem; }
.search-results .hint { padding: .5rem .7rem; color: var(--gray-500); font-size: .82rem; }

.totals-box { position: sticky; top: 74px; }
.totals-box.analysis { position: static; }
.totals-row { display: flex; justify-content: space-between; align-items: baseline; padding: .3rem 0; font-size: .9rem; }
.totals-row .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.totals-row.big .v { font-size: 1.35rem; color: var(--blue-dark); }
.target-bar { height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; margin: .15rem 0 .5rem; }
.target-bar > span { display: block; height: 100%; background: var(--green); }
.target-bar.under > span { background: var(--orange); }
.target-bar.over > span { background: var(--red); }

.relation-bar { display: flex; height: 22px; border-radius: 5px; overflow: hidden; font-size: .7rem; color: #fff; }
.relation-bar div { display: grid; place-items: center; }
.relation-bar .p { background: var(--blue-main); }
.relation-bar .f { background: var(--orange); }
.relation-bar .c { background: var(--green); }
.relation-bar .a { background: var(--gray-500); }

/* ---------- Kennzahlen-Raster, Kurse, Anwesenheit ---------- */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem 1.4rem; }
.kv-grid .kv-label { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--gray-500, #6b7280); margin-bottom: .1rem; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.6rem; }
.two-col h4 { margin: 0 0 .3rem; font-size: .95rem; }

.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline-block; margin-left: .25rem; }
.row-actions details { display: inline-block; position: relative; }
.row-actions details[open] > .stack-sm { position: absolute; right: 0; z-index: 20; background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb); border-radius: 8px; padding: .6rem;
    box-shadow: 0 6px 20px rgba(0,0,0,.12); width: 260px; }
.row-actions summary { list-style: none; cursor: pointer; }
.row-actions summary::-webkit-details-marker { display: none; }
.stack-sm { display: flex; flex-direction: column; gap: .4rem; }

table.data td.center, table.data th.center { text-align: center; }
.attendance-grid th.rotate { font-size: .72rem; text-align: center; padding-left: 2px; padding-right: 2px; }
.attendance-grid td.att { text-align: center; font-weight: 600; width: 2rem; }
.attendance-grid td.att-present { color: #2f8f52; }
.attendance-grid td.att-made_up { color: #2f6f8f; }
.attendance-grid td.att-excused { color: #b07b28; }
.attendance-grid td.att-absent  { color: #b23c3c; }
.attendance-grid td.att-none    { color: var(--gray-300, #d1d5db); }
.attendance-grid tr.is-cancelled { opacity: .5; text-decoration: line-through; }

.session-tabs { flex-wrap: wrap; }
.session-tabs .btn { min-width: 2.1rem; text-align: center; }

.unit-row { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; padding: .6rem 1rem 1rem;
    margin-bottom: 1rem; }
.unit-row legend { font-size: .8rem; font-weight: 600; color: var(--gray-500, #6b7280); padding: 0 .4rem; }

.appt.is-course { background: #eef4fb; border-left: 3px solid var(--blue-main, #376AB1); }
.appt.is-course.is-cancelled { text-decoration: line-through; opacity: .55; }

.setting-tile { display: block; padding: .9rem 1rem; border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px; text-decoration: none; color: inherit; background: #fff; }
.setting-tile:hover { border-color: var(--blue-main, #376AB1); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.setting-tile .tile-title { display: block; font-weight: 600; margin-bottom: .2rem; }
.setting-tile .tile-text { display: block; font-size: .85rem; color: var(--gray-500, #6b7280); }

/* Praxislogo im Seitenkopf. Fehlt es, bleibt das Monogramm sichtbar. */
a.sidebar-brand { text-decoration: none; color: inherit; }
a.sidebar-brand:hover .name { color: var(--blue-main); }
.sidebar-brand .logo-img {
    max-width: 44px; max-height: 44px; width: auto; height: auto;
    border-radius: 8px; object-fit: contain; flex: 0 0 auto;
}
.sidebar-brand .name { line-height: 1.25; }

/* Schnellerfassung im Ernährungsprotokoll */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .35rem .9rem; }
.quick-item { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .25rem .4rem; border-radius: 6px; }
.quick-item:hover { background: var(--gray-50, #f9fafb); }
.quick-item .quick-label { display: flex; flex-direction: column; line-height: 1.2; }
.search-results { position: relative; margin-top: .4rem; max-height: 240px; overflow-y: auto;
    border: 1px solid var(--gray-200, #e5e7eb); border-radius: 8px; background: #fff; }
.search-results div { padding: .4rem .6rem; cursor: pointer; font-size: .9rem; }
.search-results div:hover, .search-results div.active { background: #eef4fb; }

/* Pflichtangabe zur Herkunft der Nährwertdaten */
.bls-source { font-size: .76rem; line-height: 1.4; color: var(--gray-500, #6b7280);
    margin: .8rem 0 0; }
.bls-source.tight { margin: .3rem 0 0; }

/* Blätterleiste unter langen Listen */
.pager { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.pager .spacer { flex: 1 1 auto; }
.pager .is-disabled { pointer-events: none; opacity: .4; }

/* Info-Symbol an Kacheln und einfache Dialoge */
.info-dot { display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--blue-main, #376AB1);
    color: var(--blue-main, #376AB1); background: #fff; font: 700 .72rem/1 Georgia, serif;
    cursor: pointer; padding: 0; flex: 0 0 auto; vertical-align: middle; }
.info-dot:hover, .info-dot:focus { background: var(--blue-main, #376AB1); color: #fff; outline: none; }
span.info-dot { cursor: default; width: 16px; height: 16px; font-size: .62rem; }

.setting-tile { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem;
    border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; background: #fff; }
.setting-tile:hover { border-color: var(--blue-main, #376AB1); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.setting-tile .tile-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.setting-tile .tile-title { font-weight: 600; text-decoration: none; color: inherit; }
.setting-tile .tile-text { font-size: .85rem; color: var(--gray-500, #6b7280); text-decoration: none; }
.setting-tile .tile-title:hover, .setting-tile .tile-text:hover { color: var(--blue-main, #376AB1); }

.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
    justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); }
.modal-box { position: relative; width: min(640px, 100%); max-height: 90vh; overflow: auto;
    background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100, #f3f4f6); }
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-close { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer;
    color: var(--gray-500, #6b7280); padding: 0 .2rem; }
.modal-close:hover { color: var(--gray-900, #111827); }
.modal-body { padding: 1rem 1.25rem; font-size: .93rem; line-height: 1.5; }
.modal-body p { margin: 0 0 .75rem; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.25rem;
    border-top: 1px solid var(--gray-100, #f3f4f6); }
body.modal-open { overflow: hidden; }

/* ---------- Gesamtanalyse im Speiseplan ---------- */
.analysis .stat-line { display: flex; justify-content: space-between; align-items: baseline;
    gap: .6rem; font-size: .9rem; margin-top: .55rem; }
.analysis .stat-line.big { font-size: 1rem; margin-top: 0; }
.analysis .stat-label { display: inline-flex; align-items: center; gap: .4rem; }
.analysis .stat-value strong { font-size: 1.05rem; }
.analysis .stat-line.big .stat-value strong { font-size: 1.25rem; }
.analysis .stat-target { color: var(--gray-500, #6b7280); font-size: .8rem; }

.analysis .target-bar { height: 10px; background: var(--gray-100, #f3f4f6); border-radius: 999px;
    overflow: hidden; margin: .25rem 0 .1rem; }
.analysis .target-bar > span { display: block; height: 100%; border-radius: 999px;
    transition: width .25s ease; background: var(--gray-400, #9ca3af); }
.analysis .target-bar.energy > span { background: #C99BD8; }
.analysis .target-bar.fat > span { background: #F2C94C; }
.analysis .target-bar.carb > span { background: #E8913A; }
.analysis .target-bar.protein > span { background: #5B9BD5; }
.analysis .target-bar.fiber > span { background: #2FAF7A; }
.analysis .target-bar.over > span { background-image: repeating-linear-gradient(135deg,
    rgba(255,255,255,.35) 0 6px, transparent 6px 12px); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-energy { background: #C99BD8; }
.dot-fat { background: #F2C94C; }
.dot-carb { background: #E8913A; }
.dot-protein { background: #5B9BD5; }
.dot-fiber { background: #2FAF7A; }

.macro-layout { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; align-items: center;
    margin-top: .8rem; }
@media (max-width: 1100px) { .macro-layout { grid-template-columns: 1fr; } }
.donut-wrap { display: grid; place-items: center; }
.donut { width: 120px; height: 120px; transform: rotate(-90deg); }
.donut.small { width: 64px; height: 64px; }
.donut circle { fill: none; stroke-width: 7; }
.donut .ring-bg { stroke: var(--gray-100, #f3f4f6); }
.donut .seg { stroke-dasharray: 0 100; stroke-dashoffset: 25; transition: stroke-dasharray .25s ease; }
.donut .seg-fat { stroke: #F2C94C; }
.donut .seg-carb { stroke: #E8913A; }
.donut .seg-protein { stroke: #5B9BD5; }

.meal-donuts { display: flex; flex-wrap: wrap; gap: 1rem .6rem; }
.meal-donut { display: flex; flex-direction: column; align-items: center; width: 92px; text-align: center; }
.meal-donut-name { font-size: .8rem; margin-top: .3rem; line-height: 1.2; }

.micro-list { display: flex; flex-direction: column; }
.micro-row { display: grid; grid-template-columns: 1fr 120px 1fr; gap: .6rem; align-items: center;
    padding: .38rem 1rem; font-size: .84rem; }
.micro-row:nth-child(odd) { background: var(--gray-50, #f9fafb); }
.micro-name { color: var(--gray-700, #374151); }
.micro-value strong { font-size: .95rem; }
.micro-bar { position: relative; display: block; height: 8px; }
.micro-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px;
    background: #9DA8E8; transition: width .25s ease; }
.micro-row.over .micro-fill { background: #E8913A; }
.micro-row.under .micro-fill { background: #9DA8E8; }
.micro-row.ok .micro-fill { background: #2FAF7A; }
.micro-rda { position: absolute; left: 50%; top: -5px; height: 18px; border-left: 1px dashed #4B5A9B; }

/* Analyse-Seite: Panel dreispaltig, auf schmalen Bildschirmen untereinander */
.analysis-grid { display: grid; grid-template-columns: 1.1fr .9fr 1.2fr; gap: 1rem; align-items: start; }
@media (max-width: 1200px) { .analysis-grid { grid-template-columns: 1fr; } }
.analysis-grid .card { margin: 0; }

/* Gesamtanalyse in der schmalen Seitenspalte: Werte nie umbrechen, Kreis kleiner */
.analysis .stat-value { white-space: nowrap; flex: 0 0 auto; }
.analysis .stat-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-layout .analysis .macro-layout { grid-template-columns: 96px minmax(0, 1fr); gap: .6rem; }
.plan-layout .analysis .donut { width: 96px; height: 96px; }
.plan-layout .analysis .stat-value strong { font-size: .98rem; }
.plan-layout .analysis .stat-line.big .stat-value strong { font-size: 1.15rem; }
.plan-layout .analysis .stat-line { font-size: .86rem; }
.plan-layout { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1150px) { .plan-layout { grid-template-columns: 1fr; } }

/* KI-Assistent ------------------------------------------------------- */
.ai-badge { display: inline-block; padding: .05rem .4rem; border-radius: 4px; font-size: .68rem; font-weight: 700;
    letter-spacing: .04em; background: var(--blue-main, #376AB1); color: #fff; vertical-align: middle; margin-right: .25rem; }
.ai-card { border-left: 3px solid var(--blue-main, #376AB1); }
.ai-card .card-head h2, .ai-card .card-head h3 { display: flex; align-items: center; gap: .35rem; }
.ai-status { min-height: 1.2em; }
.ai-status.ai-busy::before { content: ''; display: inline-block; width: .8em; height: .8em; margin-right: .4em;
    border: 2px solid var(--blue-main, #376AB1); border-right-color: transparent; border-radius: 50%;
    animation: ai-spin .8s linear infinite; vertical-align: -.1em; }
.ai-status.ai-error { color: #b91c1c; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-result { margin-top: 1rem; border-top: 1px solid var(--gray-100, #f3f4f6); padding-top: .75rem; }
.ai-section { margin-bottom: 1rem; }
.ai-section h4 { margin: 0 0 .4rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--gray-500, #6b7280); }
.ai-section ul { margin: 0 0 .5rem 1.1rem; }
.ai-section textarea { width: 100%; }
.ai-section .btn { margin-top: .25rem; }
.ai-list { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .5rem; }
.ai-item { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .6rem; border: 1px solid var(--gray-100, #f3f4f6);
    border-radius: 8px; background: #fff; cursor: pointer; font-weight: 400; }
.ai-item input { margin-top: .25rem; flex: 0 0 auto; }
.ai-item strong { margin-right: .4rem; }
.ai-item .badge { vertical-align: middle; }
.ai-draft { margin-top: .5rem; padding: .6rem .75rem; border: 1px dashed var(--blue-main, #376AB1); border-radius: 8px;
    background: rgba(55, 106, 177, .04); }
.ai-draft-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.ai-draft textarea { width: 100%; margin-bottom: .4rem; }
.item-row .actions .ai-swap { font: 700 .62rem/1 inherit; letter-spacing: .04em; color: #fff; background: var(--blue-main, #376AB1);
    border-radius: 4px; padding: .15rem .35rem; }
.ai-items select { max-width: 320px; }
tr.ai-unresolved td { background: rgba(232, 145, 58, .07); }

/* Rezeptfotos ------------------------------------------------------- */
.recipe-photo { border-bottom: 1px solid var(--gray-100, #f3f4f6); background: var(--gray-100, #f3f4f6); }
.recipe-photo img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.recipe-thumb-cell { width: 64px; padding-right: 0 !important; }
.recipe-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; display: block; }

/* Rezeptkarten ------------------------------------------------------ */
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1250px) { .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .recipe-grid { grid-template-columns: 1fr; } }
.recipe-card { display: flex; gap: .9rem; border: 1px solid var(--gray-100, #f3f4f6); border-radius: 12px; background: #fff;
    overflow: hidden; min-width: 0; }
.recipe-card-img { position: relative; flex: 0 0 150px; height: 150px; background: var(--gray-100, #f3f4f6); display: flex;
    align-items: center; justify-content: center; text-decoration: none; }
.recipe-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-card-empty { font-size: 2.2rem; color: var(--gray-300, #d1d5db); }
.recipe-card-badge { position: absolute; top: .5rem; left: .5rem; padding: .15rem .5rem; border-radius: 999px; font-size: .68rem;
    font-weight: 600; background: rgba(255,255,255,.92); color: var(--blue-main, #376AB1); }
.recipe-card-badge.green { color: var(--green, #3DAA6D); }
.recipe-card-body { flex: 1; min-width: 0; padding: .75rem .9rem .7rem 0; display: flex; flex-direction: column; gap: .3rem; }
.recipe-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.recipe-card-title { font-weight: 600; color: var(--gray-900, #111827); text-decoration: none; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-card-title:hover { color: var(--blue-main, #376AB1); }
.recipe-fav { border: 0; background: none; cursor: pointer; font-size: 1.05rem; line-height: 1; color: var(--gray-400, #9ca3af); padding: 0; }
.recipe-fav.on, .recipe-fav:hover { color: #e0245e; }
.recipe-card-tags { font-size: .74rem; color: var(--gray-500, #6b7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe-card-values { display: grid; gap: .1rem; font-size: .8rem; color: var(--gray-600, #4b5563); margin-top: .1rem; }
.recipe-card-values div { display: flex; align-items: center; }
.recipe-card-values strong { margin-left: auto; color: var(--gray-900, #111827); font-weight: 600; padding-left: .5rem; }
.recipe-card-meta { margin-top: auto; }
.recipe-card[data-href] { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.recipe-card[data-href]:hover { box-shadow: 0 6px 18px rgba(17, 24, 39, .10); transform: translateY(-2px); border-color: var(--gray-200, #e5e7eb); }
.recipe-card[data-href]:hover .recipe-card-title { color: var(--blue-main, #376AB1); }

/* Öffentliche Seiten: Kundenformular ---------------------------------- */
.public-body { margin: 0; min-height: 100vh; background: linear-gradient(135deg, #eaf3fb 0%, #f4faf6 55%, #fff7ee 100%); }
.public-wrap { max-width: 860px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.public-head { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0 1.25rem; }
.public-brand { display: flex; align-items: center; gap: .75rem; }
.public-brand img { height: 44px; width: auto; }
.public-logo { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px;
    background: var(--brand, #376AB1); color: #fff; font-weight: 700; }
.public-name { font-weight: 650; font-size: 1.05rem; }
.public-city { font-size: .8rem; color: var(--gray-500, #6b7280); }
.public-card { background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(17, 24, 39, .08); padding: 1.75rem 2rem 1.5rem; }
.public-foot { text-align: center; font-size: .8rem; color: var(--gray-500, #6b7280); margin-top: 1.5rem; }
.public-foot a { color: inherit; }
.qn-progress { height: 8px; border-radius: 999px; background: var(--gray-100, #f3f4f6); overflow: hidden; }
.qn-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand, #376AB1), #3DAA6D); transition: width .3s; }
.qn-step { font-size: .8rem; color: var(--gray-500, #6b7280); margin: .6rem 0 1rem; }
.qn-title { font-size: 1.45rem; margin: 0 0 .5rem; }
.qn-intro { color: var(--gray-600, #4b5563); margin: 0 0 1rem; }
.qn-q { margin-bottom: 1.25rem; }
.qn-label { display: block; font-weight: 500; margin-bottom: .45rem; }
.qn-q input[type="text"], .qn-q input[type="date"], .qn-q input[type="number"], .qn-q textarea {
    width: 100%; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 12px; padding: .75rem .9rem; font: inherit;
    background: var(--gray-50, #f9fafb); }
.qn-q input:focus, .qn-q textarea:focus { outline: none; border-color: var(--brand, #376AB1); background: #fff; box-shadow: 0 0 0 3px rgba(55, 106, 177, .15); }
.qn-q.has-error input, .qn-q.has-error textarea { border-color: #dc2626; }
.qn-unit { display: flex; align-items: center; gap: .6rem; }
.qn-unit input { max-width: 160px; }
.qn-row { display: flex; gap: .6rem; }
.qn-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.qn-option { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 999px; background: var(--gray-50, #f9fafb); cursor: pointer; font-weight: 400; }
.qn-option:has(input:checked) { border-color: var(--brand, #376AB1); background: rgba(55, 106, 177, .08); color: var(--brand, #376AB1); font-weight: 600; }
.qn-option input { margin: 0; }
.qn-check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .92rem; line-height: 1.45; margin-bottom: .6rem; }
.qn-check input { margin-top: .3rem; flex: 0 0 auto; }
.qn-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; gap: 1rem; }
.qn-actions .btn { border-radius: 999px; padding: .65rem 1.4rem; }
.btn-brand { background: var(--brand, #376AB1); border-color: var(--brand, #376AB1); }
.qn-done p { line-height: 1.6; }
@media (max-width: 600px) { .public-card { padding: 1.25rem 1.1rem; } .qn-row { flex-direction: column; } .qn-row input { max-width: none !important; } }

/* Nachrichten-Verlauf (Praxis und Kundenlink) */
.msg-thread { display: flex; flex-direction: column; gap: .75rem; margin: 1.25rem 0; }
.msg-bubble { max-width: 88%; padding: .8rem 1rem; border-radius: 14px; background: var(--gray-100, #f3f4f6); font-size: .95rem; line-height: 1.5; }
.msg-bubble.msg-out { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-bubble.msg-in { align-self: flex-end; background: rgba(55, 106, 177, .1); border-bottom-right-radius: 4px; }
.msg-meta { font-size: .78rem; color: var(--gray-500, #6b7280); margin-bottom: .3rem; }
.msg-subject { font-weight: 600; margin-bottom: .25rem; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.msg-attach { margin-top: .6rem; }
.msg-sealed { font-style: italic; color: var(--gray-500, #6b7280); }
.msg-reply textarea { width: 100%; }
.msg-flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; }
.msg-flash-success { background: rgba(61, 170, 109, .12); color: #1f6b43; }
.msg-flash-error { background: rgba(220, 38, 38, .1); color: #991b1b; }
.qn-error { color: #dc2626; font-size: .85rem; margin-top: .3rem; }
@media (max-width: 600px) { .msg-bubble { max-width: 100%; } }

/* Nachrichten als Gespräche */
.chat-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chat-filters { display: flex; gap: .6rem; flex-wrap: wrap; }
.chat-filters select { width: auto; min-width: 180px; }
.chat-card { max-width: 1100px; margin: 0 auto; }
.chat-tabs { display: flex; gap: 1.5rem; padding: 0 1.25rem; border-bottom: 1px solid var(--gray-100); overflow-x: auto; }
.chat-tabs a { padding: 1rem 0 .8rem; color: var(--gray-500); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.chat-tabs a:hover { color: var(--gray-900); text-decoration: none; }
.chat-tabs a.active { color: var(--gray-900); border-bottom-color: var(--gray-900); }
.chat-count { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--gray-100); color: var(--gray-900); font-size: .75rem; text-align: center; }
.chat-list { padding: 1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.chat-conv { border: 1px solid var(--gray-100); border-radius: 12px; background: #fff; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; cursor: pointer; }
.chat-head:hover { background: var(--gray-50); }
.chat-avatar { width: 44px; height: 44px; font-size: .95rem; flex: 0 0 auto; }
.chat-headtext { flex: 1 1 auto; min-width: 0; }
.chat-client { font-size: .78rem; color: var(--gray-500); }
.chat-client a { color: inherit; }
.chat-title { font-size: 1.05rem; font-weight: 500; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.chat-headmeta { display: flex; align-items: center; gap: .35rem; flex: 0 0 auto; }
.chat-when { font-size: .78rem; color: var(--gray-500); margin-right: .5rem; white-space: nowrap; }
.chat-archive { margin: 0; }
.chat-chevron { transition: transform .2s; }
.chat-conv.is-open .chat-chevron { transform: rotate(180deg); }
.chat-body { display: none; background: #EEF5FB; padding: 1rem; }
.chat-conv.is-open .chat-body { display: block; }
.chat-stream { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; padding: .25rem .25rem .75rem; }
.chat-day { text-align: center; font-size: .75rem; color: var(--gray-500); margin: .25rem 0; }
.chat-row { display: flex; gap: .6rem; align-items: flex-start; max-width: 78%; }
.chat-row-out { align-self: flex-end; flex-direction: row-reverse; }
.chat-row-in { align-self: flex-start; }
.chat-avatar-sm { width: 30px; height: 30px; font-size: .7rem; flex: 0 0 auto; background: #fff; color: var(--gray-900); }
.chat-col { min-width: 0; }
.chat-bubble { padding: .7rem .95rem; border-radius: 12px; line-height: 1.5; font-size: .95rem; }
.chat-row-out .chat-bubble { background: var(--blue-main); color: #fff; border-bottom-right-radius: 4px; }
.chat-row-in .chat-bubble { background: #fff; color: var(--gray-900); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(17, 24, 39, .06); }
.chat-subject { font-weight: 650; margin-bottom: .3rem; }
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-attach { display: inline-block; margin-top: .5rem; padding: .35rem .7rem; border-radius: 8px; background: rgba(255, 255, 255, .18); color: inherit; font-size: .85rem; }
.chat-row-in .chat-attach { background: var(--gray-100); }
.chat-stamp { font-size: .72rem; color: var(--gray-500); margin-top: .25rem; }
.chat-row-out .chat-stamp { text-align: right; }
.chat-compose { display: flex; align-items: flex-end; gap: .5rem; background: #fff; border-radius: 12px; padding: .5rem .5rem .5rem .9rem; box-shadow: 0 6px 20px rgba(17, 24, 39, .08); margin-top: .5rem; }
.chat-compose textarea { flex: 1 1 auto; border: 0; resize: none; overflow-y: auto; min-height: 40px; max-height: 200px; padding: .6rem 0; font: inherit; background: transparent; }
.chat-compose textarea:focus { outline: none; box-shadow: none; }
.chat-compose.has-error { box-shadow: 0 0 0 2px #dc2626; }
.chat-notify { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--gray-500); white-space: nowrap; padding-bottom: .55rem; }
.chat-clip { color: var(--gray-500); padding: .6rem .3rem; display: block; }
.chat-clip:hover { color: var(--gray-900); text-decoration: none; }
.chat-send { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-size: 1.1rem; cursor: pointer; flex: 0 0 auto; }
.chat-send:hover { filter: brightness(.95); }
@media (max-width: 700px) {
    .chat-list { padding: .75rem; }
    .chat-when { display: none; }
    .chat-title { font-size: .95rem; }
    .chat-row { max-width: 95%; }
    .chat-avatar-sm { display: none; }
    .chat-filters select { min-width: 0; flex: 1 1 140px; }
}
.chat-icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.chat-headmeta .btn-ghost { color: var(--gray-500); padding: .35rem; }
.chat-headmeta .btn-ghost:hover { color: var(--gray-900); }

/* Abonnement */
.abo-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.abo-side .card { margin-bottom: 1rem; }
.abo-state { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.abo-state-title { font-size: 1.15rem; font-weight: 600; color: var(--blue-main); }
.abo-usage { display: flex; justify-content: space-between; gap: .5rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--gray-100); font-weight: 500; }
.abo-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.abo-head h2 { margin: 0; font-size: 1.15rem; font-weight: 500; }
.abo-toggle { display: inline-flex; background: var(--gray-100); border-radius: 999px; padding: 3px; }
.abo-toggle a { padding: .4rem .9rem; border-radius: 999px; color: var(--gray-700); font-size: .9rem; white-space: nowrap; }
.abo-toggle a:hover { text-decoration: none; }
.abo-toggle a.active { background: #fff; color: var(--blue-main); font-weight: 600; box-shadow: 0 1px 3px rgba(17, 24, 39, .1); }
.abo-save { font-size: .7rem; color: var(--green-dark); margin-left: .25rem; }
.abo-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.abo-plan { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; padding: 1.75rem 1.5rem 1.5rem; overflow: hidden; }
.abo-plan-pro { border-color: var(--blue-main); box-shadow: 0 12px 32px rgba(55, 106, 177, .12); }
.abo-plan.is-current { border-color: var(--green); }
.abo-plan::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(61, 170, 109, .18), transparent 70%); pointer-events: none; }
.abo-plan-pro::after { background: radial-gradient(circle, rgba(55, 106, 177, .22), transparent 70%); }
.abo-discount { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green-dark); background: var(--green-pale); border-radius: 999px; padding: .25rem .7rem; margin-bottom: .75rem; }
.abo-plan h3 { margin: 0 0 .75rem; font-size: 1.5rem; }
.abo-price { display: flex; align-items: baseline; gap: .4rem; }
.abo-amount { font-size: 2rem; font-weight: 650; }
.abo-per { color: var(--gray-500); }
.abo-sub { font-size: .85rem; color: var(--gray-500); margin: .25rem 0 1.25rem; }
.abo-sub s { color: #C0392B; margin-right: .35rem; }
.abo-features { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-direction: column; gap: .65rem; font-size: .93rem; }
.abo-features li { display: flex; gap: .6rem; align-items: center; }
.abo-ico { width: 26px; height: 26px; border-radius: 50%; background: var(--gray-50); border: 1px solid var(--gray-200); display: grid; place-items: center; font-size: .8rem; color: var(--gray-700); flex: 0 0 auto; }
.topbar-abo { font-size: .8rem; color: var(--gray-500); white-space: nowrap; }
.topbar-abo:hover { text-decoration: none; color: var(--blue-main); }
@media (max-width: 900px) { .abo-grid { grid-template-columns: 1fr; } }
.abo-cta { margin-top: auto; padding-top: 1.5rem; }

/* Benutzermenü oben rechts */
.usermenu { position: relative; }
.usermenu-btn { display: flex; align-items: center; gap: .6rem; border: 0; background: var(--gray-50); border-radius: 12px; padding: .35rem .7rem .35rem .4rem; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.usermenu-btn:hover, .usermenu.is-open .usermenu-btn { background: var(--gray-100); }
.usermenu-text { display: flex; flex-direction: column; line-height: 1.2; }
.usermenu-name { font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.usermenu-chev { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform .2s; }
.usermenu.is-open .usermenu-chev { transform: rotate(180deg); }
.usermenu-sub { font-size: .75rem; color: var(--gray-500); white-space: nowrap; }
.usermenu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 330px; background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; box-shadow: 0 16px 40px rgba(17, 24, 39, .14); padding: .5rem; z-index: 40; }
.usermenu-list a { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border-radius: 10px; color: var(--gray-900); font-size: .95rem; white-space: nowrap; }
.usermenu-list a:hover { background: var(--gray-50); text-decoration: none; color: var(--blue-main); }
.usermenu-list .chat-icon { color: var(--gray-700); }
.usermenu-sep { height: 1px; background: var(--gray-100); margin: .35rem .5rem; }
@media (max-width: 700px) { .usermenu-text { display: none; } .usermenu-btn { padding: .25rem; background: transparent; } .usermenu-list { min-width: 260px; } }
.advisor-photo { display: flex; align-items: flex-start; gap: .85rem; }
.advisor-photo-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; font-size: 1.3rem; }
.msg-row { display: flex; align-items: flex-start; gap: .6rem; max-width: 88%; }
.msg-row-out { align-self: flex-start; }
.msg-row-in { align-self: flex-end; }
.msg-row .msg-bubble { max-width: none; min-width: 0; }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; margin-top: .2rem; }
.msg-avatar-icon { display: grid; place-items: center; background: var(--gray-100, #EDF0F7); color: var(--gray-500, #6B7A94); }
.msg-avatar-icon svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) { .msg-row { max-width: 100%; } }
.msg-info { display: flex; gap: .75rem; align-items: flex-start; background: var(--green-pale, #E7F6ED); border: 1px solid rgba(61, 170, 109, .3); border-radius: 16px; padding: .9rem 1.1rem; margin: 0 0 1rem; font-size: .9rem; line-height: 1.5; color: #1f5b3a; }
.msg-info svg { width: 22px; height: 22px; flex: 0 0 auto; margin-top: .15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msg-info p { margin: 0; }

/* Messwert-Diagramme */
.mchart-grid-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; border-bottom: 1px solid var(--gray-100); }
.mchart-card { border: 1px solid var(--gray-100); border-radius: 10px; padding: .6rem .75rem .4rem; background: #fff; }
.mchart-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .25rem; }
.mchart { width: 100%; height: auto; display: block; }
.mchart-grid { stroke: var(--gray-100); stroke-width: 1; }
.mchart-label { font-size: 9px; fill: var(--gray-500); }
.mchart-line { fill: none; stroke: var(--blue-main); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mchart-dot { fill: #fff; stroke: var(--blue-main); stroke-width: 2; }
.mchart-down { color: var(--green-dark); }
.mchart-up { color: #C0392B; }

/* Planung */
.plan-table tbody th { font-weight: 600; white-space: nowrap; width: 220px; text-transform: none; font-size: .95rem; letter-spacing: 0; color: var(--gray-900); text-align: left; }
.plan-table td { vertical-align: middle; }
.plan-head th { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gray-700); }
.plan-head-gray th { background: var(--gray-50); }
.plan-head-blue th { background: #E8F1FB; }
.plan-head-rose th { background: #F9E6EE; }
.plan-head-green th { background: var(--green-pale); }
.plan-head-orange th { background: var(--orange-pale); }
.plan-title-blue { color: var(--blue-main); }
.plan-title-rose { color: #B0457A; }
.plan-title-green { color: var(--green-dark); }
.plan-title-orange { color: #B8651B; }
.plan-value { font-weight: 600; }
.plan-badge { margin-left: .35rem; vertical-align: middle; }
.plan-input { display: inline-flex; align-items: center; gap: .4rem; }
.plan-input input[type="text"] { width: 120px; }
.plan-input span { color: var(--gray-500); font-size: .85rem; white-space: nowrap; }
.plan-input-sm { margin-top: .4rem; }
.plan-input-sm input[type="text"] { width: 90px; }
.plan-input-sm label { margin: 0 .25rem 0 0; }
.plan-slider { display: flex; align-items: center; gap: .75rem; }
.plan-slider .plan-input-sm { margin-top: 0; }
.plan-slider .plan-input-sm input[type="text"] { width: 64px; }
.plan-slider input[type="range"] { width: 160px; accent-color: var(--blue-main); }
.plan-slider .slider-fett { accent-color: #E8B93A; }
.plan-slider .slider-kh { accent-color: #E8913A; }
.plan-slider .slider-protein { accent-color: var(--blue-main); }
.plan-details summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.plan-details summary::-webkit-details-marker { display: none; }
.plan-details summary h2::before { content: "\25B8"; display: inline-block; margin-right: .5rem; transition: transform .2s; color: var(--gray-500); }
.plan-details[open] summary h2::before { transform: rotate(90deg); }
@media (max-width: 700px) { .plan-table tbody th { width: auto; white-space: normal; } .plan-slider { flex-wrap: wrap; } }

/* Beschäftigter Knopf nach dem Absenden */
.btn.is-busy { opacity: .85; cursor: progress; display: inline-flex; align-items: center; gap: .5rem; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; flex: 0 0 auto; }
.btn-outline .spinner, .btn-ghost .spinner { border-color: rgba(55, 106, 177, .3); border-top-color: var(--blue-main); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ernährungsprotokoll per Link (Handy zuerst) */
.fp .qn-intro { font-size: .95rem; }
.fp-days { display: flex; gap: .4rem; overflow-x: auto; padding: .25rem 0 .6rem; margin: 0 -.25rem 0; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.fp-day { flex: 0 0 auto; min-width: 62px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem .55rem .4rem; border-radius: 12px; border: 1px solid var(--gray-200); background: #fff; color: var(--gray-700); text-decoration: none; }
.fp-day:hover { text-decoration: none; }
.fp-day-w { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.fp-day-d { font-weight: 600; font-size: .95rem; }
.fp-day-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.fp-day.filled .fp-day-dot { background: var(--green); }
.fp-day.active { background: var(--blue-main); border-color: var(--blue-main); color: #fff; }
.fp-day.active .fp-day-dot { background: rgba(255,255,255,.85); }
.fp-dayhead { font-size: 1.05rem; margin: .75rem 0 .5rem; }
.fp-meal { border: 1px solid var(--gray-100); border-radius: 14px; margin-bottom: .75rem; overflow: hidden; background: #fff; }
.fp-meal.has-entries { border-color: rgba(61, 170, 109, .45); }
.fp-meal-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .85rem; background: var(--gray-50); }
.fp-ico { font-size: 1.1rem; }
.fp-count { margin-left: auto; font-size: .75rem; background: var(--green-pale); color: var(--green-dark); border-radius: 999px; padding: .1rem .5rem; font-weight: 600; }
.fp-entry { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .85rem; border-top: 1px solid var(--gray-100); }
.fp-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.fp-entry-text { flex: 1; font-size: .93rem; white-space: pre-wrap; word-break: break-word; }
.fp-entry form { margin: 0; }
.fp-del { border: 0; background: transparent; color: var(--gray-500); font-size: 1.2rem; line-height: 1; padding: .1rem .35rem; cursor: pointer; }
.fp-form { padding: .6rem .85rem .75rem; border-top: 1px solid var(--gray-100); }
.fp-form textarea { width: 100%; font-size: 16px; min-height: 56px; }
.fp-actions { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
.fp-photo { display: flex; align-items: center; gap: .4rem; flex: 1; min-width: 0; cursor: pointer; }
.fp-photo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.fp-photo-btn { border: 1px solid var(--gray-200); border-radius: 999px; padding: .5rem .9rem; font-size: .9rem; background: #fff; white-space: nowrap; }
.fp-photo-name { font-size: .78rem; color: var(--green-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-save { border-radius: 999px; padding: .55rem 1.2rem; }
.fp-finish { margin-top: 1.25rem; text-align: center; }
.fp-finish .btn { border-radius: 999px; padding: .75rem 1rem; font-size: 1rem; }
@media (max-width: 600px) { .public-card.fp { padding: 1rem .85rem; } .fp-days { margin: 0 -.85rem; padding-left: .85rem; padding-right: .85rem; } }
.ce-meal { border: 1px solid var(--gray-100); border-radius: 10px; margin-bottom: .75rem; overflow: hidden; }
.ce-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .85rem; background: var(--gray-50); }
.ce-head form { margin: 0; }
.ce-entry { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem .85rem; border-top: 1px solid var(--gray-100); }
.ce-entry.is-imported { opacity: .65; }
.ce-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.ce-text { white-space: pre-wrap; word-break: break-word; font-size: .93rem; }
.fp-finish .btn.is-busy, .fp-save.is-busy { justify-content: center; }

/* Protokoll: Mahlzeiten einklappbar */
.meal-fold { border: 1px solid var(--gray-100); border-radius: 10px; margin: .5rem 0; }
.meal-fold summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem .85rem; background: var(--gray-50); border-radius: 10px; }
.meal-fold[open] summary { border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--gray-100); }
.meal-fold summary::-webkit-details-marker { display: none; }
.meal-fold-name { font-weight: 600; }
.meal-fold-name::before { content: "\25B8"; display: inline-block; margin-right: .5rem; color: var(--gray-500); transition: transform .15s; }
.meal-fold[open] .meal-fold-name::before { transform: rotate(90deg); }
.meal-fold-meta { font-size: .85rem; color: var(--gray-500); white-space: nowrap; }
.meal-fold .table-wrap { padding: 0 .35rem .35rem; }

/* Einführungstour */
.tour-bar { background: #EAF2FB; border: 1px solid #C6DEF3; border-left: 4px solid var(--blue-main); border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: 1.25rem; }
.tour-eyebrow { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--blue-main); font-weight: 600; }
.tour-title { margin: .2rem 0 .3rem; font-size: 1.1rem; }
.tour-text { margin: 0 0 .6rem; line-height: 1.5; max-width: 900px; }
.tour-progress { height: 4px; background: var(--blue-light); border-radius: 2px; overflow: hidden; margin-bottom: .7rem; }
.tour-progress span { display: block; height: 100%; background: var(--blue-main); }
.tour-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.tour-actions form { margin: 0; }
.tour-chip { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; display: flex; align-items: center; gap: .4rem; background: var(--gray-900); color: #fff; border-radius: 999px; padding: .5rem .5rem .5rem .95rem; font-size: .85rem; box-shadow: 0 8px 24px rgba(17, 24, 39, .25); }
.tour-chip a { color: #fff; font-weight: 500; }
.tour-chip a:hover { text-decoration: none; color: #DDEDF8; }
.tour-chip form { margin: 0; }
.tour-chip button { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; }
.tour-intro { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem; border-radius: 12px; background: #EAF2FB; border: 1px solid #C6DEF3; }
.usermenu-form { margin: 0; }
.usermenu-form button { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .65rem .8rem; border: 0; background: transparent; border-radius: 10px; color: var(--gray-900); font: inherit; font-size: .95rem; text-align: left; cursor: pointer; white-space: nowrap; }
.usermenu-form button:hover { background: var(--gray-50); color: var(--blue-main); }
@media (max-width: 780px) { .tour-bar { padding: .75rem .85rem; } .tour-chip { right: .75rem; bottom: .75rem; padding: .45rem .4rem .45rem .8rem; font-size: .8rem; } }

/* Hilfe-Assistent (Schublade rechts) */
.help-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--gray-200); background: #fff; color: var(--blue-main); font-weight: 700; font-size: 1rem; cursor: pointer; }
.help-btn:hover { background: var(--blue-light); }
.help-drawer { position: fixed; inset: 0; z-index: 60; }
.help-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .35); opacity: 0; transition: opacity .25s; }
.help-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #fff; box-shadow: -12px 0 40px rgba(17, 24, 39, .18); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; }
.help-drawer.is-open .help-backdrop { opacity: 1; }
.help-drawer.is-open .help-panel { transform: translateX(0); }
.help-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--gray-100); }
.help-head h3 { margin: 0; }
.help-messages { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; background: #F7F9FC; }
.help-msg { max-width: 92%; padding: .65rem .9rem; border-radius: 14px; font-size: .93rem; line-height: 1.5; }
.help-msg p { margin: 0 0 .4rem; }
.help-msg p:last-child { margin-bottom: 0; }
.help-msg ul { margin: .2rem 0 .4rem; padding-left: 1.1rem; }
.help-msg code { background: rgba(0, 0, 0, .06); padding: 0 .3em; border-radius: 4px; font-size: .88em; }
.help-msg-bot { align-self: flex-start; background: #fff; border: 1px solid var(--gray-100); border-bottom-left-radius: 4px; }
.help-msg-user { align-self: flex-end; background: var(--blue-main); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.help-msg-wait { color: var(--gray-500); animation: helpblink 1s infinite; }
@keyframes helpblink { 50% { opacity: .4; } }
.help-suggest { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.help-suggest button { border: 1px solid var(--gray-200); background: #fff; border-radius: 999px; padding: .3rem .7rem; font-size: .8rem; cursor: pointer; color: var(--blue-main); }
.help-suggest button:hover { background: var(--blue-light); }
.help-form { display: flex; align-items: flex-end; gap: .5rem; padding: .75rem 1.1rem; border-top: 1px solid var(--gray-100); }
.help-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; font-size: 16px; }
.help-foot { padding: 0 1.1rem .75rem; }

/* Betreiberbereich (Super-Admin) */
.sa-body { background: var(--gray-50); }
.sa-top { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.5rem; background: var(--gray-900); color: #fff; flex-wrap: wrap; }
.sa-brand { font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.sa-brand .muted { color: rgba(255, 255, 255, .6); }
.sa-badge { background: #E8913A; color: #fff; font-size: .7rem; padding: .15rem .5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.sa-nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.sa-nav a { color: rgba(255, 255, 255, .8); padding: .4rem .7rem; border-radius: 8px; }
.sa-nav a:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .1); }
.sa-nav a.active { background: rgba(255, 255, 255, .18); color: #fff; }
.sa-user { display: flex; align-items: center; gap: .6rem; }
.sa-user .muted { color: rgba(255, 255, 255, .6); }
.sa-user .btn-ghost { color: #fff; }
.sa-main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }
.sa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.sa-kpi { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 1rem; }
.sa-kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--blue-main); }
.sa-kpi-label { font-weight: 500; }
.sa-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-bottom: .5rem; }
.sa-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.sa-bar span { display: block; width: 100%; background: var(--blue-main); border-radius: 3px 3px 0 0; min-height: 2px; }
.sa-log { font-size: .78rem; white-space: pre-wrap; word-break: break-word; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 8px; padding: .5rem .7rem; margin: 0 0 .5rem; }
.sa-log.is-error { border-color: #F2C9C2; background: #FDF3F1; }
