/* SEPAeasy – schlichtes, ruhiges Layout ohne Build-Schritt */

:root {
  /* Farbwelt aus dem Logo: Koralle #E95951 + Tinte #1D1D1B, warme Neutraltöne */
  --brand: #e95951;
  --bg: #f7f5f4;
  --surface: #ffffff;
  --surface-2: #f3f0ee;
  --border: #e7e2df;
  --border-strong: #d6cfcb;
  --text: #1d1d1b;
  --muted: #6a625f;
  --accent: #c4413a;          /* Koralle, dunkel genug für weiße Schrift und Links (Kontrast ≥ 4,5) */
  --accent-hover: #a9352f;
  --accent-ink: #ffffff;
  --accent-soft: #fcebe9;
  --accent-soft-ink: #a9352f;
  --ok: #17784a;
  --ok-soft: #e3f4ea;
  --warn: #8f5b00;
  --warn-soft: #fdf2d8;
  --bad: #9f1d2b;
  --bad-soft: #fbe9ec;
  --info: #1d5ea8;
  --info-soft: #e6effb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(29, 29, 27, .05), 0 1px 3px rgba(29, 29, 27, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #f07a73;
    --bg: #141312;
    --surface: #1c1a19;
    --surface-2: #242120;
    --border: #34302e;
    --border-strong: #46413e;
    --text: #f2eeec;
    --muted: #a39b97;
    --accent: #f07a73;
    --accent-hover: #f2857f;
    --accent-ink: #2a0d0b;
    --accent-soft: #3a201e;
    --accent-soft-ink: #f59a94;
    --ok: #4cc38a;
    --ok-soft: #12301f;
    --warn: #e5b54a;
    --warn-soft: #33280f;
    --bad: #ff7b8f;
    --bad-soft: #3b1720;
    --info: #6aa7ef;
    --info-soft: #14263d;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 .2rem; letter-spacing: -.01em; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .05em .35em; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .01em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .84rem; margin: .25rem 0 0; }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.bad-text { color: var(--bad); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); font-weight: 600; }

/* ------------------------------------------------------------------ Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: .55rem 16px;
  display: flex; align-items: center; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand .logo { height: 34px; width: auto; display: block; }
.brand-label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding-left: .7rem; border-left: 1px solid var(--border-strong); line-height: 1.2; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); padding: .42rem .7rem; border-radius: 999px; font-weight: 600; font-size: .92rem; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-soft-ink); }
.nav .count { margin-left: .2rem; }
.logout { margin-left: auto; }

.container { max-width: 1120px; margin: 0 auto; padding: 1.5rem 16px; }
.footer { display: flex; gap: .5rem; color: var(--muted); font-size: .82rem; padding-top: 0; padding-bottom: 2rem; }
.footer a { color: var(--muted); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.crumbs { color: var(--muted); font-size: .85rem; margin: 0 0 .2rem; }
.crumbs a { color: var(--muted); }
.section { margin: 1.75rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* ------------------------------------------------------------------ Karten */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.small-link { font-size: .85rem; }
.callout { border-left: 4px solid var(--border-strong); }
.callout.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.callout.ok { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface)); }
.callout.bad { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 55%, var(--surface)); }
.callout.info { border-left-color: var(--info); background: color-mix(in srgb, var(--info-soft) 55%, var(--surface)); }
.callout ul { margin: .25rem 0 .9rem; padding-left: 1.2rem; }
.empty { text-align: center; padding: 2.25rem 1.25rem; }
.empty .btn { margin-top: .5rem; }

.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1rem; align-items: start; }
.grid-main > .card { margin-bottom: 0; }

/* ------------------------------------------------------------------ Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1rem; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow);
}
.kpi-label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
.kpi-sub { color: var(--muted); font-size: .85rem; }

/* ------------------------------------------------------------------ To-do */
.todo { list-style: none; margin: 0; padding: 0; }
.todo-item {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .75rem 0; border-top: 1px solid var(--border);
}
.todo-item:first-child { border-top: 0; padding-top: 0; }
.todo-item:last-child { padding-bottom: 0; }
.todo-item.urgent strong { color: var(--bad); }

/* ------------------------------------------------------------------ Vorschau */
.months { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.month { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .85rem; background: var(--surface-2); }
.month-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .4rem; }
.month-items { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.month-items li { display: grid; grid-template-columns: 3.2rem 1fr auto 10px; gap: .4rem; align-items: center; padding: .15rem 0; }
.month-items .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.month-items .date { color: var(--muted); }
.month-items .amount { text-align: right; }
.month-items .more { display: block; padding-top: .3rem; }
.empty-small { font-size: .9rem; margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.info { background: var(--info); }

.activity { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.activity li { padding: .25rem 0; display: flex; gap: .75rem; }

/* ------------------------------------------------------------------ Badges */
.badge {
  display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  line-height: 1.5; white-space: nowrap; vertical-align: middle; letter-spacing: .01em;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.muted { opacity: .8; }
h1 .badge { font-size: .8rem; }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .5rem .95rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; white-space: nowrap; line-height: 1.3; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 1px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.link { background: none; border: 0; padding: .2rem .3rem; color: var(--accent); font-weight: 600; }
.btn.link.danger { color: var(--bad); }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.small { padding: .3rem .65rem; font-size: .84rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.actions.wrap { flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }
.copy { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .95rem; padding: 0 .25rem; }
.copy:hover { color: var(--accent); }

/* ------------------------------------------------------------------ Formulare */
.form h2 { margin-top: .25rem; }
.form h2:not(:first-of-type) { margin-top: 1.4rem; }
.field { margin-bottom: .95rem; min-width: 0; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.field label.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.req { color: var(--bad); }
input, select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
.choice { display: grid; gap: .5rem; }
.field .choice label.check { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .85rem; margin: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 400; }
.field .choice label.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: .25rem; accent-color: var(--accent); flex: none; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input.mono, .field.mono-input input { font-family: var(--mono); }
textarea { resize: vertical; }
.grid-2, .grid-3 { display: grid; gap: 0 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field.narrow { max-width: 12rem; }
.form-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.form-actions.sticky { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
.form-inline { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { margin-bottom: 0; }
.form-inline .grow { flex: 1; min-width: 14rem; }
details.more, details.calc { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: .6rem .85rem; margin-bottom: 1rem; }
details.more > summary, details.calc > summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
details[open].more > summary, details[open].calc > summary { margin-bottom: .75rem; }
.calc-intro { margin: 0 0 .75rem; }
.calc-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .25rem; }
.calc-actions .hint { margin: 0; }
.upload { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.upload input[type="file"] { width: auto; flex: 1; min-width: 12rem; padding: .35rem; font-size: .85rem; }

/* ------------------------------------------------------------------ Hinweise */
.flashes { display: grid; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .65rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.flash.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash.error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.flash.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.flash.info { background: var(--info-soft); border-color: transparent; color: var(--info); }

/* ------------------------------------------------------------------ Tabellen */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 700; padding: .65rem .9rem; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--border-strong); border-bottom: 0; font-size: .88rem; color: var(--muted); background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.table .actions-col { text-align: right; width: 1%; white-space: nowrap; }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.table .mono { white-space: nowrap; }
.row-actions { display: flex; gap: .25rem; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }

/* ------------------------------------------------------------------ Navigation in Listen */
.toolbar { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar input[type="search"] { flex: 1; min-width: 14rem; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { border: 0; background: var(--surface); padding: .45rem .8rem; font: inherit; font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.on { background: var(--accent-soft); color: var(--accent-soft-ink); }
.tabs { display: flex; gap: .35rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: 2px; }
.tabs a {
  padding: .4rem .8rem; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface);
}
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.count { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .75rem; text-align: center; }
.tabs a.on .count { background: rgba(255, 255, 255, .25); color: inherit; }
.count.alert { background: var(--bad); color: #fff; }
.pager { display: flex; gap: .5rem; justify-content: center; }

/* ------------------------------------------------------------------ Mandat & Pläne */
.kv { display: grid; grid-template-columns: 10.5rem 1fr; gap: .45rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.compact { grid-template-columns: 9.5rem 1fr; gap: .3rem 1rem; font-size: .92rem; margin-bottom: .9rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); gap: 1rem; }
.plans .card { margin-bottom: 0; }
.plan.dimmed { opacity: .7; }
.plan-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .6rem; }
.plan-head p { margin: .1rem 0 0; font-size: .9rem; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: .4rem; }
.progress .bar { height: 100%; background: var(--brand); border-radius: 999px; }
.plan .hint { margin-bottom: .75rem; }
.danger-zone summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: .75rem; }

details.pop { position: relative; display: inline-block; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
.pop-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 17rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15); padding: .85rem; display: grid; gap: .6rem; text-align: left;
}
.pop-body label { display: grid; gap: .25rem; font-size: .85rem; font-weight: 600; white-space: normal; }

/* ------------------------------------------------------------------ Schritte */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.step {
  counter-increment: step; position: relative; padding: .8rem 0 .8rem 2.6rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.step:first-child { border-top: 0; padding-top: .2rem; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: .75rem; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; font-size: .9rem;
}
.step:first-child::before { top: .15rem; }
.step.muted-step::before { background: var(--surface-2); color: var(--muted); }
.step.done-step::before { content: "✓"; background: var(--ok); color: #fff; }
.step p { margin: .15rem 0 0; }

/* ------------------------------------------------------------------ Hilfe */
.help h2 { margin-top: .25rem; }
.help ol, .help ul { padding-left: 1.25rem; }
.help li { margin-bottom: .35rem; }
.help table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.help td, .help th { border-bottom: 1px solid var(--border); padding: .4rem .5rem; text-align: left; vertical-align: top; }

/* ------------------------------------------------------------------ Login */
.login-page .container { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(100%, 24rem); padding: 1.75rem; }
.login-head { text-align: center; margin-bottom: 1.4rem; }
.login-head .logo { width: 240px; max-width: 85%; height: auto; display: block; margin: .25rem auto .75rem; }
.login-head h1 { font-size: 1.05rem; margin: 0; justify-content: center; }
.login-head p { margin: .15rem 0 0; }

/* ------------------------------------------------------------------ Passkeys */
[data-passkey-login][hidden], [data-passkey-error][hidden], [data-passkey-unsupported][hidden] { display: none; }
.passkey-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.passkey-login .or { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0 .9rem; color: var(--muted); font-size: .85rem; }
.passkey-login .or::before, .passkey-login .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.passkey-register { margin-top: .75rem; }
.field-button { display: flex; align-items: flex-end; }
.field-button .btn { width: 100%; }

/* ------------------------------------------------------------------ E-Mail-Versand (Einstellungen) */
#email h3 { margin: 1.25rem 0 .5rem; }

/* ------------------------------------------------------------------ Online-Mandat (öffentlich) */
.public-page { background: var(--bg); }
.public-page input, .public-page select, .public-page textarea { font-size: 16px; } /* iOS zoomt sonst */
.public-header { display: flex; justify-content: center; padding: 1.4rem 16px .4rem; }
.public-header .logo { height: 54px; width: auto; display: block; }
.public-main { max-width: 640px; margin: 0 auto; padding: .75rem 16px 1.5rem; }
.public-main h1 { font-size: 1.45rem; }
.public-main h2 { margin-top: 1.4rem; }
.public-main .card h2:first-child, .public-main form h2:first-of-type { margin-top: .25rem; }
.lead { color: var(--muted); font-size: 1rem; }
.public-footer { max-width: 640px; margin: 0 auto 2.5rem; padding: 0 16px; color: var(--muted); font-size: .85rem;
  text-align: center; line-height: 1.6; }
.public-footer a { color: var(--muted); }
.flash ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.grid-pc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 1rem; }
.mandate-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .9rem 1rem; font-size: .93rem; margin-bottom: .9rem; }
.mandate-box .kv { margin-bottom: .75rem; }
.mandate-box p { margin-bottom: .55rem; }
.check.consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 600; margin: .25rem 0 .5rem; cursor: pointer; }
.check.consent input { width: 1.25rem; height: 1.25rem; margin-top: .1rem; flex: none; accent-color: var(--accent); }
.sigpad { position: relative; height: 210px; background: #fff; border: 2px dashed var(--border-strong);
  border-radius: var(--radius); margin-bottom: .9rem; touch-action: none; overflow: hidden; }
.sigpad::after { content: ""; position: absolute; left: 7%; right: 7%; bottom: 26%; border-bottom: 1px solid #d6cfcb;
  pointer-events: none; }
.sigpad canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sigpad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #8a817d; font-size: 1rem;
  pointer-events: none; z-index: 0; }
.sigpad-hint[hidden] { display: none; }
.pad-panel { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .7rem .85rem; margin-bottom: .75rem;
  background: var(--surface-2); }
.pad-status { margin: 0; font-weight: 600; color: var(--muted); }
.pad-status.ok { color: var(--ok); }
.pad-status.bad { color: var(--bad); }
.pad-status.info { color: var(--info); }
.sigpad.readonly canvas { cursor: default; }
.sigpad-clear { position: absolute; top: .4rem; right: .4rem; z-index: 2; background: rgba(255, 255, 255, .9) !important; color: #6a625f !important; }
.sigpad-missing { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.btn.big { padding: .85rem 1rem; font-size: 1.02rem; }
table.mini { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .5rem 0; }
table.mini td { padding: .3rem .25rem; border-bottom: 1px solid var(--border); }
table.mini .num { text-align: right; }
.message { text-align: center; padding: 2rem 1.25rem; }
.message h1 { justify-content: center; }
.message-icon { width: 3.2rem; height: 3.2rem; margin: 0 auto .9rem; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.5rem; background: var(--surface-2); color: var(--muted); }
.message-icon.ok { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------------------------ Anfragen (Praxis) */
.qr-box { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
.qr-box svg { width: 220px; height: 220px; background: #fff; border-radius: var(--radius-sm); padding: 6px; display: block; }
.linkline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.linkline input { flex: 1; min-width: 14rem; font-family: var(--mono); font-size: .85rem; }
.signature-preview { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); max-width: 360px; width: 100%; display: block; }
.waiting { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.waiting::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: var(--brand);
  animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ------------------------------------------------------------------ Mobil */
@media (max-width: 860px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid-main > .card { margin-bottom: 0; }
  .months { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .container { padding: 1rem 12px; }
  .topbar-inner { flex-wrap: wrap; gap: .4rem; padding: .5rem 12px .35rem; }
  .brand .logo { height: 30px; }
  .brand-label { display: none; }
  .nav { order: 3; flex-basis: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .qr-box { grid-template-columns: 1fr; justify-items: center; }
  .hide-sm { display: none; }
  .kv, .kv.compact { grid-template-columns: 1fr; gap: 0 .5rem; }
  .kv dt { margin-top: .5rem; }
  .table td, .table th { padding: .6rem .65rem; }
  .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .table .actions-col { white-space: normal; }
  .todo-item { flex-direction: column; align-items: flex-start; }
  .page-head .actions { width: 100%; }
}
