/* Firmen-Dashboard (lib/dashboard-page.js). Baut auf style.css auf: Farben,
   Schriften, Dunkelmodus und die Diagramm- und Tabellenklassen (.rb-*) kommen
   von dort. Hier nur Rahmen, Raster und Karten.

   Aufbau nach der Vorlage vom 24.11.2026 (Seitenleiste, Kachelraster, weiche
   Karten), aber in den Markenfarben: Seitenleiste Anthrazit, Kopfkarte im
   Anthrazit mit gruenem Schein #92ca3e statt Lila. */

.db-body {
  /* Grund wie die Website (#f4f4f5), Karten bleiben weiss: Auf den grauen
     Stufen waeren Diagramme und Tabellen nicht lesbar. */
  --bg-raised: #ffffff;
  --line: #dcdce0;
  --db-page: var(--bg);
  --db-card: var(--bg-raised);
  --db-radius: var(--r-2);
  --db-shadow: 0 1px 2px rgba(39, 39, 43, 0.04), 0 8px 24px -12px rgba(39, 39, 43, 0.18);
  --rad-a: #4e4e56;
  --rad-b: #92ca3e;
  /* Firmenfarben: Vorgabe WoeTag, mit Abo ueberschrieben (lib/firmendesign.js). */
  --db-marke: #92ca3e;
  --db-seite: #92ca3e;
  --db-kopf:
    radial-gradient(circle at 88% 20%, rgba(146, 202, 62, 0.35), transparent 42%),
    linear-gradient(120deg, #27272b 0%, #35353a 55%, #4e4e56 100%);
  --db-kopf-schrift: #ffffff;
  --db-kopf-leise: rgba(255, 255, 255, 0.82);
  --db-kopf-klein: #92ca3e;
  --db-kopf-knopf: rgba(255, 255, 255, 0.12);
  --db-kopf-rand: rgba(255, 255, 255, 0.28);
  --db-kopf-auswahl: #27272b;
  background: var(--db-page);
  /* Eigene Schriftgroessen: die Groessen der Website gelten hier (noch) nicht. */
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .db-body { --bg-raised: #303035; --bg-sunken: #27272b; --line: #4e4e56; --db-page: #1f1f23; --db-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --rad-a: #747481; }
}
:root[data-theme="dark"] .db-body { --bg-raised: #303035; --bg-sunken: #27272b; --line: #4e4e56; --db-page: #1f1f23; --db-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --rad-a: #747481; }

.db { display: flex; min-height: 100vh; gap: 0; }
.db-icon { width: 20px; height: 20px; flex: none; }
.db-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Seitenleiste ----------------------------------------------------------- */
.db-side {
  position: sticky;
  top: 16px;
  align-self: flex-start;
  height: calc(100vh - 32px);
  width: 232px;
  flex: none;
  margin: 16px 0 16px 16px;
  padding: 22px 14px 16px;
  border-radius: var(--r-2);
  background: #27272b;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.db-side .logo-schrift { fill: #ffffff; }
.db-side .logo-t { fill: #92ca3e; }
.db-side .db-logo { padding: 0 10px; }
.db-side .db-logo-svg { height: 28px; }
.db-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.db-nav-label {
  margin: 16px 12px 6px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a9a9b3;
}
.db-nav-punkt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  color: #d6d6dc;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
}
.db-nav-punkt:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.db-nav-punkt[aria-current="true"] { background: var(--db-seite); color: #27272b; font-weight: 600; }
.db-nav-zu { color: #8e8e98; }
.db-schloss { width: 15px; height: 15px; margin-left: auto; opacity: 0.8; }
.db-side-fuss { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.db-thema {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #4d4d55;
  border-radius: var(--r);
  background: none;
  color: #d6d6dc;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.db-thema:hover { color: #ffffff; border-color: #a9a9b3; }
.db-side-link { color: #a9a9b3; font-size: 0.8rem; text-decoration: none; padding: 0 10px; }
.db-side-link:hover { color: #ffffff; }

/* --- Hauptbereich -------------------------------------------------------------- */
.db-haupt { flex: 1; min-width: 0; }
.db-inhalt { max-width: 1180px; margin: 0 auto; padding: 16px clamp(16px, 3vw, 32px) 40px; }
.db-kopfzeile, .db-reiter { display: none; }

.db-willkommen {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: var(--karte);
  border-radius: var(--db-radius);
  color: var(--db-kopf-schrift);
  background: var(--db-kopf);
  box-shadow: var(--db-shadow);
}
.db-willkommen h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; color: var(--db-kopf-schrift); }
.db-willkommen p { margin-top: 6px; color: var(--db-kopf-leise); font-size: 0.92rem; max-width: 60ch; }
.db-eyebrow { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--db-kopf-klein); font-weight: 600; }
.db-willkommen-text { position: relative; z-index: 1; min-width: 0; }
.db-willkommen-deko { flex: none; width: clamp(140px, 22vw, 260px); opacity: 0.22; transform: rotate(-8deg); }
.db-willkommen-deko .db-deko-logo { height: auto; width: 100%; }
.db-willkommen-deko .logo-schrift, .db-willkommen-deko .logo-t { fill: #ffffff; }
.db-zeitraum { margin-top: 18px; }
.db-zeitraum a { background: var(--db-kopf-knopf); border-color: var(--db-kopf-rand); color: var(--db-kopf-schrift); }
.db-zeitraum a:hover { border-color: var(--db-kopf-schrift); color: var(--db-kopf-schrift); }
.db-zeitraum a[aria-current="page"] { background: var(--db-kopf-schrift); border-color: var(--db-kopf-schrift); color: var(--db-kopf-auswahl); }

/* --- Eigene Idee ------------------------------------------------------------------ */
.db-idee { text-align: center; padding: 32px clamp(20px, 5vw, 56px); }
.db-idee h2 { font-size: 1.3rem; margin-top: 12px; }
.db-idee p { max-width: 58ch; margin: 10px auto 20px; color: var(--ink-dim); }
.db-idee-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--accent);
}
.db-idee-icon .db-icon { width: 24px; height: 24px; }
.db-idee-hinweis { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 0.9rem; color: var(--ink-dim); }
.db-idee-hinweis .db-icon { width: 18px; height: 18px; color: var(--accent); flex: none; }
.db-idee-hinweis a { color: var(--accent); font-weight: 600; }

.db-zurueck {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: var(--db-card);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.db-zurueck:hover { border-color: var(--accent); color: var(--accent); }
.db-zurueck .db-icon { width: 18px; height: 18px; }
.db-demo {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--primary) 22%, var(--db-card));
  font-size: 0.92rem;
}

/* --- Bereiche und Raster ------------------------------------------------------ */
.db-bereich { margin-top: 26px; }
.db-titel { font-size: 1.35rem; margin: 0 0 14px; }
.db-zwischen { font-size: 1.05rem; margin: 26px 0 12px; }

/* Sechs Spalten: Karte 2, breit 4, halb 3, voll 6. */
.db-raster { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.db-raster > * { grid-column: span 2; min-width: 0; }
.db-raster > .db-breit { grid-column: span 4; }
.db-raster > .db-halb { grid-column: span 3; }
.db-raster > .db-voll { grid-column: 1 / -1; }

.db-card {
  background: var(--db-card);
  border-radius: var(--db-radius);
  padding: var(--karte);
  box-shadow: var(--db-shadow);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.db-ohne-rahmen { padding: 0; background: none; border: 0; box-shadow: none; }
.db-card-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.db-card-kopf h2 { font-size: 1rem; }
.db-mehr { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 600; text-decoration: none; color: var(--accent); white-space: nowrap; }
.db-mehr .db-icon { width: 15px; height: 15px; }

/* Kacheln und Hero aus style.css in Kartenoptik */
.db .rb-tile, .db .rb-hero {
  border-radius: var(--r-2);
  border-color: color-mix(in srgb, var(--line) 60%, transparent);
  background: var(--db-card);
  box-shadow: var(--db-shadow);
}
.db .rb-tiles { margin-top: 0; }
.db-card .rb-hero { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
.db-hero-karte .rb-chart { margin-top: 10px; }
.db-hero-karte .rb-plot { height: 150px; }
.db .panel { margin-top: 0; }

.db-zahlen { display: grid; gap: 14px; margin-top: 6px; }
.db-zahlen div { display: flex; flex-direction: column; }
.db-zahlen span { font-size: 0.8rem; color: var(--ink-dim); }
.db-zahlen b { font-family: var(--display); font-size: 1.7rem; line-height: 1.2; font-weight: 600; }

.db-spitze { list-style: none; margin: 4px 0 0; padding: 0; counter-reset: platz; }
.db-spitze li {
  counter-increment: platz;
  display: grid;
  grid-template-columns: 26px auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.db-spitze li:last-child { border-bottom: 0; }
.db-spitze li::before {
  content: counter(platz);
  width: 26px;
  height: 26px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--accent);
}
.db-spitze-notiz { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-spitze b { font-variant-numeric: tabular-nums; }

.db-liste { list-style: none; margin: 4px 0 0; padding: 0; }
.db-liste li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.db-liste li:last-child { border-bottom: 0; }
.db-liste b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-liste small { color: var(--ink-dim); font-weight: 400; }

.db-status {
  padding: 12px 16px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--primary) 22%, var(--db-card));
  font-size: 0.92rem;
}
.db-praemie { font-size: 1.05rem; }
.db-stapel { display: flex; flex-direction: column; gap: 18px; }

/* --- Zusaetze in der Uebersicht ------------------------------------------------ */
.db-minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.db-mini { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); transition: transform 0.15s ease; }
.db-mini:hover { transform: translateY(-2px); }
.db-mini-kopf { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.92rem; }
.db-mini-kopf .db-icon { color: var(--accent); }
.db-mini-wert { font-family: var(--display); font-size: 1.9rem; font-weight: 600; line-height: 1.2; margin-top: 6px; }
.db-mini-wert small { font-size: 1rem; color: var(--ink-dim); font-weight: 500; }
.db-mini-text { font-size: 0.82rem; color: var(--ink-dim); }
.db-mini-zu {
  background:
    repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in srgb, var(--line) 45%, transparent) 10px 11px),
    var(--db-card);
}
.db-mini-zu .db-mini-kopf .db-icon:first-child { color: var(--ink-dim); }
.db-mini-zu .db-mini-text { margin-top: auto; color: var(--accent); font-weight: 600; }
.db-mini-geist { filter: blur(5px); opacity: 0.55; user-select: none; }

/* --- Gesperrte Module ----------------------------------------------------------- */
/* Karte ohne eigenen Rahmen: Die Vorschau bringt ihre Karten selbst mit. Vorschau
   und Angebot liegen in derselben Rasterzelle uebereinander. */
.db-card.db-zu {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(0, 1fr);
  min-height: 380px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.db-zu-geist, .db-zu-box { grid-area: 2 / 1; min-width: 0; }
.db-zu-geist {
  filter: blur(5px) grayscale(0.35);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.db-zu-box {
  position: relative;
  align-self: start;
  justify-self: center;
  margin: clamp(24px, 7vh, 72px) 16px 24px;
  max-width: 460px;
  text-align: center;
  padding: var(--karte);
  border-radius: var(--r-2);
  background: color-mix(in srgb, var(--db-card) 88%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: var(--db-shadow);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.db-zu-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.db-zu-knoepfe button { cursor: pointer; }

/* Vorschau offen: scharf, Angebot weg, Balken oben */
.db-zu-offen .db-zu-geist { filter: none; opacity: 1; }
.db-zu-offen .db-zu-box { display: none; }
.db-zu-leiste {
  grid-area: 1 / 1;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: var(--r-2);
  background: #27272b;
  color: #f2f2f4;
  font-size: 0.9rem;
}
.db-zu-leiste[hidden] { display: none; }
.db-zu-leiste > span { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; }
.db-zu-leiste .db-icon { width: 18px; height: 18px; color: var(--db-seite); flex: none; }
.db-zu-leiste .db-btn { padding: 8px 14px; }
.db-zu-leiste .db-btn-zweit { color: var(--db-seite); border-color: var(--db-seite); cursor: pointer; }

.db-zu-schloss {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  background: #27272b;
  color: var(--db-seite);
}
.db-zu-schloss .db-icon { width: 22px; height: 22px; }
.db-chip {
  display: block;
  width: max-content;
  margin: 12px auto 6px;
  padding: 3px 10px;
  border-radius: var(--r);
  font-size: 0.74rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--accent);
}
.db-zu-box h2 { font-size: 1.3rem; }
.db-zu-box p { margin-top: 8px; color: var(--ink-dim); }
.db-zu-box ul { text-align: left; margin: 14px auto 18px; padding: 0; list-style: none; display: grid; gap: 6px; max-width: 360px; }
.db-zu-box li { position: relative; padding-left: 22px; font-size: 0.92rem; }
.db-zu-box li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

.db-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.db-btn .db-icon { width: 16px; height: 16px; }
.db-btn:hover { filter: brightness(1.1); }
.db-btn-zweit { background: none; color: var(--accent); }

/* --- Gluecksrad ------------------------------------------------------------------ */
.db-rad-karte { display: grid; place-items: center; }
.db-rad-wrap { position: relative; padding-top: 14px; }
.db-rad-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border: 12px solid transparent;
  border-top: 18px solid var(--ink);
  border-bottom: 0;
  z-index: 1;
}
.db-rad {
  width: min(280px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 8px solid var(--db-card);
  box-shadow: 0 0 0 2px var(--line-strong), var(--db-shadow);
}

/* --- Visitenkarten-Verwaltung (Inhalt aus lib/visitenkarte-page.js) -------------- */
.vk-portal { --p: var(--primary); --on-p: var(--on-primary); --dim: var(--ink-dim); display: grid; gap: 18px; }
.vk-portal .panel { border-radius: var(--db-radius); box-shadow: var(--db-shadow); border-color: color-mix(in srgb, var(--line) 60%, transparent); background: var(--db-card); }
.vk-portal h2 { font-size: 1.05rem; margin: 0 0 10px; }
.vk-portal label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 4px; }
.vk-portal input:not([type=checkbox]):not([type=file]):not([type=color]), .vk-portal textarea, .vk-portal select,
.db dialog input:not([type=checkbox]):not([type=file]), .db dialog select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
}
.vk-portal textarea { min-height: 70px; }
.vk-portal .leiste { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.vk-portal .codebox, .db dialog .codebox { font: 600 1.5rem/1 var(--mono); letter-spacing: 0.12em; background: var(--bg-sunken); border-radius: var(--r); padding: 12px 16px; display: inline-block; }
.vk-portal .hinweis, .db dialog .hinweis { font-size: 0.82rem; color: var(--ink-dim); margin: 6px 0 0; }
.vk-portal .meldung, .db dialog .meldung { margin: 12px 0 0; font-size: 0.92rem; min-height: 1.2em; }
.meldung.bad { color: var(--bad); }
.meldung.ok { color: var(--ok); }
.vk-portal .tabelle { overflow-x: auto; }
.vk-portal .tabelle table { min-width: 640px; }
.vk-portal .mono { font-family: var(--mono); }
.vk-portal .status { font-size: 0.78rem; padding: 2px 8px; border-radius: var(--r); background: var(--bg-sunken); white-space: nowrap; }
.vk-portal .status.ein { background: var(--ok-bg); color: var(--ok); }
.vk-portal .status.gesp { background: var(--bad-bg); color: var(--bad); }
.vk-portal .schalter td { padding: 6px; }
.vk-portal .zwei, .db dialog .zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.knopf {
  display: block;
  width: 100%;
  border: 1px solid var(--primary);
  border-radius: var(--r);
  padding: 12px 0;
  margin-top: 10px;
  font: 600 0.95rem/1 var(--display);
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.knopf.zweit { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.knopf.klein { display: inline-block; width: auto; padding: 7px 12px; font-size: 0.82rem; margin: 2px; }
.knopf.rot { color: var(--bad); border-color: var(--bad); }
.knopf:disabled { opacity: 0.55; cursor: default; }
.db dialog {
  border: 0;
  border-radius: var(--r-2);
  padding: var(--karte);
  width: min(460px, 94vw);
  background: var(--db-card);
  color: var(--ink);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.db dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.db dialog label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 4px; }
.fotowahl { display: flex; align-items: center; gap: 12px; }
.fotowahl img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.hidden { display: none !important; }

/* --- Fuss ------------------------------------------------------------------------ */
.db-fuss { margin-top: 36px; padding: 0; border: 0; background: none; font-size: 0.85rem; color: var(--ink-dim); }
.db-fuss > p:first-child { max-width: 75ch; }
.db-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.db-recht { margin-top: 18px; }
.db-recht a { color: inherit; }

/* --- Mit JavaScript: immer nur ein Bereich ------------------------------------- */
.db-js .db-bereich { display: none; }
.db-js .db-bereich.aktiv { display: block; }
.db-js #uebersicht.aktiv { margin-top: 26px; }

/* --- Handy und Tablet ------------------------------------------------------------ */
@media (max-width: 980px) {
  .db-side { display: none; }
  .db-kopfzeile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #27272b;
    border-top: 5px solid var(--db-marke);
  }
  .db-kopfzeile .logo-schrift { fill: #ffffff; }
  .db-kopfzeile .logo-t { fill: #92ca3e; }
  .db-kopfzeile .db-logo-svg { height: 26px; }
  .db-thema-rund { padding: 8px; }
  .db-reiter {
    display: flex;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 10;
    overflow-x: auto;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--db-page) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .db-reiter-punkt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 8px 12px;
    border-radius: var(--r);
    border: 1px solid var(--line-strong);
    background: var(--db-card);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
  }
  .db-reiter-punkt .db-icon { width: 16px; height: 16px; }
  .db-reiter-punkt .db-schloss { width: 13px; height: 13px; margin-left: 0; }
  .db-reiter-punkt[aria-current="true"] { background: #27272b; border-color: #27272b; color: #ffffff; }
  .db-reiter-punkt.db-nav-zu { color: var(--ink-dim); }
  /* Tablet: zwei Spalten, breite Karten ueber die ganze Zeile */
  .db-raster > *, .db-raster > .db-halb { grid-column: span 3; }
  .db-raster > .db-breit { grid-column: 1 / -1; }
  .db-minis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 980px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .db-reiter-punkt[aria-current="true"] { background: var(--db-seite); border-color: var(--db-seite); color: #27272b; }
}
@media (max-width: 980px) {
  :root[data-theme="dark"] .db-reiter-punkt[aria-current="true"] { background: var(--db-seite); border-color: var(--db-seite); color: #27272b; }
}
@media (max-width: 560px) {
  .db-raster > *, .db-raster > .db-breit, .db-raster > .db-halb { grid-column: 1 / -1; }
  .db-willkommen-deko { display: none; }
  .db-card.db-zu { min-height: 0; }
  .db-zu-box { margin: 16px 8px; }
  .vk-portal .zwei, .db dialog .zwei { grid-template-columns: 1fr; }
  .weg-mobil { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .db-mini { transition: none; }
  .db-mini:hover { transform: none; }
}

/* --- Angemeldet (lib/kundenkonto.js) ------------------------------------------ */
.db-side-wer { color: #a9a9b3; font-size: 0.78rem; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-abmelden { margin: 0; }
.db-abmelden .db-thema:not(.db-thema-rund) { width: 100%; }
.db-kopf-knoepfe { display: flex; gap: 8px; align-items: center; }

/* --- Rundgang mit Woeti (public/dashboard.js) ------------------------------ */
[data-rundgang-knopf][hidden], .db-tour[hidden], .db-tour-skip[hidden] { display: none; }
.db-tour-dunkel { position: fixed; inset: 0; background: rgba(17, 20, 26, 0.62); z-index: 40; }
.db-tour-ebene { z-index: 41 !important; }
.db-tour-ziel {
  position: relative;
  z-index: 41;
  border-radius: var(--r);
  box-shadow: 0 0 0 4px var(--db-card), 0 0 0 7px #92ca3e;
}
.db-tour-karte {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 18px;
  max-width: 440px;
  margin: 0 auto;
  z-index: 42;
  padding: var(--karte);
  border-radius: var(--r-2);
  background: var(--db-card);
  color: var(--ink);
  box-shadow: 0 18px 48px -12px rgba(0, 0, 0, 0.45);
  animation: db-tour-rein 0.25s ease-out;
}
.db-tour-karte .buddy { position: absolute; width: 62px; height: 72px; left: -6px; top: -54px; overflow: visible; }
.db-tour-karte h2 { margin: 0 0 8px; padding-left: 52px; font-size: 1.15rem; line-height: 1.25; }
.db-tour-karte p { margin: 0; color: var(--ink); }
.db-tour-punkte { display: flex; gap: 6px; margin: 16px 0 4px; }
.db-tour-punkte i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: width 0.2s; }
.db-tour-punkte i.an { width: 22px; background: #92ca3e; }
.db-tour-fuss { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 10px; }
.db-tour-skip { margin-right: auto; background: none; border: 0; padding: 8px 0; font: inherit; color: var(--ink); opacity: 0.7; text-decoration: underline; cursor: pointer; }
.db-tour-fuss .db-btn { border: 0; cursor: pointer; font: inherit; }
.buddy .augen { transform-box: fill-box; transform-origin: center; animation: db-blinzeln 4.5s infinite; }
.buddy .arm-r { transform-box: fill-box; transform-origin: 0% 100%; }
.buddy .spross { transform-box: fill-box; transform-origin: 30% 100%; animation: db-wippen 3s ease-in-out infinite; }
.buddy.winkt .arm-r { animation: db-winken 1.4s ease-in-out 2; }
@keyframes db-blinzeln { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes db-winken { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-22deg); } 75% { transform: rotate(14deg); } }
@keyframes db-wippen { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
@keyframes db-tour-rein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .buddy *, .db-tour-karte { animation: none !important; } }

/* --- Punktestaende im Cockpit ---------------------------------------------- */
.db-tabelle { overflow-x: auto; }
.db-staende td { vertical-align: middle; }
.db-stand-knoepfe { text-align: right; white-space: nowrap; }
.db-btn-klein { padding: 6px 12px; font-size: 0.82rem; cursor: pointer; }
.db-btn-klein + .db-btn-klein { margin-left: 6px; }
.db-btn[disabled] { opacity: 0.45; cursor: default; filter: none; }

/* --- Ziele und Gruppen (Selbstverwaltung mit Abo) -------------------------- */
.db-sv-tabelle td { vertical-align: middle; }
.db-sv-tabelle select, .db-sv-form select, .db-sv-form input {
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--db-card);
  color: var(--ink);
  max-width: 100%;
}
.db-sv-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.db-sv-form label { font-weight: 600; font-size: 0.9rem; margin-right: 4px; }
.db-sv-form input:not([type=checkbox]) { flex: 1 1 180px; }
.db-sv-ziele { list-style: none; margin: 0; padding: 0; }
.db-sv-ziele li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.db-sv-ziele li > div { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.db-sv-ziele li:last-child { border-bottom: 0; }
.db-sv-zuordnen .db-tabelle { margin-top: 10px; max-height: 420px; overflow-y: auto; }
.db-sv-zuordnen [data-sv-seiten] { margin-right: auto; }

/* --- Design der Firma (Abo, lib/firmendesign.js) --------------------------- */
/* Logos sind fuer weissen Grund gemacht, die Seitenleiste ist Anthrazit. */
.db-firmenlogo {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--r);
  background: #ffffff;
  max-width: 100%;
}
.db-firmenlogo img { display: block; max-height: 44px; max-width: 100%; width: auto; object-fit: contain; }
.db-kopfzeile .db-firmenlogo { padding: 5px 9px; }
.db-kopfzeile .db-firmenlogo img { max-height: 30px; max-width: 160px; }
.db-design { display: grid; gap: 22px; }
.db-design-feld { display: grid; gap: 8px; justify-items: start; }
.db-design-feld > label:first-child { font-weight: 600; }
.db-design-feld p { margin: 0; max-width: 60ch; }
.db-design-feld .db-firmenlogo { border: 1px solid var(--line); }
.db-design input[type="color"] { width: 84px; height: 44px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--db-card); cursor: pointer; }
.db-design input[type="file"] { max-width: 100%; }
.db-design-weg { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.db-design-weg input { width: auto; }
.db-design .db-stand-knoepfe { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
.db-design-meldung { margin: 0; color: var(--bad); }
.db-design-meldung:empty { display: none; }
