/* ==========================================================================
   Digipunkt UI – gemeinsames Designsystem für Kunden-App, Kasse, Dashboard, Admin
   Ruhige, präzise Flächen (Schweizer Fintech), eine Marke: das gelbe Märkli.
   ========================================================================== */
:root {
  /* Flächen */
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --surface-3: #e7eaf2;
  --line: #e3e6ee;
  --line-strong: #cfd4e0;
  /* Text */
  --fg: #0d1326;
  --fg-2: #39415a;
  --muted: #6b7389;
  /* Marke */
  --accent: #3343f0;
  --accent-hover: #2735d6;
  --accent-soft: #eceefe;
  --accent-ink: #ffffff;
  --ink: #0b1230;             /* dunkle Markenfläche (Konto-Karte, Admin-Leiste) */
  --ink-2: #1c2a74;
  --stamp: #ffc93a;           /* das Märkli */
  --stamp-soft: #fff6dc;
  --stamp-ink: #3b2b00;
  /* Status */
  --good: #0f9a5c; --good-soft: #e5f6ee;
  --warn: #b86e00; --warn-soft: #fff2dd;
  --bad: #d93a42;  --bad-soft: #fdebec;
  /* Schrift */
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  /* Form */
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(13, 19, 38, 0.05), 0 1px 1px rgba(13, 19, 38, 0.03);
  --shadow-2: 0 1px 2px rgba(13, 19, 38, 0.04), 0 8px 24px -10px rgba(13, 19, 38, 0.14);
  --shadow-3: 0 24px 60px -20px rgba(13, 19, 38, 0.35);
  --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  color-scheme: light;
}
/* Dunkles Design: per Schalter (data-theme, gesetzt von /lib/thema.js) oder – ohne JavaScript – nach Systemeinstellung */
:root[data-theme="dunkel"] {
    --bg: #090c15; --surface: #121726; --surface-2: #192036; --surface-3: #222a43;
    --line: #232a40; --line-strong: #2f3854;
    --fg: #eef1f9; --fg-2: #c3c9da; --muted: #8f98b1;
    --accent: #7d8cff; --accent-hover: #95a1ff; --accent-soft: #1c2250; --accent-ink: #0a0d18;
    --ink: #0f1631; --ink-2: #26357f;
    --stamp-soft: #2f2710;
    --good: #3fd08d; --good-soft: #0f2c20; --warn: #f2b14f; --warn-soft: #33250c; --bad: #ff7279; --bad-soft: #351417;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #090c15; --surface: #121726; --surface-2: #192036; --surface-3: #222a43;
    --line: #232a40; --line-strong: #2f3854;
    --fg: #eef1f9; --fg-2: #c3c9da; --muted: #8f98b1;
    --accent: #7d8cff; --accent-hover: #95a1ff; --accent-soft: #1c2250; --accent-ink: #0a0d18;
    --ink: #0f1631; --ink-2: #26357f;
    --stamp-soft: #2f2710;
    --good: #3fd08d; --good-soft: #0f2c20; --warn: #f2b14f; --warn-soft: #33250c; --bad: #ff7279; --bad-soft: #351417;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 500 15px/1.5 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; text-wrap: balance; color: var(--fg); }
h1 { font-size: 28px; }
h2 { font-size: 17px; letter-spacing: -0.015em; }
h3 { font-size: 15px; }
p { margin: 0; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.ico.klein { width: 16px; height: 16px; }
.ico.gross { width: 24px; height: 24px; }

.titel { font-size: 28px; }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hinweis, .leise { color: var(--muted); font-size: 14px; font-weight: 500; }
.reihe { display: flex; align-items: center; gap: 10px; min-width: 0; }
.zwischen { justify-content: space-between; flex-wrap: wrap; }
.zahl { font-variant-numeric: tabular-nums; }
.code, .ziffern, .code-gross { font-family: var(--mono); }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 0; border-radius: var(--r); padding: 14px 18px; min-height: 50px;
  font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(13, 19, 38, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.985); }
.btn.zweit { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-1); }
.btn.zweit:hover { background: var(--surface-2); }
.btn.marke { background: var(--stamp); color: var(--stamp-ink); }
.btn.marke:hover { background: color-mix(in srgb, var(--stamp) 88%, #000); }
.btn.gut { background: var(--good); color: #fff; }
.btn.gefahr { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.btn.klein { width: auto; min-height: 38px; padding: 8px 14px; font-size: 14px; border-radius: 11px; flex: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.link { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 6px 0; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

/* ---------- Felder ---------- */
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld > span { font-size: 13.5px; font-weight: 700; color: var(--fg-2); }
.feld input, .feld select, .feld textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 16px; font-weight: 500; transition: border-color 0.15s, box-shadow 0.15s;
}
.feld textarea { min-height: 90px; resize: vertical; }
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.feld input::placeholder, .feld textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.feld input.code { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: 0.3em; text-align: center; padding: 16px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.fehler { background: var(--bad-soft); color: var(--bad); padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 14.5px; }

/* ---------- Karten & Flächen ---------- */
.block, .karte-block, .mkarte {
  background: var(--surface); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
  box-shadow: var(--shadow-2); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.karte-block > p, .block > p { margin: 0; }
.leer { text-align: center; padding: 28px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.leer .ico { width: 36px; height: 36px; color: var(--line-strong); }

/* Chips / Status */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
  background: var(--surface-2); color: var(--fg-2); white-space: nowrap; line-height: 1.4;
}
.chip.gut { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.marke { background: var(--stamp); color: var(--stamp-ink); }
.chip.akzent { background: var(--accent-soft); color: var(--accent); }
.chip::before { content: none; }
.chip.gut::before, .chip.warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Avatar mit Initialen (Farbe aus dem Namen) */
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; letter-spacing: 0; color: hsl(var(--h, 230) 60% 32%); background: hsl(var(--h, 230) 85% 92%);
}
:root[data-theme="dunkel"] .avatar { color: hsl(var(--h, 230) 80% 80%); background: hsl(var(--h, 230) 40% 22%); }
.avatar.klein { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }

/* Umschalter */
.umschalter, .segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-3); border-radius: 13px; padding: 4px; gap: 4px; }
.umschalter button, .segment button { border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.umschalter button[aria-pressed="true"], .segment button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-1); }

.unternav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: var(--surface-3); padding: 4px; border-radius: 14px; width: fit-content; max-width: 100%; }
.unternav::-webkit-scrollbar { display: none; }
.unternav button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.unternav button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-1); }

/* Kennzahlen */
.kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kachel {
  background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  box-shadow: var(--shadow-2); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.kachel b { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.kachel .hinweis { font-size: 13px; }
.kachel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kachel-kopf .ico { color: var(--muted); width: 18px; height: 18px; }
@media (max-width: 480px) { .kachel b { font-size: 22px; } .kachel { padding: 14px; } }
.trend { font-weight: 700; font-size: 13px; }
.trend.hoch { color: var(--good); }
.trend.runter { color: var(--bad); }
.werte { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.werte > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; }
.werte b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Diagramm */
.diagramm svg { width: 100%; height: auto; display: block; }
.diagramm .gitter { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.diagramm .achse { fill: var(--muted); font-size: 11px; font-family: var(--font); font-weight: 600; font-variant-numeric: tabular-nums; }
.diagramm .balken { fill: var(--accent); opacity: 0.85; }
.diagramm .balken:hover { opacity: 1; }
.diagramm .balken.heute { fill: var(--stamp); opacity: 1; }

/* Tabellen */
.tabelle { overflow-x: auto; margin: 0 -4px; }
.tabelle table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tabelle th, .tabelle td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle th { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line-strong); }
.tabelle .zahl { text-align: right; }
.tabelle .hinweis { font-size: 12.5px; }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:hover td { background: var(--surface-2); }
.tabelle tr.leise td { color: var(--muted); }
.tabelle tfoot td { font-weight: 800; border-top: 2px solid var(--line-strong); border-bottom: 0; }
.tabelle .wer { display: flex; align-items: center; gap: 10px; }
.aktionen-zelle { text-align: right; }
.aktionen-zelle .btn { display: inline-flex; vertical-align: middle; }
.aktionen-zelle .btn + .btn { margin-left: 6px; }

/* Formulare */
.formular { display: flex; flex-direction: column; gap: 14px; }
.zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.vorschau-satz { background: var(--stamp-soft); border-radius: 12px; padding: 12px 14px; font-weight: 600; color: var(--fg); }

/* Toast & Fenster */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14.5px;
  max-width: calc(100% - 32px); box-shadow: var(--shadow-3); text-align: center; display: flex; align-items: center; gap: 8px;
}
.fenster { position: fixed; inset: 0; background: rgba(9, 12, 21, 0.55); backdrop-filter: blur(4px); display: grid; place-items: end center; z-index: 40; padding: 16px; }
@media (min-width: 600px) { .fenster { place-items: center; } }
.fenster > div {
  width: min(440px, 100%); background: var(--surface); border-radius: var(--r-xl); padding: 22px; display: flex; flex-direction: column; gap: 16px;
  max-height: 100%; overflow-y: auto; box-shadow: var(--shadow-3);
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; min-width: 0; }
.logo i {
  flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--stamp); color: var(--stamp-ink);
  display: grid; place-items: center; font-style: normal; font-size: 16px; font-weight: 800;
  -webkit-mask: radial-gradient(circle at 50% 0, transparent 2px, #000 2.4px) top / 6.4px 51% repeat-x,
                radial-gradient(circle at 50% 100%, transparent 2px, #000 2.4px) bottom / 6.4px 51% repeat-x;
          mask: radial-gradient(circle at 50% 0, transparent 2px, #000 2.4px) top / 6.4px 51% repeat-x,
                radial-gradient(circle at 50% 100%, transparent 2px, #000 2.4px) bottom / 6.4px 51% repeat-x;
}
.logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Scanner */
.scanner { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #05070d; aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; color: #fff; }
.scanner-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-rahmen { position: absolute; inset: 17%; border-radius: 24px; box-shadow: 0 0 0 999px rgba(5, 7, 13, 0.45); outline: 3px solid var(--stamp); outline-offset: -1px; }
.scanner .hinweis { color: #fff; padding: 20px; text-align: center; }

/* Login-Seiten */
.anmeldung { width: 100%; max-width: 420px; margin: 0 auto; padding-top: 8vh; display: flex; flex-direction: column; gap: 18px; }
.anmeldung .gross { font-size: 32px; line-height: 1.1; }
.anmeldung form { display: flex; flex-direction: column; gap: 12px; }

/* Lade-Platzhalter */
.laden { height: 120px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: schimmer 1.2s infinite linear; }
@keyframes schimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: no-preference) {
  .auftritt { animation: auftritt 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
  @keyframes auftritt { from { transform: scale(0.94) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
  .einblenden { animation: einblenden 0.25s ease-out; }
  @keyframes einblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { .laden { animation: none; } }

/* ==========================================================================
   App-Schale: dunkle Seitenleiste (Tablet/Laptop) bzw. Navigation unten (Handy)
   ========================================================================== */
.rahmen { display: flex; min-height: 100%; height: 100%; }

.leiste {
  width: 248px; flex: none; display: flex; flex-direction: column; gap: 22px; color: #fff;
  background: linear-gradient(180deg, var(--ink-2) -40%, var(--ink) 45%);
  padding: 22px 14px calc(18px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
}
.leiste-kopf { display: flex; flex-direction: column; gap: 18px; padding: 0 6px; }
.leiste .logo { color: #fff; }
.laden-karte { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); min-width: 0; }
.laden-karte > div { min-width: 0; }
.laden-karte b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.laden-karte small { display: block; font-size: 12px; opacity: 0.65; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; flex-direction: column; gap: 4px; }
.tabs button, .tabs a {
  text-decoration: none; border: 0; background: none; color: rgba(255, 255, 255, 0.72); display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px; font-weight: 700; font-size: 14.5px; text-align: left;
}
.tabs button:hover, .tabs a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.tabs button[aria-current="page"], .tabs a[aria-current="page"] { background: #fff; color: var(--ink); }
.tabs [aria-current="page"] .ico { color: var(--accent); }
:root[data-theme="dunkel"] .tabs button[aria-current="page"], :root[data-theme="dunkel"] .tabs a[aria-current="page"] { background: var(--stamp); color: var(--stamp-ink); } :root[data-theme="dunkel"] .tabs [aria-current="page"] .ico { color: var(--stamp-ink); }
.tabs .trenner { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 8px 6px; }
.abmelden { margin-top: auto; color: rgba(255, 255, 255, 0.7); padding: 10px 12px; }
.abmelden:hover { color: #fff; }

main {
  flex: 1; min-width: 0; overflow-y: auto; height: 100%;
  padding: 28px max(20px, env(safe-area-inset-right, 0px)) 32px max(20px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
main > * { flex-shrink: 0; }
main > .eng { width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
main.breit > .weit { width: 100%; max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* Handy: Navigation unten, Kopf oben */
@media (max-width: 820px) {
  .rahmen { flex-direction: column; }
  .leiste {
    order: 2; width: auto; flex-direction: row; align-items: center; gap: 0; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: var(--ink);
  }
  .leiste-kopf, .abmelden { display: none; }
  .tabs { flex-direction: row; flex: 1; gap: 2px; }
  .tabs button, .tabs a { flex: 1; flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 11.5px; justify-content: center; }
  .tabs .trenner { display: none; }
  main { order: 1; flex: 1; height: auto; padding-top: 16px; }
  .handy-kopf { display: flex !important; }
}
.handy-kopf { display: none; align-items: center; justify-content: space-between; gap: 10px; }
.handy-kopf .laden-karte { background: var(--surface); box-shadow: var(--shadow-2); color: var(--fg); flex: 1; }
.handy-kopf .rund { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-2); color: var(--fg); flex: none; }


/* ---------- Bereich «Geschäft» ---------- */
.g-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.g-kopf h1 { font-size: 28px; }
.g-inhalt { display: flex; flex-direction: column; gap: 18px; }
.g-inhalt > * { flex-shrink: 0; }
.aktion-karte .kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.aktion-karte .regel { display: flex; align-items: center; gap: 10px; color: var(--fg-2); font-weight: 600; }
.aktion-karte .regel .ico { color: var(--stamp-ink); background: var(--stamp-soft); padding: 6px; width: 32px; height: 32px; border-radius: 10px; }
:root[data-theme="dunkel"] .aktion-karte .regel .ico { color: var(--stamp); }
.knopfzeile { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-balken { height: 6px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.mini-balken b { display: block; height: 100%; background: var(--accent); border-radius: 9px; }

/* ---------- Dashboard: Kundschaft ---------- */
.kundschaft-raster { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 26px; margin-top: 4px; }
@media (max-width: 900px) { .kundschaft-raster { grid-template-columns: 1fr; } }
.mini-titel { font-size: 14px; margin-bottom: 12px; color: var(--fg-2); }
.monats-balken { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 170px; }
.monats-balken > div { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.saeule { flex: 1; width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.saeule span { display: block; width: 100%; transition: height 0.4s; }
.saeule .neu { background: var(--stamp); }
.saeule .wieder { background: var(--accent); }
.monats-balken b { font-size: 13px; font-variant-numeric: tabular-nums; }
.monats-balken small { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.legende { display: flex; gap: 16px; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--fg-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; }
.legende .neu { background: var(--stamp); } .legende .wieder { background: var(--accent); }
.heat { display: grid; gap: 3px; margin-bottom: 10px; }
.heat small { font-size: 10.5px; color: var(--muted); font-weight: 700; align-self: center; text-align: center; }
.heat span { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--accent) calc(var(--a, 0) * 100%), var(--surface-2)); min-height: 10px; }

/* ---------- Dashboard: Nachrichten ---------- */
.nachrichten-liste { display: flex; flex-direction: column; gap: 10px; }
.nachrichten-liste article { background: var(--surface-2); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.nachrichten-liste p { color: var(--fg-2); white-space: pre-line; }

/* ---------- Dashboard: Werbung & Karten ---------- */
.druck-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.druck-karte { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 12px; transition: transform 0.15s, box-shadow 0.15s; }
.druck-karte:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.druck-karte h2 { margin-bottom: 4px; }
.druck-vorschau { height: 170px; border-radius: 14px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: #0b1230; }
.druck-vorschau b { font-size: 22px; line-height: 1; letter-spacing: -0.04em; font-weight: 800; }
.druck-vorschau em { font-style: normal; color: #3343f0; }
.dv-marke { position: absolute; top: 14px; left: 18px; width: 18px; height: 18px; border-radius: 5px; background: var(--stamp); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--stamp-ink); }
.dv-box { position: absolute; left: 18px; right: 90px; bottom: 18px; height: 34px; border-radius: 8px; background: #0b1230; }
.dv-qr { position: absolute; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 6px; background: conic-gradient(from 90deg at 30% 30%, #0b1230 25%, transparent 0) 0 0 / 11px 11px, #eef0f6; }
.dv-qr.klein { position: static; width: 40px; height: 40px; margin-top: 10px; }
.kleber-v { align-items: center; text-align: center; background: radial-gradient(circle at 50% 30%, #fff8e1, #fff 70%); }
.kleber-v b { font-size: 17px; max-width: 180px; margin-top: 8px; }
.dv-siegel { width: 54px; height: 54px; border-radius: 50%; background: var(--stamp); color: var(--stamp-ink); display: grid; place-items: center; font-weight: 800; font-size: 22px; transform: rotate(-8deg); }
#karten select { padding: 8px 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; min-height: 38px; }

/* ---------- Karte (Leaflet) ---------- */
.karten-flaeche { height: 340px; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-2); z-index: 0; }
.karten-pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 4px 12px rgba(13, 19, 38, 0.35); border: 2.5px solid #fff; }
.karten-pin.besucht { background: var(--stamp); color: var(--stamp-ink); }
.karten-pin { line-height: 1; }
.leaflet-popup-content { font: 600 13.5px/1.4 var(--font); margin: 12px 14px; }
.leaflet-popup-content b { font-size: 15px; display: block; margin-bottom: 2px; }
.leaflet-popup-content .chip { margin-top: 6px; }
.leaflet-container { font-family: var(--font); }
.karten-flaeche.klein { height: 220px; box-shadow: inset 0 0 0 1px var(--line); }
.einlade-suche { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.treffer { display: flex; flex-direction: column; gap: 6px; }
.treffer:empty { display: none; }
.treffer-zeile { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 0; border-radius: 12px; background: var(--surface-2); text-align: left; font-weight: 700; color: var(--fg); }
.treffer-zeile span { flex: 1; }
.treffer-zeile:hover { background: var(--accent-soft); color: var(--accent); }
.karten-pin i { font-style: normal; transform: rotate(45deg); }

/* Dashboard: Statushinweise */
.status-hinweis { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); color: var(--fg-2); font-weight: 600; font-size: 14px; }
.status-hinweis .ico { color: var(--accent); flex: none; margin-top: 1px; }
.status-hinweis.test { background: var(--stamp-soft); } .status-hinweis.test .ico { color: var(--warn); }
.status-hinweis.warn { background: var(--warn-soft); } .status-hinweis.warn .ico { color: var(--warn); }
.status-hinweis b { color: var(--fg); }

/* Avatar mit Logo */
.avatar.mit-logo { background: #fff; padding: 2px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.avatar.mit-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }
/* Logo als kleines Icon in der Stecknadel – feste Grösse, sonst würde das Bild in Originalgrösse (512 px) angezeigt */
.karten-pin.mit-logo { background: #fff; padding: 0; overflow: hidden; border-color: var(--accent); }
.karten-pin.mit-logo.besucht { border-color: var(--stamp); }
.leaflet-container .karten-pin.mit-logo img { width: 24px !important; height: 24px !important; max-width: 24px !important; max-height: 24px !important; object-fit: contain; border-radius: 50%; transform: rotate(45deg); display: block; }

/* Dashboard: Logo */
.logo-reihe { display: flex; gap: 14px; flex-wrap: wrap; }
.logo-feld { display: flex; flex-direction: column; gap: 6px; }
.logo-feld img { width: 132px; height: 132px; object-fit: contain; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); padding: 8px; }
.logo-feld.wartet img { box-shadow: inset 0 0 0 2px var(--warn); }
.logo-leer { width: 132px; height: 132px; border-radius: 18px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 10px; }
.logo-leer small { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.3; }

/* ---------- Hell/Dunkel-Schalter ---------- */
.rund { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-2); color: var(--fg); text-decoration: none; cursor: pointer; }
.rund:hover { color: var(--accent); }
[data-thema-knopf] .ico { width: 20px; height: 20px; }
.thema-link { display: flex; align-items: center; gap: 10px; }
.nur-handy { display: none !important; }
@media (max-width: 820px) { .nur-handy { display: grid !important; } }
.thema-segment { display: grid; grid-template-columns: repeat(3, 1fr); }
/* Sanfter Übergang nur im Moment des Umschaltens */
html.thema-wechsel, html.thema-wechsel *, html.thema-wechsel *::before, html.thema-wechsel *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}
.thema-link + .abmelden { margin-top: 0; }

/* ---------- Prämien-Formular und Angebote ---------- */
.art-wahl { border: 0; margin: 0; }
.art-wahl label { cursor: pointer; display: block; }
.art-wahl input { position: absolute; opacity: 0; pointer-events: none; }
.art-wahl span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.art-wahl input:checked + span { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-1); }
.art-wahl input:focus-visible + span { box-shadow: var(--ring); }
.praemie-form .feld small { margin-top: 2px; }
.angebote { gap: 12px; }
.angebot { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--warn-soft); }
.angebot-zahlen { display: flex; gap: 16px; font-size: 14px; color: var(--fg-2); }
.logo-grund { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-grund input { flex: 1; min-width: 200px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; }
.angebot .wer, .karte-block .praemie-zelle .wer { display: flex; align-items: center; gap: 12px; }
