/* BrassGazz – Farben aus dem Logo (Orange → Pink → Pfirsich/Gelb, Violett, Anthrazit).
   Unter Einstellungen änderbar. --gold ist die Hauptfarbe (Pink). */
:root {
  --gold: #FF6FA8;
  --gold-dark: #B8346F;
  --gold-soft: color-mix(in srgb, var(--gold) 14%, white);
  --violet: #B455E8;
  --orange: #F9A24B;
  --yellow: #FFD36E;
  --grad: linear-gradient(90deg, var(--orange), var(--gold) 50%, var(--yellow));
  --ink: #252627;
  --bg: #FBF6F3;
  --surface: #FFFFFF;
  --line: #EEE3DF;
  --text: #252627;
  --muted: #6E6668;
  --ok: #2E7D4F;
  --ok-soft: #E3F2E8;
  --warn: #B26A00;
  --warn-soft: #FFF1D9;
  --err: #B3261E;
  --err-soft: #FBE4E2;
  --info: #2F5C8A;
  --info-soft: #E3EDF7;
  --radius: 12px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  /* Abgeleitete Farben – werden von js/palette.js aus den Design-Einstellungen berechnet (hell/dunkel, Kontrast). */
  --on-gold: #1B1A1C;
  --btn-grad: linear-gradient(100deg, var(--orange), var(--gold) 60%);
  --side-text: #EEE8EA;
  --side-muted: #B9AFB3;
  --side-accent: var(--gold);
  --side-group: #C98BEF;
  --side-hover: rgba(255,255,255,.06);
  --side-line: rgba(255,255,255,.1);
  --brand-grad: var(--grad);
  --surface-2: #FCF8F7;
  --surface-3: #FDF4F7;
  --chip-bg: #EFE8E7;
  --input-bg: #FFFFFF;
  --text-2: #3F3B3D;
  --on-err: #FFFFFF;
  --on-ok: #FFFFFF;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --zoom: 1;
  --dichte: 1;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); }
a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
h4 { font-size: 14px; margin: 10px 0 6px; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { margin-left: auto; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 22px; }
.gold-text { color: var(--gold-dark); }
.ok-text { color: var(--ok); }
.danger-text { color: var(--err) !important; }
.ico { flex: none; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px; overflow-y: auto; }
.brand { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; padding: 6px 6px 18px; margin-bottom: 14px; position: relative; }
.brand::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 0; height: 3px; border-radius: 3px; background: var(--grad); }
.brand .logo { filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--gold) 45%, transparent)); }
.brand strong { display: block; font-size: 19px; letter-spacing: .03em; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand span { font-size: 12px; color: var(--side-muted); }
.logo { display: block; flex: none; object-fit: contain; }
.side .quick { margin: 0 4px 14px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-group); margin: 14px 10px 4px; }
.side nav a { display: flex; gap: 10px; align-items: center; padding: calc(9px * var(--dichte)) 10px; border-radius: var(--radius-s); color: var(--side-text); }
.side nav a:hover { background: var(--side-hover); text-decoration: none; }
.side nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 30%, transparent), color-mix(in srgb, var(--violet) 12%, transparent)); color: var(--side-text); font-weight: 600; box-shadow: inset 3px 0 0 var(--side-accent); }
.side-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--side-line); padding-top: 12px; margin-top: 12px; }
.who { display: flex; gap: 10px; align-items: center; }
.who strong { display: block; font-size: 14px; color: var(--side-text); }
.who span { font-size: 12px; color: var(--side-muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-gold); font-weight: 800; }
.main { padding: 28px 34px 60px; max-width: 1400px; width: 100%; min-width: 0; }
.topbar, .scrim { display: none; }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; max-width: 760px; }
.page-actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: calc(9px * var(--dichte)) 15px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--btn-grad); border-color: transparent; color: var(--on-gold); font-weight: 600; }
.btn.primary:hover { filter: brightness(.94); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn.danger { background: var(--err); border-color: var(--err); color: var(--on-err); }
.btn.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, var(--surface)); color: var(--ok); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn.light:hover { background: var(--side-hover); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Karten, Kacheln ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: calc(20px * var(--dichte)); box-shadow: var(--shadow); margin-bottom: calc(18px * var(--dichte)); }
.card-inner { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px; background: var(--surface-2); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
a.tile:hover { border-color: var(--gold); text-decoration: none; }
.tile span { font-size: 13px; color: var(--muted); }
.tile strong { font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile strong.warn { color: var(--warn); }
.tile small { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.loading.full { min-height: 100vh; display: grid; place-items: center; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Badges, Chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--chip-bg); color: var(--text-2); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: var(--gold-dark); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--err-soft); color: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.chip.on { background: var(--ink); color: var(--side-accent); border-color: var(--ink); }
.chip.static { cursor: default; padding: 1px 8px; font-size: 12.5px; margin: 1px 3px 1px 0; display: inline-block; background: var(--chip-bg); border-color: transparent; }

/* ---------- Alerts, Toasts ---------- */
.alert { border-radius: var(--radius-s); padding: 11px 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 18px; }
.alert.info { background: var(--info-soft); color: color-mix(in srgb, var(--info) 75%, var(--text)); }
.alert.warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 70%, var(--text)); border-color: color-mix(in srgb, var(--warn) 30%, var(--surface)); }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: var(--side-text); padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 420px; border-left: 4px solid var(--gold); }
.toast.err { border-left-color: var(--err); }

/* ---------- Formulare ---------- */
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: var(--radius-s); padding: calc(8px * var(--dichte)) 10px; background: var(--input-bg); min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold-dark); padding: 0; }
input[type=color] { padding: 2px; width: 44px; height: 38px; }
input.tiny { width: 70px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 14px 0; }
fieldset.box legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.field.wide { grid-column: 1 / -1; }
.field.check-field { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; margin: 6px 0; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.pair { display: flex; gap: 6px; }
.pair input { flex: 1; }
.money { display: flex; align-items: center; gap: 6px; }
.money input { flex: 1; text-align: right; font-variant-numeric: tabular-nums; }
.money-in { width: 110px; text-align: right; }
.money-in.warn { border-color: var(--warn); background: var(--warn-soft); }
.seg { display: inline-flex; background: var(--chip-bg); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; font: inherit; font-size: 14px; cursor: pointer; color: var(--text-2); }
.seg.small button { padding: 5px 10px; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button.on.ok { background: var(--ok); color: var(--on-ok); }
.seg button.on.warn { background: var(--warn); color: var(--surface); }
.seg button.on.info { background: var(--info); color: var(--surface); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.calc-box { background: var(--gold-soft); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.kat-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.kat-row input:first-child { flex: 1; min-width: 180px; }

/* ---------- Tabellen ---------- */
.table-card { padding: 0; overflow: hidden; }
.scroll-x { overflow-x: auto; }
.table-card.scroll-x { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.table th, .table td { padding: calc(9px * var(--dichte)) 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }
.table td.details { max-width: 340px; color: var(--text-2); }
.table td.actions { text-align: right; }
.table tr.inactive { opacity: .6; }
.table tr.abgelehnt { opacity: .6; }
.table tr.founder { background: var(--gold-soft); }
.table tr.paid td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.table.compact th, .table.compact td { padding: 6px 10px; }
.table td input:not([type=checkbox]) { padding: 5px 8px; width: 100%; min-width: 90px; }
.matrix td small { white-space: nowrap; }
.matrix .qhead { text-align: center; border-left: 1px solid var(--line); }
.matrix td.sum, .matrix th.sum { background: var(--surface-3); font-weight: 700; }
.doubt { margin-top: 4px; color: var(--warn); font-size: 13px; display: flex; gap: 4px; align-items: flex-start; }
.pad { padding: 10px 14px; }
.pager { display: flex; gap: 8px; justify-content: center; }

/* ---------- Listen ---------- */
.list-card { padding: 16px 0 4px; }
.list-card h2 { padding: 0 20px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row-link { display: flex; gap: 12px; align-items: center; padding: calc(10px * var(--dichte)) 20px; color: var(--text); border-top: 1px solid var(--line); }
.row-link:hover { background: var(--surface-3); text-decoration: none; }
.date-box { width: 42px; text-align: center; line-height: 1.1; }
.date-box b { display: block; font-size: 18px; }
.date-box small { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { border-bottom: 1px solid var(--line); }
.plain-list li > a { flex: 1; }
.plain-list li > a, .plain-list li > span, .plain-list li { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: var(--text); }
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.todo a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--radius-s); background: var(--surface-2); color: var(--text); }
.todo li.warn a { background: var(--warn-soft); }
.todo a:hover { text-decoration: none; filter: brightness(.98); }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 60px; gap: 10px; align-items: center; color: var(--text); }
.bar-row:hover { text-decoration: none; }
.bar-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; height: 14px; background: var(--chip-bg); border-radius: 4px; overflow: hidden; }
.bar.ap { background: var(--balken, var(--ink)); }
.bar.sp { background: var(--grad); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.legend i.ap { background: var(--balken, var(--ink)); } .legend i.sp { background: var(--gold); }

/* ---------- Termin-Editor ---------- */
.type-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.type-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; text-align: left; box-shadow: var(--shadow); }
.type-card:hover { border-color: var(--gold); }
.type-card strong { font-size: 17px; }
.type-card small { color: var(--muted); }
.type-card.gold .ico { color: var(--gold-dark); } .type-card.blue .ico { color: var(--info); } .type-card.green .ico { color: var(--ok); }
.editor { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.sticky { position: sticky; top: 20px; }
.att-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.att-head h2 { margin: 0; }
.att-list { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.att-list li { border-bottom: 1px solid var(--line); padding: 8px 12px; }
.att-list li:last-child { border-bottom: 0; }
.att-list li.on.voll { background: color-mix(in srgb, var(--ok-soft) 50%, var(--surface)); }
.att-list li.on.spaet { background: color-mix(in srgb, var(--warn-soft) 50%, var(--surface)); }
.att-list li.on.unverschuldet { background: color-mix(in srgb, var(--info-soft) 50%, var(--surface)); }
.att-main { display: grid; grid-template-columns: 150px 1fr auto 70px; gap: 12px; align-items: center; }
.att-name strong { display: block; }
.att-name small { font-size: 12px; }
.att-pts { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.att-extra { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0 2px 162px; }
.preview { list-style: none; margin: 0 0 10px; padding: 0; max-height: 50vh; overflow-y: auto; }
.preview li { display: grid; grid-template-columns: 1fr auto; padding: 5px 0; border-bottom: 1px solid var(--line); }
.preview li small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.sum-line { display: flex; justify-content: space-between; font-size: 16px; padding: 6px 0 2px; }

/* ---------- Genehmigung ---------- */
.month { padding: 14px 20px; }
.month-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.month-head h2 { margin: 0; }
.month.genehmigt { background: var(--surface-2); }
.wishes { list-style: none; padding: 0; margin: 10px 0 0; }
.wishes li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 10px 0; }
.wishes li p { margin: 4px 0; }
.wishes .answer { color: var(--muted); font-style: italic; }

/* ---------- Auszahlungen ---------- */
.payout-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.payout-card { color: var(--text); }
.payout-card:hover { border-color: var(--gold); text-decoration: none; }
.pc-head { display: flex; justify-content: space-between; align-items: center; }
.pc-head h2 { margin: 0; font-size: 22px; }
.payout-card dl, .calc-steps, .rule dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; }
.payout-card dt, .rule dt { color: var(--muted); font-size: 13px; }
.payout-card dd, .rule dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.steps { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.steps button { border: 0; background: transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.steps button.on { color: var(--text); border-bottom-color: var(--gold); }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.calc-steps dt { color: var(--text-2); }
.calc-steps dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.calc-steps .sub { font-size: 12.5px; color: var(--muted); }
.calc-steps .total { font-weight: 800; border-top: 1px solid var(--line); padding-top: 6px; }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 16px; }
.place-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.place-head h3 { margin: 0; }
.place-head .ico { color: var(--gold-dark); }
.vote-round { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 6px; }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 10px; }
.vote { display: flex; flex-direction: column; font-size: 13px; gap: 2px; }
.vote select { padding: 5px 6px; }
.tally { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tally span { background: var(--chip-bg); padding: 3px 9px; border-radius: 999px; font-size: 13px; }
.tally span.tie { background: var(--warn-soft); }
.tally .tie-note { background: transparent; color: var(--warn); font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 7px 0 7px 28px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li::before { position: absolute; left: 4px; font-weight: 800; }
.checklist li.ok::before { content: '✓'; color: var(--ok); }
.checklist li.no::before { content: '✕'; color: var(--err); }
.checklist li.info::before { content: '!'; color: var(--warn); }
.report { margin-top: 14px; background: var(--surface-2); border-radius: 10px; padding: 12px 16px; }
.rule.current { border-color: var(--gold); }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 26px; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20,18,14,.45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border-radius: calc(var(--radius) + 2px); width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(880px, 100%); }
.modal.small { width: min(440px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.dialog-text { margin-top: 0; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 20px; background:
  radial-gradient(circle at 15% 15%, color-mix(in srgb, var(--orange) 35%, transparent) 0, transparent 40%),
  radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--violet) 40%, transparent) 0, transparent 45%),
  radial-gradient(circle at 50% 95%, color-mix(in srgb, var(--gold) 35%, transparent) 0, transparent 50%), var(--ink); }
.login-logo { width: min(200px, 46vw); height: auto; filter: drop-shadow(0 12px 40px rgba(0,0,0,.45)); }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: calc(var(--radius) + 4px); padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-brand { text-align: center; margin-bottom: 6px; padding-bottom: 12px; position: relative; }
.login-brand::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 0; height: 3px; border-radius: 3px; background: var(--grad); }
.login-brand h1 { font-size: 24px; }
.login-brand p { margin: 0; color: var(--muted); }

.print-only { display: none; }
.print-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.print-brand strong { font-size: 18px; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid2, .calc-grid { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .menu-open .side { transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .topbar { display: flex; gap: 10px; align-items: center; position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--side-text); padding: 8px 12px; }
  .topbar strong { flex: 1; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .topbar { box-shadow: 0 3px 0 -1px var(--side-accent); }
  .topbar .icon-btn { color: var(--side-text); }
  .main { padding: 18px 16px 50px; }
  h1 { font-size: 22px; }
  .tiles, .tiles.three { grid-template-columns: 1fr 1fr; }
  .att-main { grid-template-columns: 1fr auto auto; }
  .att-main .seg { grid-column: 1 / -1; order: 3; }
  .att-extra { margin-left: 0; }
  .table th, .table td { padding: 8px; }
  .table-card { overflow-x: auto; }
}
@media print {
  .side, .topbar, .page-actions, .no-print, .steps, .alert, .modal-actions, .toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .print-only { display: block; }
  .main:has(.print-only) > *:not(.print-only) { display: none !important; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; color: #000; }
}
.editor > *, .grid2 > *, .calc-grid > * { min-width: 0; }
@media (max-width: 820px) {
  .form-grid { grid-template-columns: 1fr; }
  .seg { display: flex; }
  .seg button { flex: 1; }
  .page-head { flex-direction: column; }
}
.tile { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 820px) { .tile strong { font-size: 21px; } .tile { padding: 12px 14px; } }
.att-list .seg { flex-wrap: nowrap; }
.att-list .seg button { padding: 5px 9px; }
.att-main input.tiny { width: 56px; }
@media (min-width: 821px) { .att-main { grid-template-columns: 130px auto 1fr 64px; } .att-main .gespielt { justify-self: end; } }
