/* Cockpit ALPHA COSMOS – Mesuts Marke: Fraunces + Source Sans 3, Creme, Nachtblau, Gold, Pillen. */

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/fraunces-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/fraunces-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(fonts/fraunces-italic-latin.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/sourcesans3-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/sourcesans3-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --nacht: #130B33;
  --violett: #1E0C59;
  --gold: #FFB800;
  --creme: #F5EFE6;
  --papier: #FDFBF7;

  --bg: var(--creme);
  --surface: var(--papier);
  --surface-2: #F1EADD;
  --line: #E4DBCB;
  --text: #130B33;
  --text-2: #4A4566;
  --muted: #6E6888;
  --accent: #B07800;        /* Gold, dunkel genug für Text und Linien auf Creme */
  --accent-soft: #FFF1CC;
  --focus: #B07800;

  /* Diagramm-Reihen (geprüft: Helligkeit, Farbsehschwäche, Kontrast) */
  --s1: #B07800;  /* Geldeingang */
  --s2: #5B3FD0;  /* Kosten / Werbung */
  --s3: #1C8C6E;  /* Gewinn */

  /* Zustände, immer mit Text */
  --good: #1C7A5A; --good-bg: #E3F3EC;
  --warn: #8A5A00; --warn-bg: #FFF1CC;
  --bad:  #A3271F; --bad-bg:  #FBE6E3;

  --radius: 20px;
  --shadow: 0 1px 2px rgba(19, 11, 51, .05), 0 6px 24px rgba(19, 11, 51, .05);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0E0826;
  --surface: #1A1140;
  --surface-2: #231852;
  --line: #2F2463;
  --text: #F5EFE6;
  --text-2: #D4CDE6;
  --muted: #A69FC4;
  --accent: #FFB800;
  --accent-soft: #3A2C10;
  --focus: #FFB800;
  --s1: #B88400;
  --s2: #8F78F5;
  --s3: #22997A;
  --good: #6FD3AE; --good-bg: #123A2F;
  --warn: #FFCB52; --warn-bg: #3A2C10;
  --bad:  #FF8F85; --bad-bg:  #43171A;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; background: var(--bg); color: var(--text); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; font-variation-settings: 'opsz' 36; }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; font-family: var(--sans); font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .85em; color: var(--text-2); }
small { font-size: .6em; color: var(--muted); font-weight: 400; font-family: var(--sans); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: .5rem; left: .5rem; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: 999px; }

/* Knöpfe */
button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: .65rem 1.3rem; background: var(--violett); color: var(--papier); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
button:hover, .btn:hover { filter: brightness(1.15); }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.ghost:hover { background: var(--surface-2); filter: none; }
.small { padding: .4rem .95rem; font-size: .9rem; }

/* Rahmen */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { background: var(--nacht); color: var(--creme); padding: 1.6rem 1rem 1.2rem; display: flex; flex-direction: column; gap: 1.6rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 0 .7rem; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: .02em; color: var(--gold); }
.brand-sub { font-size: .9rem; color: #C9C2DF; }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.side nav a { display: grid; padding: .6rem .8rem; border-radius: 14px; text-decoration: none; color: var(--creme); }
.side nav a:hover { background: rgba(255, 255, 255, .06); }
.side nav a[aria-current="page"] { background: rgba(255, 184, 0, .14); box-shadow: inset 3px 0 0 var(--gold); }
.side nav a.soon { opacity: .6; }
.m-label { font-weight: 600; }
.m-sub { font-size: .82rem; color: #B5AED0; }
.side-foot { margin-top: auto; display: grid; gap: .6rem; padding: 0 .7rem; }
.side-foot .ghost { color: var(--creme); border-color: rgba(245, 239, 230, .3); justify-self: start; }
.side-foot .ghost:hover { background: rgba(255, 255, 255, .08); }
.who { font-size: .85rem; color: #B5AED0; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.2rem; padding: 2rem clamp(1rem, 3.5vw, 2.8rem) 1.2rem; flex-wrap: wrap; }
.top-text { display: grid; gap: .35rem; }
.eyebrow { font-size: .9rem; color: var(--accent); font-weight: 600; }
.lead { color: var(--text-2); font-size: 1.02rem; max-width: 60ch; }
.stand { color: var(--muted); font-size: .9rem; }
.top-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.top-actions form { margin: 0; }
.menu-btn { display: none; }

.toggle { background: var(--surface); color: var(--text); border: 1px solid var(--line); padding: .4rem .9rem .4rem .45rem; font-size: .9rem; }
.toggle .knob { width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle.on .knob { background: var(--accent); }
.toggle.on .knob::after { transform: translateX(14px); }
.toggle:hover { filter: none; background: var(--surface-2); }

.demo-banner { margin: 0 clamp(1rem, 3.5vw, 2.8rem) .4rem; background: var(--accent-soft); color: var(--text); border-radius: 16px; padding: .75rem 1.1rem; border: 1px dashed var(--accent); }

main { padding: .8rem clamp(1rem, 3.5vw, 2.8rem) 2rem; display: grid; gap: 1.4rem; }
.foot { padding: 1rem clamp(1rem, 3.5vw, 2.8rem) 2rem; color: var(--muted); font-size: .88rem; }

/* Zeitraum und Filter */
.toolbar { display: grid; gap: .6rem; }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pills a { text-decoration: none; padding: .45rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .95rem; color: var(--text-2); }
.pills a:hover { border-color: var(--accent); }
.pills a[aria-current="page"] { background: var(--violett); border-color: var(--violett); color: var(--papier); font-weight: 600; }
[data-theme="dark"] .pills a[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: var(--nacht); }
.pills.small a { padding: .3rem .8rem; font-size: .88rem; }
.period-range { color: var(--muted); font-size: .9rem; }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; }
.tile { background: var(--surface); border-radius: var(--radius); padding: 1.05rem 1.2rem 1.1rem; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: visible; display: grid; gap: .25rem; align-content: start; }
.tile::before { content: ""; position: absolute; left: 1.2rem; right: 1.2rem; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--s1); }
.tile.accent-violet::before { background: var(--s2); }
.tile.accent-green::before { background: var(--s3); }
.tile header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.tile h3 { color: var(--text-2); font-weight: 600; font-size: .95rem; }
.big { font-family: var(--serif); font-size: clamp(1.5rem, 2.2vw, 1.9rem); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; font-variation-settings: 'opsz' 48; }
.sub { color: var(--muted); font-size: .9rem; }

/* Erklärung „i“ */
.info { width: 24px; height: 24px; padding: 0; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-family: var(--serif); font-style: italic; font-weight: 600; font-size: .85rem; justify-content: center; flex: none; border: 1px solid var(--line); }
.info:hover { background: var(--accent-soft); filter: none; }
.popover { max-width: min(340px, 86vw); padding: .85rem 1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(19, 11, 51, .18); font-size: .95rem; line-height: 1.45; }
.popover::backdrop { background: transparent; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); display: grid; gap: 1rem; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }
.card-tools { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.muted-card { background: transparent; box-shadow: none; border-style: dashed; color: var(--text-2); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.4rem; }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 -.3rem; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.data { font-size: .93rem; }
.data th, .data td { padding: .55rem .55rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data thead th { font-size: .85rem; color: var(--muted); font-weight: 600; border-bottom-width: 2px; }
.data tbody th { font-weight: 600; }
.data tfoot th, .data tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line); }
.num { text-align: right !important; }
.neg { color: var(--bad); }
.empty { color: var(--muted); text-align: center !important; padding: 1.4rem !important; }
tr.expandable { cursor: pointer; }
tr.expandable:hover { background: var(--surface-2); }
.chev { display: inline-block; width: 1rem; color: var(--muted); transition: transform .15s; }
tr[aria-expanded="true"] .chev { transform: rotate(90deg); }
tr.detail td { background: var(--surface-2); white-space: normal; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, max-content) minmax(90px, max-content)); gap: .3rem 1rem; }
.detail-grid strong { text-align: right; font-weight: 600; }

.kv { width: 100%; }
.kv th { text-align: left; font-weight: 400; color: var(--text-2); padding: .5rem 0; border-bottom: 1px solid var(--line); }
.kv td { text-align: right; padding: .5rem 0 .5rem .8rem; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }

.delta { font-size: .88rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

.mini-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.mini-stats li { background: var(--surface-2); border-radius: 16px; padding: .8rem 1rem; display: grid; gap: .1rem; }
.mini-stats span:first-child { color: var(--text-2); font-size: .9rem; }
.mini-stats strong { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }

.todo { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; }
.todo li { background: var(--bad-bg); border-radius: 14px; padding: .65rem .9rem; position: relative; padding-left: 2.2rem; }
.todo li::before { content: "!"; position: absolute; left: .8rem; top: .62rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--bad); color: var(--surface); font-weight: 700; font-size: .75rem; display: grid; place-items: center; }
.ok-note { background: var(--good-bg); color: var(--good); border-radius: 14px; padding: .65rem .9rem; font-weight: 600; }

.tag { display: inline-block; padding: .12rem .6rem; border-radius: 999px; background: var(--surface-2); font-size: .82rem; color: var(--text-2); }
.tag.ok { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.flag { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--warn-bg); color: var(--warn); font-size: .75rem; font-weight: 700; }

.share { display: inline-block; width: 70px; height: 6px; border-radius: 999px; background: var(--surface-2); margin-right: .5rem; vertical-align: middle; overflow: hidden; }
.share span { display: block; height: 100%; background: var(--s1); border-radius: 999px; }

.search input { font: inherit; padding: .4rem .95rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 240px; }

/* „So wird gezählt“ */
.howto { border-top: 1px solid var(--line); padding-top: .6rem; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--accent); width: fit-content; }
.howto dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: .4rem 1rem; margin: .8rem 0 0; }
.howto dt { font-weight: 600; }
.howto dd { margin: 0; color: var(--text-2); }

/* Ampel */
.ampel { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.ampel.gruen { background: var(--good-bg); color: var(--good); }
.ampel.gelb { background: var(--warn-bg); color: var(--warn); }
.ampel.rot { background: var(--bad-bg); color: var(--bad); }

/* Diagramme */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.zero { stroke: var(--muted); stroke-opacity: .5; }
.chart .ax { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.chart .series polyline { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series circle { stroke: var(--surface); stroke-width: 2; }
.chart .s1 polyline { stroke: var(--s1); } .chart .s1 circle { fill: var(--s1); }
.chart .s2 polyline { stroke: var(--s2); } .chart .s2 circle { fill: var(--s2); }
.chart .s3 polyline { stroke: var(--s3); } .chart .s3 circle { fill: var(--s3); }
.chart .bar.s1 { fill: var(--s1); } .chart .bar.s2 { fill: var(--s2); } .chart .bar.s3 { fill: var(--s3); }
.chart .hit { fill: transparent; }
.chart .hit.on { fill: var(--text); fill-opacity: .04; }
.chart .cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .ref { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 6 4; }
.chart .ref-label { fill: var(--text-2); font-size: 12px; font-weight: 600; font-family: var(--sans); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .92rem; }
.legend label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.legend input { accent-color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.dot.s1 { background: var(--s1); } .dot.s2 { background: var(--s2); } .dot.s3 { background: var(--s3); }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .8rem; font-size: .9rem; box-shadow: 0 10px 30px rgba(19, 11, 51, .18); line-height: 1.5; }

/* Trichter */
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.funnel li { display: grid; grid-template-columns: minmax(150px, 210px) 1fr 70px; align-items: center; gap: .8rem; }
.f-label { color: var(--text-2); }
.f-bar { height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.f-bar span { display: block; height: 100%; background: var(--s2); border-radius: 999px; min-width: 4px; }
.funnel strong { text-align: right; font-variant-numeric: tabular-nums; }

/* Kanäle */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; counter-reset: r; }
.rank li { display: grid; grid-template-columns: 2rem minmax(120px, 1fr) auto minmax(120px, auto) minmax(140px, auto); align-items: center; gap: .8rem; padding: .5rem .2rem; border-bottom: 1px solid var(--line); counter-increment: r; }
.rank li::before { content: counter(r) "."; font-family: var(--serif); color: var(--muted); }
.rank li:last-child { border-bottom: 0; }
.r-name { font-weight: 600; }
.r-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.r-group { color: var(--muted); font-size: .9rem; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.channel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: grid; gap: .6rem; box-shadow: var(--shadow); }
.channel header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.channel h3 { font-family: var(--serif); font-size: 1.15rem; }
.spark { width: 100%; height: 56px; display: block; }
.spark polyline { fill: none; stroke: var(--s1); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark circle { fill: var(--s1); }
.ch-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .4rem .8rem; margin: 0; }
.ch-stats div { display: grid; }
.ch-stats dt { color: var(--muted); font-size: .85rem; }
.ch-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-hint { background: var(--bad-bg); color: var(--text); border-radius: 12px; padding: .55rem .8rem; font-size: .92rem; }
.ampel-gelb .ch-hint { background: var(--warn-bg); }
.ch-stand { color: var(--muted); font-size: .82rem; }

/* Login */
body.login { min-height: 100vh; display: grid; place-items: center; background: var(--nacht); }
.login-box { width: min(92vw, 400px); background: var(--papier); color: var(--nacht); border-radius: 24px; padding: 2.2rem; display: grid; gap: .5rem; }
.login-box .eyebrow { color: #8A5D00; }
.login-box h1 { color: var(--nacht); }
.login-box .lead { color: #4A4566; }
.login-box form { display: grid; gap: .9rem; margin-top: 1rem; }
.login-box label { display: grid; gap: .3rem; font-size: .95rem; }
.login-box input { font: inherit; padding: .7rem 1rem; border-radius: 999px; border: 1px solid #d8d2c6; background: #fff; color: var(--nacht); }
.login-box input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.error { background: #fdecec; color: #8a1c1c; border-radius: 12px; padding: .6rem .9rem; font-size: .95rem; }


/* Zweiter Schritt (2FA) */
.login-box { width: min(94vw, 460px); }
.login-box .btn { justify-content: center; margin-top: .4rem; }
.login-box .ok-note { background: #E3F3EC; color: #1C7A5A; }
.login-box code { color: var(--nacht); }
.login-box a { color: #5B3FD0; }
.step-note { font-size: .9rem; color: #6E6888; margin-top: .6rem; }
.step-help { font-size: .95rem; margin-top: .4rem; }
.step-help summary { cursor: pointer; font-weight: 600; color: #8A5D00; }
.step-help p { margin-top: .4rem; }
.check { display: flex !important; align-items: center; gap: .5rem; grid-template-columns: none; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: #B07800; padding: 0; }
.code-input { font-size: 1.3rem !important; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.setup-steps { margin: .6rem 0 0; padding-left: 1.2rem; display: grid; gap: .7rem; }
.qr-box { margin: .7rem 0 .3rem; padding: 10px; background: #fff; border-radius: 16px; border: 1px solid #E4DBCB; width: fit-content; }
.qr-box svg { display: block; width: 200px; height: 200px; }
.secret code { font-size: 1.05rem; letter-spacing: .08em; word-break: break-all; }
.codes { columns: 2; gap: 1.2rem; margin: .4rem 0 1rem; padding-left: 1.4rem; }
.codes li { margin: .25rem 0; }
.codes code { font-size: 1.05rem; color: inherit; }
.stack { display: grid; gap: .8rem; }
.stack label { display: grid; gap: .3rem; font-size: .95rem; }
.stack input:not([type=checkbox]) { font: inherit; padding: .6rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
main > .error, main > .ok-note { margin: 0; }

/* Handy */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; order: -1; }
  .top { padding-top: 1rem; }
  .rank li { grid-template-columns: 1.6rem 1fr auto; }
  .r-val { grid-column: 2; text-align: left; }
  .r-group { grid-column: 3; }
  .funnel li { grid-template-columns: 1fr 60px; }
  .f-bar { grid-column: 1 / -1; grid-row: 2; }
  .search input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .side, .top-actions, .menu-btn, .toolbar .pills { display: none; } .shell { display: block; } }

/* Rechnungen von Hand (zahlungen.php) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem 1rem; }
.stack select, .stack textarea { font: inherit; padding: .6rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.stack textarea { border-radius: 16px; resize: vertical; }
.invoice-form { margin: .9rem 0 .6rem; }
.delete-form { margin: .4rem 0 1rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
button.danger { background: #8a1c1c; }
.error ul { margin: .3rem 0 0; padding-left: 1.2rem; }
tr[aria-current="true"] td { background: var(--surface-2); }
.field-hint { font-size: .82rem; color: var(--text-2); }
.form-note { background: var(--warn-bg); color: var(--text); border-radius: 12px; padding: .55rem .8rem; font-size: .92rem; }
