:root {
  --bg: #f6f3ef;
  --flaeche: #ffffff;
  --flaeche-2: #faf7f3;
  --linie: #e4ddd4;
  --text: #2a211b;
  --text-2: #6a5f56;
  --primaer: #6b3410;
  --primaer-hover: #552809;
  --primaer-hell: #f5e7da;
  --fokus: #c46a1f;

  --a: #c62828;  --a-hell: #fde8e8;
  --b: #b86e00;  --b-hell: #fff1d6;
  --c: #5b6573;  --c-hell: #eceff3;

  --st-ein: #1f5fbf;  --st-ein-hell: #e3edfb;
  --st-bea: #6a3fb5;  --st-bea-hell: #eee6fa;
  --st-war: #9a5b00;  --st-war-hell: #fff0cf;
  --st-erl: #1e7a3c;  --st-erl-hell: #e2f4e8;
  --st-sto: #6b7280;  --st-sto-hell: #eceef1;

  /* Farbwelt der Meldungen – überall dieselbe Bedeutung (Büro, Admin, Filiale) */
  --ton-wichtig: #4a1c24;   --akz-wichtig: #f8ede8;    /* wichtig UND jetzt zu tun (nur Büro) */
  --ton-offen: #f3e1dc;     --akz-offen: #8a3326;      /* noch niemand zuständig / eingereicht */
  --ton-arbeit: #f2e6c9;    --akz-arbeit: #7a5a12;     /* in Bearbeitung – das Büro ist dran */
  --ton-wartet: #e3e9ef;    --akz-wartet: #4e5b68;     /* wartet auf Termin, Handwerker oder Filiale */
  --ton-erledigt: #e1ebe0;  --akz-erledigt: #46694a;   /* von der Filiale bestätigt */
  --ton-storniert: #ebe9e6; --akz-storniert: #6b6560;
  --alarm: #c62828;
  --radius: 12px;
  --schatten: 0 1px 2px rgba(60, 40, 20, .06), 0 2px 8px rgba(60, 40, 20, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 16px; line-height: 1.45; }
a { color: var(--primaer); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
.laden { padding: 3rem; text-align: center; color: var(--text-2); }
.leise { color: var(--text-2); }
.klein { font-size: .86rem; }
.fett { font-weight: 600; }
.versteckt { display: none !important; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- Demo-Hinweis (demo.meldungen.info bzw. lokaler Demo-Modus) */
.demo-balken { background: #2f5d8a; color: #fff; text-align: center; font-size: .86rem; padding: .35rem .8rem; }
.demo-balken code { background: rgba(255, 255, 255, .18); border-radius: 4px; padding: 0 .3rem; }

/* ---------- Kopf */
.kopf {
  position: sticky; top: 0; z-index: 20;
  background: var(--primaer); color: #fff;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .55rem max(1rem, env(safe-area-inset-left));
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.marke { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; min-width: 0; }
.marke img { width: 30px; height: 30px; border-radius: 7px; }
.marke b { font-size: 1.05rem; white-space: nowrap; }
.marke span { display: block; font-size: .78rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.nav a {
  color: #fff; text-decoration: none; padding: .45rem .8rem; border-radius: 8px; font-weight: 500; opacity: .88;
}
.nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.nav a.aktiv { background: rgba(255,255,255,.2); opacity: 1; }
.nutzer { display: flex; align-items: center; gap: .5rem; margin-left: auto; font-size: .9rem; }
.nutzer button { background: rgba(255,255,255,.14); border: 0; color: #fff; padding: .4rem .7rem; border-radius: 8px; cursor: pointer; }
.nutzer button:hover { background: rgba(255,255,255,.26); }

main { max-width: 1280px; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
main.schmal { max-width: 760px; }

/* ---------- Grundelemente */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.karte > h2:first-child, .karte > h3:first-child { margin-top: 0; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
  padding: .55rem 1rem; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none;
  min-height: 42px; transition: background .12s, border-color .12s;
}
.knopf:hover { background: var(--flaeche-2); border-color: #cfc5b9; }
.knopf.primaer { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.knopf.primaer:hover { background: var(--primaer-hover); }
.knopf.gruen { background: var(--st-erl); border-color: var(--st-erl); color: #fff; }
.knopf.gruen:hover { filter: brightness(.92); }
.knopf.rot { background: var(--flaeche); border-color: var(--a); color: var(--a); }
.knopf.rot:hover { background: var(--a-hell); }
.knopf.gross { font-size: 1.12rem; min-height: 56px; padding: .8rem 1.3rem; border-radius: 14px; }
.knopf.breit { width: 100%; }
.knopf.klein { min-height: 32px; padding: .3rem .65rem; font-size: .86rem; border-radius: 8px; }
.knopf:disabled { opacity: .55; cursor: wait; }
.knopfreihe { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.link-knopf { background: none; border: 0; color: var(--primaer); cursor: pointer; padding: 0; text-decoration: underline; font-weight: 500; }

label.feld, div.feld { display: block; margin-bottom: 1.1rem; }
label.feld > span, .feldtitel { display: block; font-weight: 600; margin-bottom: .35rem; }
.pflicht::after { content: " *"; color: var(--a); }
input:not([type]), input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid #cfc5b9; border-radius: 10px; background: #fff; min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--fokus); outline: 2px solid rgba(196,106,31,.25); outline-offset: 0; }
.zeile2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .zeile2 { grid-template-columns: 1fr; } }

/* ---------- Abzeichen */
.status { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.st-eingegangen { background: var(--st-ein-hell); color: var(--st-ein); }
.st-in_bearbeitung { background: var(--st-bea-hell); color: var(--st-bea); }
.st-erledigt_gemeldet { background: var(--st-war-hell); color: var(--st-war); }
.st-erledigt { background: var(--st-erl-hell); color: var(--st-erl); }
.st-storniert { background: var(--st-sto-hell); color: var(--st-sto); }
.alarm-punkt { display: inline-flex; align-items: center; gap: .3rem; color: var(--alarm); font-weight: 700; font-size: .82rem; }
.alarm-punkt::before { content: "⚠"; }
.nummer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }

/* ---------- Startseite (Mitarbeiter-Portal) */
.portal { max-width: 560px; margin: 0 auto; padding: max(5vh, 1.5rem) 1rem 3rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.portal-logo { width: min(100%, 440px); height: auto; background: #fff; border-radius: 18px; padding: 1.1rem 1.4rem; box-shadow: var(--schatten); border: 1px solid var(--linie); margin-bottom: 1.6rem; }
.portal-titel { font-size: 1.6rem; margin: 0 0 .25rem; }
.portal-unter { color: var(--text-2); margin: 0 0 1.3rem; }
.portal-apps { width: 100%; display: grid; gap: .8rem; }
.app-karte {
  display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left;
  padding: 1rem 1.1rem; min-height: 86px; border-radius: 16px; border: 2px solid var(--linie);
  background: var(--flaeche); font: inherit; color: inherit;
}
.app-karte .app-symbol { width: 52px; height: 52px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; background: var(--flaeche-2); }
.app-karte .app-symbol img { width: 52px; height: 52px; border-radius: 12px; }
.app-karte .app-text { flex: 1; display: flex; flex-direction: column; }
.app-karte b { font-size: 1.15rem; }
.app-karte small { color: var(--text-2); font-size: .92rem; margin-top: .1rem; }
.app-karte .app-pfeil { font-size: 1.5rem; color: var(--primaer); font-weight: 700; }
.app-karte.inaktiv { cursor: not-allowed; opacity: .6; background: var(--flaeche-2); border-style: dashed; }
.app-karte.inaktiv .app-symbol { filter: grayscale(1); }
.app-karte.aktiv { cursor: pointer; border-color: var(--primaer); box-shadow: 0 4px 14px rgba(107,52,16,.15); }
.app-karte.aktiv:hover { background: var(--primaer-hell); }
.app-karte.aktiv b { color: var(--primaer); }
.anmeldung .zurueck { margin: -.4rem 0 .6rem; }

/* ---------- Anmeldung */
.anmeldung { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem 2rem; }
.anmeldung .karte { width: 100%; max-width: 420px; padding: 1.6rem; }
.anmeldung .logo { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.anmeldung .logo img { width: 48px; height: 48px; border-radius: 12px; }
.anmeldung .logo b { font-size: 1.35rem; display: block; }
.reiter { display: flex; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px; padding: 3px; margin-bottom: 1.2rem; }
.reiter button { flex: 1; border: 0; background: none; padding: .55rem; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.reiter button.aktiv { background: #fff; color: var(--text); box-shadow: var(--schatten); }
.pin { letter-spacing: .4em; font-size: 1.3rem; text-align: center; }
.fehlermeldung { background: var(--a-hell); color: var(--a); border-radius: 8px; padding: .6rem .8rem; margin-bottom: 1rem; font-weight: 500; }
.hinweis { background: var(--st-war-hell); color: #6d4200; border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; }
.hinweis.blau { background: var(--st-ein-hell); color: #17427f; }
.hinweis.gruen { background: var(--st-erl-hell); color: #145529; }
.geheim { font-family: ui-monospace, Menlo, monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: .08em; background: #fff; padding: .2rem .6rem; border-radius: 6px; border: 1px dashed #caa25a; user-select: all; }

/* ---------- Filialansicht */
.filial-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filial-kopf h1 { margin: 0; }
.melden-knopf { font-size: 1.25rem; min-height: 68px; border-radius: 16px; width: 100%; margin-bottom: 1.4rem; box-shadow: 0 4px 14px rgba(107,52,16,.25); }
.melden-knopf .plus { font-size: 1.7rem; line-height: 1; font-weight: 400; }
.abschnitt-titel { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 .6rem; }
.abschnitt-titel .anzahl { background: var(--primaer-hell); color: var(--primaer); border-radius: 999px; padding: 0 .55rem; font-size: .85rem; }
.leer { text-align: center; padding: 1.6rem 1rem; color: var(--text-2); background: var(--flaeche); border: 1px dashed var(--linie); border-radius: var(--radius); }
.admin-leiste { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; background: var(--st-ein-hell); color: #17427f; padding: .6rem .9rem; border-radius: 10px; margin-bottom: 1rem; }
.admin-leiste select { width: auto; min-width: 240px; }

.bestaetigen-box { background: var(--primaer-hell); border: 2px solid #d9b99a; border-radius: 16px; padding: .2rem .9rem .8rem; margin-bottom: 1.2rem; }
.bestaetigen-box .abschnitt-titel { color: var(--primaer); }
.bestaetigen-box .abschnitt-titel .anzahl { background: var(--primaer); color: #fff; }
.bestaetigen-box .abschnitt-titel { margin-top: .8rem; }

/* Filiale: Board-Ansicht (Kanban) */
.filial-kopf { align-items: center; }
.board-hinweis { display: none; margin: 0 0 .5rem; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; align-items: start; }
.spalte { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 14px; overflow: hidden; min-width: 0; }
.spalte header { padding: .75rem .9rem .7rem; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.spalte .kopfzeile-spalte { display: flex; align-items: center; gap: .5rem; }
.spalte .titel { font-weight: 800; font-size: 1.05rem; flex: 1; }
.spalte .zahl { min-width: 30px; height: 30px; padding: 0 .5rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: #efe7dd; color: var(--text); }
.spalte header small { display: block; color: var(--text-2); margin-top: .15rem; }
.spalte .zeitraum-wahl { margin-top: .45rem; min-height: 36px; padding: .3rem .5rem; font-size: .88rem; background: #fff; }
.spalte-inhalt { padding: .7rem; display: grid; gap: .6rem; }
.spalte-inhalt .leer { padding: 1rem .6rem; background: transparent; }
.bestaetigen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; }
@media (max-width: 760px) {
  .board-hinweis { display: block; }
  .board {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%;
    overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin: 0 -.75rem; padding: 0 .75rem .6rem; scroll-padding: 0 .75rem;
  }
  .spalte { scroll-snap-align: start; }
}

/* Aktueller Stand (Filiale und Büro) */
.standmarke { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.stand-ein { background: var(--ton-offen); color: var(--akz-offen); }
.stand-bea, .stand-hw, .stand-ueb, .stand-ant { background: var(--ton-arbeit); color: var(--akz-arbeit); }
.stand-rf, .stand-war { background: var(--ton-wartet); color: var(--akz-wartet); }
.stand-todo { background: var(--primaer); color: #fff; }
.stand-erl { background: var(--ton-erledigt); color: var(--akz-erledigt); }
.stand-sto { background: var(--ton-storniert); color: var(--akz-storniert); }
.stand-unter { font-size: .9rem; color: var(--text-2); }
.rueckfrage-box { border: 2px solid #d9b99a; background: var(--primaer-hell); }
.antwort-box { border: 2px solid #d8c28f; background: #fbf5e6; }
.frage-text { font-size: 1.05rem; font-weight: 600; margin-bottom: .3rem; white-space: pre-wrap; }
.blase.frage { background: var(--primaer-hell); border-color: #e3cbb3; }
.blase.antwort { background: #fbf5e6; border-color: #e6d6ad; }

/* ---------- Farbwelt: ein Ton pro Meldung (Karte, Listenzeile, Detail, Farbpunkt) */
.ton-wichtig   { --t-bg: var(--ton-wichtig);   --t-akz: var(--akz-wichtig);   --t-punkt: var(--ton-wichtig); }
.ton-offen     { --t-bg: var(--ton-offen);     --t-akz: var(--akz-offen);     --t-punkt: var(--akz-offen); }
.ton-arbeit    { --t-bg: var(--ton-arbeit);    --t-akz: var(--akz-arbeit);    --t-punkt: var(--akz-arbeit); }
.ton-wartet    { --t-bg: var(--ton-wartet);    --t-akz: var(--akz-wartet);    --t-punkt: var(--akz-wartet); }
.ton-erledigt  { --t-bg: var(--ton-erledigt);  --t-akz: var(--akz-erledigt);  --t-punkt: var(--akz-erledigt); }
.ton-storniert { --t-bg: var(--ton-storniert); --t-akz: var(--akz-storniert); --t-punkt: var(--akz-storniert); }
.ton-todo      { --t-bg: var(--primaer-hell);  --t-akz: var(--primaer);       --t-punkt: var(--primaer); }
.ton-punkt { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--t-bg); box-shadow: inset 0 0 0 2px var(--t-punkt); vertical-align: -1px; }

/* Meldungskarte (Büro und Filiale) */
.mkarte {
  display: grid; gap: .3rem; text-decoration: none; color: var(--text); background: var(--t-bg, var(--flaeche));
  border: 1px solid rgba(60, 40, 20, .08); border-radius: 12px; padding: .75rem .85rem; box-shadow: var(--schatten);
  transition: filter .12s;
}
.mkarte:hover { filter: brightness(.97); }
.mk-kopf { display: flex; align-items: baseline; gap: .5rem; }
.mk-filiale { font-weight: 800; font-size: 1.08rem; line-height: 1.25; min-width: 0; }
.mk-rechts { margin-left: auto; display: flex; align-items: baseline; gap: .5rem; white-space: nowrap; font-size: .82rem; }
.mk-wichtig { font-weight: 800; color: var(--ton-wichtig); }
.mk-alter { color: var(--text-2); font-variant-numeric: tabular-nums; }
.mk-text { font-size: .95rem; overflow-wrap: anywhere; white-space: pre-line; }
.mk-schritt { font-size: .88rem; font-weight: 700; color: var(--t-akz); }
.mk-notiz { font-size: .83rem; color: var(--text-2); overflow-wrap: anywhere; }
.mk-fuss { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; font-size: .8rem; border-top: 1px solid rgba(60, 40, 20, .12); padding-top: .35rem; margin-top: .1rem; }
.mk-fuss > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.mk-nr { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-personen { display: grid; grid-template-columns: max-content 1fr; gap: .05rem .7rem; }
.mk-personen .mk-label { color: var(--text-2); white-space: nowrap; }
.mk-oben { display: flex; justify-content: space-between; gap: .5rem; font-size: .76rem; color: var(--text-2); font-variant-numeric: tabular-nums; margin-bottom: -.15rem; }
.mkarte.ton-wichtig .mk-oben { color: rgba(248, 237, 232, .75); }
.mkarte.ton-wichtig .mk-label { color: rgba(248, 237, 232, .7); }
/* Wichtig und jetzt zu tun: dunkles Weinrot mit heller Schrift */
.mkarte.ton-wichtig { color: var(--akz-wichtig); border-color: transparent; }
.mkarte.ton-wichtig .mk-wichtig, .mkarte.ton-wichtig .mk-schritt { color: #fff; }
.mkarte.ton-wichtig .mk-alter, .mkarte.ton-wichtig .mk-notiz, .mkarte.ton-wichtig .mk-nr { color: rgba(248, 237, 232, .78); }
.mkarte.ton-wichtig .mk-fuss { border-top-color: rgba(248, 237, 232, .22); }
.mkarte.ton-wichtig:hover { filter: brightness(1.12); }
.mkarte.ton-storniert { opacity: .8; }
/* Filialkarte: Ticket-Nr. klein oben, dazu ggf. die Aufgabe der Filiale */
.mkarte.fk .mk-kopf { font-size: .8rem; }
.mkarte.fk .mk-text { font-weight: 600; }
.mkarte.fk .mk-notiz { color: var(--text); font-size: .9rem; }
.mkarte.fk .mk-rechts, .mkarte.fk .mk-wichtig { margin-left: auto; }
.mk-aufgabe { font-size: .9rem; font-weight: 600; color: #4a2508; background: rgba(255, 255, 255, .72); border-left: 4px solid var(--primaer); border-radius: 6px; padding: .4rem .55rem; }
.mkarte.todo { box-shadow: 0 0 0 2px var(--primaer), var(--schatten); }
.mkarte .jetzt { font-weight: 800; color: var(--primaer); }

/* Filiale: vereinfachte Detailseite */
.fd-kopf { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.fd-kopf .nummer { font-size: 1.15rem; color: var(--text); }
.fd-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin-bottom: .3rem; }
.fd-stand { border-left: 6px solid var(--t-punkt, var(--linie)); background: var(--t-bg, var(--flaeche)); }
.fd-satz { font-size: 1.2rem; font-weight: 600; line-height: 1.4; margin-bottom: .3rem; }
.fd-problem { font-size: 1.05rem; white-space: pre-wrap; margin-bottom: .6rem; }
details.fd-mehr { padding: 0; }
.fd-mehr-inhalt { padding: 1rem 1.2rem; }
.fd-plan { margin-bottom: 1rem; }
.fz-filter { display: flex; align-items: center; gap: .6rem; margin: 0 0 .8rem; font-weight: 600; }
.fz-filter select { width: auto; min-width: 220px; }
.fd-aufgabe-hinweis { display: block; margin-bottom: 1rem; padding: .7rem .9rem; border-radius: 12px; background: var(--primaer-hell);
  border: 2px solid #d9b99a; color: var(--primaer); font-weight: 700; text-decoration: none; }
.fd-aufgabe-hinweis b { float: right; }
.fd-plan .mk-plan { font-size: 1.05rem; background: var(--ton-arbeit); padding: .6rem .8rem; border-radius: 10px; }
.fd-verlauf-titel { font-size: 1.1rem; }
.fd-kopf .leise { margin-left: auto; }
.feld-hinweis.mitlesen { display: block; margin-top: .3rem; }
details.fd-mehr > summary { cursor: pointer; padding: .9rem 1.2rem; font-weight: 600; color: var(--primaer); list-style: none; }
details.fd-mehr > summary::-webkit-details-marker { display: none; }
details.fd-mehr > summary::after { content: " ▾"; }
details.fd-mehr[open] > summary::after { content: " ▴"; }
details.fd-mehr[open] > summary { border-bottom: 1px solid var(--linie); }
details.fd-mehr > .karte { border: 0; box-shadow: none; margin: 0; }
details.fd-mehr > .verlauf { padding: 1rem 1.2rem .2rem; }
details.fd-mehr .aktionsbox h3 { display: none; }

/* Besonders wichtig (vom Büro gekennzeichnet) */
.wichtig-marke { display: inline-flex; align-items: center; padding: .12rem .55rem; border-radius: 999px; background: var(--ton-wichtig); color: var(--akz-wichtig); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.wichtig-punkt { color: var(--ton-wichtig); font-size: 1.05rem; font-weight: 800; }
.knopf.wichtig-knopf { border-color: var(--ton-wichtig); color: var(--ton-wichtig); }
.knopf.wichtig-knopf:hover { background: #f4e6e6; }

/* Filiale: Kopf mit großer Filialbezeichnung */
.filial-titel { font-size: 2.1rem; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.filial-person { margin: .2rem 0 0; color: var(--text-2); font-size: 1rem; }
@media (max-width: 520px) { .filial-titel { font-size: 1.8rem; } }
.feld-hinweis { font-weight: 500; color: var(--text-2); font-size: .88rem; }

/* ---------- Meldeformular */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  border: 1px solid #cfc5b9; background: #fff; border-radius: 999px; padding: .45rem .85rem; cursor: pointer; font-weight: 500; min-height: 40px;
}
.chip:hover { border-color: var(--primaer); }
.chip.aktiv { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.namen-knopf { width: 100%; text-align: left; justify-content: space-between; min-height: 50px; font-weight: 600; background: #fff; border: 1px solid #cfc5b9; }
.namen-knopf.leer-wahl { color: var(--text-2); font-weight: 500; }
.namen-knopf::after { content: "▾"; color: var(--text-2); }
.foto-leiste { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.foto-vorschau { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--linie); }
.foto-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.foto-vorschau button { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; line-height: 1; }
.foto-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.erfolg { text-align: center; padding: 2.4rem 1.2rem; }
.erfolg .haken { width: 76px; height: 76px; border-radius: 50%; background: var(--st-erl); color: #fff; font-size: 2.6rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.erfolg .knopfreihe { justify-content: center; }
.abstand-oben { margin-top: 1rem; }
.erfolg .grossnr { font-size: 2rem; font-weight: 800; letter-spacing: .04em; color: var(--primaer); }

/* ---------- Modal */
.overlay { position: fixed; inset: 0; background: rgba(30,20,10,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .overlay { align-items: center; } }
.modal { background: #fff; width: 100%; max-width: 520px; max-height: 88vh; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
@media (min-width: 640px) { .modal { border-radius: 16px; } }
.modal-kopf { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.1rem .6rem; }
.modal-kopf h2 { margin: 0; }
.modal-kopf button { border: 0; background: var(--flaeche-2); width: 36px; height: 36px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }
.modal-inhalt { padding: 0 1.1rem 1.1rem; overflow: auto; }
.namensliste { list-style: none; margin: .6rem 0 0; padding: 0; }
.namensliste button { width: 100%; text-align: left; padding: .8rem .7rem; border: 0; border-bottom: 1px solid var(--linie); background: none; cursor: pointer; font-size: 1.02rem; }
.namensliste button:hover, .namensliste button.gewaehlt { background: var(--primaer-hell); }
.bild-gross { max-width: 100%; max-height: 80vh; display: block; margin: 0 auto; border-radius: 8px; }

/* ---------- Büroansicht */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.kz {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .75rem .9rem; box-shadow: var(--schatten);
  text-align: left; cursor: pointer; border-top: 4px solid var(--linie);
}
.kz:hover { border-color: #cfc5b9; }
.kz.aktiv { outline: 3px solid var(--fokus); outline-offset: -1px; }
.kz .wert { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kz .titel { font-size: .85rem; color: var(--text-2); font-weight: 600; }
.kz.k-ein { border-top-color: var(--st-ein); }
.kz.k-bea { border-top-color: var(--st-bea); }
.kz.k-war { border-top-color: var(--st-war); }
.kz.k-erl { border-top-color: var(--st-erl); }
.kz.k-alarm { border-top-color: var(--alarm); }
.kz.k-alarm .wert { color: var(--alarm); }
.kz.k-a { border-top-color: var(--a); }
.alarmleiste { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: var(--a-hell); border: 1px solid #f3c1c1; border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: 1rem; }
.alarmleiste b { color: var(--alarm); margin-right: .3rem; }
.alarmleiste button { border: 1px solid #efb2b2; background: #fff; color: var(--alarm); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; font-weight: 600; font-size: .88rem; }
.alarmleiste button.aktiv { background: var(--alarm); color: #fff; border-color: var(--alarm); }
.filterleiste { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; align-items: end; margin-bottom: .8rem; }
.filterleiste label { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.filterleiste select, .filterleiste input { min-height: 40px; padding: .45rem .6rem; font-size: .92rem; margin-top: .2rem; }
.filterleiste .suche { grid-column: span 2; }
@media (max-width: 520px) { .filterleiste .suche { grid-column: auto; } }

.tabelle { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; margin-bottom: 1rem; }
.tzeile {
  display: grid; grid-template-columns: 58px 34px minmax(120px, 1fr) minmax(100px, .8fr) minmax(160px, 2fr) minmax(150px, 1.3fr) minmax(90px, .8fr) 62px 52px;
  gap: .6rem; align-items: center; padding: .6rem .9rem; border-bottom: 1px solid var(--linie);
  text-decoration: none; color: inherit; font-size: .92rem;
}
.tzeile:last-child { border-bottom: 0; }
a.tzeile:hover { filter: brightness(.97); }
.tzeile.kopfzeile { background: var(--flaeche-2); font-size: .78rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
a.tzeile[class*="ton-"] { background: var(--t-bg); border-bottom-color: rgba(255, 255, 255, .7); }
.tzeile .t-filiale { font-weight: 700; }
.tzeile .t-schritt { display: block; font-weight: 700; color: var(--t-akz); line-height: 1.3; }
.tzeile.ton-wichtig { color: var(--akz-wichtig); }
.tzeile.ton-wichtig .nummer, .tzeile.ton-wichtig .unter { color: rgba(248, 237, 232, .78); }
.tzeile.ton-wichtig .t-schritt, .tzeile.ton-wichtig .wichtig-punkt { color: #fff; }
a.tzeile.ton-wichtig:hover { filter: brightness(1.12); }
.tzeile .beschr { min-width: 0; overflow-wrap: anywhere; }
.tzeile > span { min-width: 0; }
.tzeile .unter { display: block; font-size: .8rem; color: var(--text-2); overflow-wrap: anywhere; }
.gruppentitel { padding: .55rem .9rem; background: #efe7dd; font-weight: 700; display: flex; justify-content: space-between; border-bottom: 1px solid var(--linie); }
@media (max-width: 980px) {
  .tzeile { grid-template-columns: 62px 36px 1fr; grid-template-areas: "nr prio fil" "text text text" "st st st"; row-gap: .25rem; }
  .tzeile.kopfzeile { display: none; }
  .tzeile > :nth-child(1) { grid-area: nr; }
  .tzeile > :nth-child(2) { grid-area: prio; }
  .tzeile > :nth-child(3) { grid-area: fil; font-weight: 600; }
  .tzeile > :nth-child(4) { display: none; }
  .tzeile > :nth-child(5) { grid-area: text; }
  .tzeile > :nth-child(6) { grid-area: st; }
  .tzeile > :nth-child(7), .tzeile > :nth-child(8), .tzeile > :nth-child(9) { display: none; }
}

/* ---------- Büro: Board-Ansichten (nach Eingang / nach Status) */
.ansicht-leiste { display: flex; justify-content: flex-end; margin-bottom: .8rem; }
.ansicht-wahl button { font-size: .92rem; padding: .45rem .9rem; font-weight: 600; }
.board.vier { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.abschnitt-kopf { display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: .35rem .2rem .1rem; color: var(--text-2); }
.abschnitt-kopf span:last-child { margin-left: auto; }
.abschnitt-kopf:not(:first-child) { margin-top: .4rem; border-top: 1px dashed var(--linie); padding-top: .6rem; }
@media (max-width: 760px) { .board.vier { grid-template-columns: none; } .ansicht-leiste { justify-content: stretch; } .ansicht-wahl { width: 100%; } .ansicht-wahl button { flex: 1; padding: .45rem .3rem; font-size: .85rem; } }

/* ---------- Büro: Suche und einklappbare Filter */
.suchzeile { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.suchzeile input[type=search] { flex: 1; min-height: 42px; }
.suchzeile .knopf { white-space: nowrap; min-height: 42px; }
#b-filter-feld { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: .7rem .8rem; }
#b-filter-feld .suche { grid-column: auto; }

/* ---------- Büro: Meine Aufgaben */
.ansicht-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: .6rem 1rem; flex-wrap: wrap; margin: .2rem 0 .9rem; }
.ansicht-kopf h2 { margin: 0; font-size: 1.35rem; display: flex; align-items: center; gap: .5rem; }
.ansicht-kopf h2 .anzahl { background: #efe7dd; border-radius: 999px; padding: .05rem .6rem; font-size: .9rem; font-weight: 700; }
.ansicht-kopf p { margin: .2rem 0 0; color: var(--text-2); font-size: .92rem; max-width: 70ch; }
.ag-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; }

/* ---------- Ticket-Detail */
.zurueck { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .8rem; font-weight: 600; text-decoration: none; background: none; border: 0; color: var(--primaer); cursor: pointer; padding: .3rem 0; }
.schritte { display: flex; margin: .2rem 0 1rem; counter-reset: s; }
.schritte li { list-style: none; flex: 1; text-align: center; position: relative; font-size: .8rem; color: var(--text-2); padding: 34px .25rem 0; hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 520px) { .schritte li { font-size: .72rem; } }
.schritte li::before {
  counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--linie); display: flex; align-items: center; justify-content: center; font-weight: 700; z-index: 1;
}
.schritte li::after { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: var(--linie); }
.schritte li:first-child::after { display: none; }
.schritte li.fertig { color: var(--text); }
.schritte li.fertig::before { content: "✓"; background: var(--st-erl); border-color: var(--st-erl); color: #fff; }
.schritte li.fertig::after, .schritte li.jetzt::after { background: var(--st-erl); }
.schritte li.jetzt { color: var(--text); font-weight: 700; }
.schritte li.jetzt::before { border-color: var(--primaer); color: var(--primaer); box-shadow: 0 0 0 4px var(--primaer-hell); }
.schritte { padding: 0; }
.beschreibung { white-space: pre-wrap; font-size: 1.05rem; background: var(--flaeche-2); border-radius: 10px; padding: .9rem 1rem; margin: 0 0 1rem; border: 1px solid var(--linie); }
.foto-raster { display: flex; flex-wrap: wrap; gap: .5rem; }
.foto-raster button { padding: 0; border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; width: 110px; height: 110px; cursor: zoom-in; background: #eee; }
.foto-raster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aktionsbox h3 { margin-bottom: .7rem; }
.aktionsbox + .aktionsbox { margin-top: 0; }
.aktionsbox.hervor { border: 2px solid #d9b99a; background: var(--primaer-hell); }
.radiokarten { display: grid; gap: .5rem; margin-bottom: .8rem; }
.radiokarten label { display: flex; gap: .6rem; align-items: center; border: 2px solid var(--linie); border-radius: 10px; padding: .6rem .8rem; cursor: pointer; font-weight: 600; }
.radiokarten label:has(input:checked) { border-color: var(--primaer); background: var(--primaer-hell); }
.radiokarten input { accent-color: var(--primaer); width: 18px; height: 18px; }
.unterfelder { padding: .2rem 0 .2rem; }
.segment { display: inline-flex; border: 1px solid #cfc5b9; border-radius: 10px; overflow: hidden; }
.segment button { border: 0; background: #fff; padding: .45rem .9rem; cursor: pointer; font-weight: 700; border-right: 1px solid #cfc5b9; }
.segment button:last-child { border-right: 0; }
.segment button.aktiv { background: var(--primaer); color: #fff; }
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--linie); margin-left: .4rem; }
.verlauf li:last-child { border-left-color: transparent; }
.verlauf li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--c); }
.verlauf li.r-filiale::before { border-color: var(--primaer); }
.verlauf li.r-buero::before { border-color: var(--akz-wartet); }
.verlauf li.a-status::before { background: var(--akz-arbeit); border-color: var(--akz-arbeit); }
.verlauf .meta { font-size: .8rem; color: var(--text-2); }
.verlauf .meta b { color: var(--text); font-weight: 600; }
.verlauf .rolle { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; padding: 0 .35rem; border-radius: 4px; margin-left: .3rem; }
.verlauf .rolle.filiale { background: var(--primaer-hell); color: var(--primaer); }
.verlauf .rolle.buero { background: var(--ton-wartet); color: var(--akz-wartet); }
.verlauf .v-text { font-size: .95rem; margin-top: .1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.verlauf li.r-filiale .v-text { color: #4a2508; }

/* ---------- Ticket-Detail (Büro): Kopf · Stand · Steuerung · Verlauf */
.td-titel { display: flex; align-items: baseline; gap: .4rem .8rem; flex-wrap: wrap; margin-bottom: .7rem; }
.td-titel h1 { margin: 0; font-size: 1.6rem; }
.td-mangel { border-left: 6px solid var(--primaer); }
.td-problem { font-size: 1.3rem; font-weight: 500; line-height: 1.4; margin: .2rem 0 .7rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.td-meta { font-size: .85rem; color: var(--text-2); margin: .6rem 0 0; }
.td-rechts { margin-left: auto; display: flex; gap: .6rem; align-items: center; }
.td-nr { color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.td-stand { background: var(--t-bg); border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; }
.td-schritt { font-weight: 800; color: var(--t-akz); font-size: 1.05rem; margin-bottom: .35rem; }
.td-standtext { margin: 0 0 .1rem; font-size: 1rem; overflow-wrap: anywhere; }
.td-wer { margin: .1rem 0 0; font-size: .86rem; color: var(--text-2); }
.td-alarm { margin: .4rem 0 0; font-size: .86rem; font-weight: 700; color: var(--akz-offen); }
.td-stand.ton-wichtig { color: var(--akz-wichtig); }
.td-stand.ton-wichtig .td-schritt, .td-stand.ton-wichtig .td-alarm { color: #fff; }
.td-stand.ton-wichtig .td-wer { color: rgba(248, 237, 232, .8); }
.td-raster { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .td-raster { grid-template-columns: 1fr; } }
.td-steuerung h2, .td-verlauf h2 { font-size: 1.15rem; }
.td-steuerung h3 { font-size: 1rem; margin: .2rem 0 .3rem; }
.td-feld > span { font-size: 1rem; }
.td-feld textarea { min-height: 96px; }
.td-hinweis { background: var(--primaer-hell); border-radius: 10px; padding: .55rem .75rem; margin-bottom: .9rem; font-size: .95rem; overflow-wrap: anywhere; }
.td-hinweis .link-knopf { display: block; margin-top: .3rem; font-size: .88rem; }
.schritte.fuenf li { font-size: .76rem; }
.td-jetzt { background: var(--t-bg); color: var(--t-akz); font-weight: 700; border-radius: 10px; padding: .6rem .8rem; margin: 0 0 .9rem; }
.td-jetzt.ton-wichtig { color: #fff; }
.td-warnung { background: var(--ton-offen); color: var(--akz-offen); font-weight: 600; }
.td-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: .55rem; }
.td-kacheln.n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .td-kacheln.n5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.td-kachel { display: flex; flex-direction: column; gap: .2rem; text-align: left; border: 2px solid var(--linie); background: var(--flaeche); border-radius: 12px; padding: .7rem .85rem; font: inherit; cursor: pointer; }
.td-kachel b { font-size: 1rem; }
.td-kachel span { font-size: .84rem; color: var(--text-2); line-height: 1.3; }
.td-kachel:hover { border-color: var(--primaer); }
.td-kachel.aktiv { border-color: var(--primaer); background: var(--primaer-hell); box-shadow: inset 0 0 0 1px var(--primaer); }
.td-kachel:disabled { opacity: .55; cursor: default; }
.verlauf li.aktuell .v-text { background: var(--ton-arbeit); border-radius: 8px; padding: .3rem .5rem; }
.verlauf li.aktuell .meta::after { content: "aktueller Stand"; margin-left: .4rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--akz-arbeit); }
.td-ablauf { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.td-block { border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); }
.td-block > summary { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; cursor: pointer; list-style: none; }
.td-block > summary::-webkit-details-marker { display: none; }
.td-block > summary::after { content: "▾"; margin-left: .2rem; color: var(--text-2); font-size: .85rem; }
.td-block[open] > summary::after { content: "▴"; }
.td-block-nr { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 800; border: 2px solid var(--linie); color: var(--text-2); background: #fff; }
.td-block > summary b { flex: 1; }
.td-block-zustand { font-size: .82rem; color: var(--text-2); white-space: nowrap; }
.td-block.fertig .td-block-nr { background: var(--st-erl); border-color: var(--st-erl); color: #fff; }
.td-block.fertig .td-block-zustand { color: var(--st-erl); font-weight: 600; }
.td-block.offen > summary b { color: var(--text-2); font-weight: 600; }
.td-block.jetzt { border: 2px solid var(--primaer); }
.td-block.jetzt .td-block-nr { border-color: var(--primaer); color: var(--primaer); box-shadow: 0 0 0 3px var(--primaer-hell); }
.td-block.jetzt .td-block-zustand { color: var(--primaer); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.td-block-inhalt { padding: .2rem .9rem .9rem; }
.td-block:not(.jetzt) .td-block-inhalt { padding-left: 3rem; }
.td-block-war { margin: 0 0 .3rem; font-weight: 600; overflow-wrap: anywhere; }
.td-steuerung { border: 1px solid var(--linie); }
.td-teil { border-left: 3px solid var(--primaer-hell); padding: .1rem 0 .1rem .8rem; margin-bottom: 1rem; }
.td-teil-titel { font-weight: 700; margin-bottom: .5rem; }
.td-teil-titel span { display: inline-block; min-width: 2.2rem; color: var(--primaer); }
.td-teil .profil-wahl { margin-bottom: .4rem; }
.td-spalte { min-width: 0; }
.td-senden-hinweis { text-align: right; margin: .4rem 0 0; }
.td-einstellungen h2 { font-size: 1.05rem; }
.te-zeile { display: grid; grid-template-columns: 12rem 1fr auto; align-items: center; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--linie); }
.te-zeile:first-of-type { border-top: 0; }
.te-name { color: var(--text-2); }
.te-wert { font-weight: 600; }
.te-form { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px; padding: .8rem .9rem; margin: .2rem 0 .6rem; }
.te-storno { border-top: 1px solid var(--linie); padding-top: .7rem; margin-top: .3rem; }
@media (max-width: 520px) { .te-zeile { grid-template-columns: 1fr auto; } .te-name { grid-column: 1 / -1; } }
.td-ergebnis { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 .4rem; }
.td-ergebnis dt { color: var(--text-2); white-space: nowrap; }
.td-ergebnis dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 520px) { .td-ergebnis { grid-template-columns: 1fr; } .td-ergebnis dd { margin-bottom: .3rem; } }
.td-vorgabe { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px; padding: .55rem .75rem; }
.td-vorgabe .link-knopf { display: block; margin-top: .25rem; font-size: .88rem; }
.td-jetzt-hinweis { margin: -.2rem 0 .8rem; }
.td-plan { font-size: 1.05rem; margin: -.3rem 0 1rem; padding: .55rem .85rem; border-radius: 10px; background: var(--flaeche); border: 1px solid var(--linie); border-left: 5px solid var(--akz-arbeit); }
.td-plan span { color: var(--text-2); }
.td-plan.ueberfaellig { border-left-color: var(--akz-offen); background: var(--ton-offen); }
.td-plan.ueberfaellig span { color: var(--akz-offen); font-weight: 700; }
.plan-feld input[type=date] { max-width: 220px; }
.plan-schnell { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.chip.klein { min-height: 30px; padding: .2rem .6rem; font-size: .84rem; }
.mk-ueberfaellig { color: var(--akz-offen); font-weight: 700; }
.mkarte.ton-wichtig .mk-ueberfaellig { color: #fff; }
.mk-plan { font-size: .88rem; background: rgba(255, 255, 255, .6); border-radius: 6px; padding: .3rem .5rem; }
.mk-plan.verzoegert { color: var(--akz-offen); }
.fd-stand .mk-plan { margin-bottom: .5rem; font-size: 1rem; }
.t-ueberfaellig { color: var(--akz-offen); font-weight: 700; }
.verlauf li.a-plan .v-text { color: var(--akz-arbeit); font-weight: 600; }
.td-form { border-top: 1px solid var(--linie); margin-top: .4rem; padding-top: .9rem; }
.td-form p { margin-bottom: .7rem; }
.td-senden { display: flex; justify-content: flex-end; gap: .6rem; }
.td-warte { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--ton-arbeit); color: var(--akz-arbeit); border-radius: 10px; padding: .6rem .8rem; margin-top: .8rem; font-size: .95rem; }
.td-warte-knoepfe { display: flex; align-items: center; gap: .8rem; }

/* ---------- Übersicht (Admin) */
.raster2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
table.liste { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.liste th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); padding: .4rem .5rem; border-bottom: 2px solid var(--linie); }
table.liste td { padding: .45rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
table.liste td.z, table.liste th.z { text-align: right; font-variant-numeric: tabular-nums; }
table.liste tr.klick { cursor: pointer; }
table.liste tr.klick:hover td { background: var(--flaeche-2); }
.balken { height: 10px; background: var(--flaeche-2); border-radius: 5px; overflow: hidden; min-width: 60px; }
.balken > div { height: 100%; background: var(--primaer); border-radius: 5px; }
.balken.gestapelt { display: flex; }
.balken.gestapelt > div { border-radius: 0; }
.balken .ba { background: var(--a); } .balken .bc { background: #9aa3ae; }
.tabellen-scroll { overflow-x: auto; }
.legende { display: flex; gap: 1rem; font-size: .82rem; color: var(--text-2); margin-bottom: .5rem; }
.legende span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legende .la::before { background: var(--a); } .legende .lc::before { background: #9aa3ae; }

/* ---------- Auswertung (Admin) */
.ausw-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.ausw-kopf h1 { margin: 0; }
.ausw-kopf .segment button { font-size: .88rem; padding: .4rem .75rem; }
.ausw-hinweis { background: #fff8e1; border: 1px solid #f0d58a; border-left: 6px solid #d99a00; border-radius: 12px; padding: .8rem 1rem .4rem; margin-bottom: 1rem; color: #4a3a00; font-size: .92rem; }
.ausw-hinweis ul { margin: .4rem 0 .5rem; padding-left: 1.2rem; }
.ausw-hinweis li { margin-bottom: .3rem; }
.ausw-hinweis-klein { background: #fff8e1; border-radius: 8px; padding: .45rem .7rem; font-size: .88rem; color: #4a3a00; }
.ausw-raster > *, .ausw-personen .raster2 > * { min-width: 0; }
.ausw-personen .raster2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.ausw-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 1rem; align-items: start; }
.ausw-kz { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ausw-kz .kz { cursor: default; border-top-color: var(--primaer); }
.kz-zusatz { font-size: .74rem; color: var(--text-2); margin-top: .2rem; }
.ausw-h3 { font-size: .95rem; margin: 1.1rem 0 .4rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.ausw-liste { margin: 0; padding-left: 1.1rem; font-size: .92rem; }
.ausw-liste li { margin-bottom: .35rem; }
.ab-balken { height: 10px; min-width: 70px; background: var(--flaeche-2); border-radius: 4px; }
.ab-balken > div { height: 100%; background: var(--primaer); border-radius: 4px; }
.saeulen { display: flex; align-items: stretch; gap: 4px; height: 200px; padding-top: 1.3rem; }
.saeulen-achse { display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--text-2); padding-bottom: 1.3rem; min-width: 1.4rem; text-align: right; }
.saeule { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; cursor: default; }
.saeule-feld { flex: 1; width: 100%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--linie); }
.saeule-wert { position: relative; width: 100%; max-width: 34px; margin: 0 auto; background: var(--primaer); border-radius: 4px 4px 0 0; min-height: 0; }
.saeule-zahl { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding-bottom: 2px; font-size: .78rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.saeule:hover .saeule-wert { background: var(--primaer-hover); }
.saeule span { font-size: .66rem; color: var(--text-2); margin-top: .25rem; white-space: nowrap; overflow: hidden; max-width: 100%; }
.ausw-personen summary { display: flex; align-items: baseline; gap: .6rem; cursor: pointer; list-style: none; }
.ausw-personen summary::-webkit-details-marker { display: none; }
.ausw-personen summary h2 { margin: 0; }
.ausw-personen summary::before { content: "▸"; color: var(--primaer); }
.ausw-personen[open] summary::before { content: "▾"; }

/* Auswertung: Zeitkennzahlen mit Verlauf */
.ausw-breit { grid-column: 1 / -1; }
.ausw-breit .vl-svg { max-width: 900px; }
.ausw-zeiten { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.kz.kz-klick { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.kz.kz-klick:hover { border-color: var(--primaer); }
.kz.kz-klick.aktiv { outline: 3px solid var(--primaer); outline-offset: -1px; background: var(--primaer-hell); }
.kz-verlauf { margin-top: .4rem; font-size: .8rem; font-weight: 700; color: var(--primaer); }
.vl-panel { border: 1px solid var(--linie); border-radius: 12px; padding: .8rem .9rem; margin: .2rem 0 .8rem; background: var(--flaeche-2); }
.vl-kopf { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.vl-kopf h3 { margin: 0; font-size: 1rem; }
.vl-kopf .segment button { font-size: .82rem; padding: .3rem .6rem; }
.vl-vergleich { margin: .6rem 0 .3rem; font-size: .95rem; }
.vl-trend { font-weight: 800; padding: .05rem .45rem; border-radius: 6px; }
.vl-trend.besser { background: #e2f4e8; color: #1e6b34; }
.vl-trend.schlechter { background: #fde8e8; color: #b71c1c; }
.vl-trend.gleich { background: #eceff3; color: #45505c; }
.vl-einheit { font-size: .78rem; color: var(--text-2); margin-bottom: .2rem; }
.vl-svg { width: 100%; height: auto; display: block; background: var(--flaeche); border-radius: 8px; }
.vl-gitter { stroke: #ece6de; stroke-width: 1; }
.vl-achse { fill: #6a5f56; font-size: 11px; font-family: inherit; }
.vl-linie { fill: none; stroke: #6b3410; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vl-wert { fill: #2a211b; font-size: 11.5px; font-weight: 700; font-family: inherit; }
.vl-marke { fill: #6b3410; stroke: #fff; stroke-width: 2; }
.vl-treffer { fill: transparent; cursor: default; }
.vl-punkt:hover .vl-marke { r: 6; }
.vl-tabelle summary { cursor: pointer; font-size: .85rem; color: var(--primaer); margin-top: .3rem; }

/* ---------- Verwaltung */
.unterreiter { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 2px solid var(--linie); margin-bottom: 1rem; }
.unterreiter a { padding: .55rem .9rem; text-decoration: none; color: var(--text-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.unterreiter a.aktiv { color: var(--primaer); border-bottom-color: var(--primaer); }
.inaktiv td { color: var(--text-2); text-decoration: line-through; }
.inaktiv td:last-child { text-decoration: none; }
.mail-text { white-space: pre-wrap; font-size: .85rem; background: var(--flaeche-2); padding: .6rem; border-radius: 8px; margin: .4rem 0 0; }

/* Profile der Büro-/Admin-Zugänge */
.profil { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.profil-verkauf, .profil-backstube, .profil-fuhrpark { background: var(--ton-wartet); color: var(--akz-wartet); }
.profil-buero, .profil-admin, .profil-beides { background: var(--primaer-hell); color: var(--primaer); }
.bn-filter { display: grid; gap: .6rem; margin: .4rem 0 .8rem; }
.bn-profile { display: flex; flex-wrap: wrap; gap: .4rem; }
.bn-profile button { border: 1px solid #cfc5b9; background: var(--flaeche); border-radius: 999px; padding: .3rem .75rem; font: inherit; font-size: .9rem; cursor: pointer; }
.bn-profile button b { font-weight: 700; color: var(--text-2); margin-left: .15rem; }
.bn-profile button.aktiv { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.bn-profile button.aktiv b { color: #fff; }
.bn-inaktive { font-size: .9rem; color: var(--text-2); display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.bn-mail { display: block; color: var(--text-2); font-size: .8rem; }
.profil-wahl { border: 0; padding: 0; margin: 0 0 1rem; }
.profil-wahl label { display: flex; gap: .6rem; align-items: flex-start; border: 2px solid var(--linie); border-radius: 10px; padding: .55rem .75rem; margin-bottom: .45rem; cursor: pointer; }
.profil-wahl label:has(input:checked) { border-color: var(--primaer); background: var(--primaer-hell); }
.profil-wahl input { margin-top: .25rem; accent-color: var(--primaer); }
.profil-wahl small { display: block; color: var(--text-2); }
.profil-info { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: 0 0 .3rem; }
.profil-info dt { color: var(--text-2); }
.profil-info dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.profil-info-hinweis { margin-bottom: 1.2rem; }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.karte-kopf h2 { margin: 0; }
label.feld.check { display: flex; gap: .6rem; align-items: flex-start; border: 2px solid var(--linie); border-radius: 10px; padding: .55rem .75rem; margin-bottom: .6rem; cursor: pointer; }
label.feld.check:has(input:checked) { border-color: var(--primaer); background: var(--primaer-hell); }
label.feld.check > span { font-weight: 400; margin: 0; }
label.feld.check small { display: block; color: var(--text-2); }
label.feld.check input { margin-top: .25rem; accent-color: var(--primaer); width: 18px; height: 18px; flex: none; }

/* ---------- Toasts */
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: .5rem; width: min(92vw, 460px); }
.toast { background: #2a211b; color: #fff; padding: .75rem 1rem; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-weight: 500; animation: rein .2s ease-out; }
.toast.fehler { background: var(--a); }
@keyframes rein { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 640px) {
  .kopf { gap: .5rem; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
  main { padding: 1rem .75rem 4rem; }
  .karte { padding: 1rem; }
}
@media print {
  .kopf, .filterleiste, .alarmleiste, .knopf { display: none !important; }
  body, main { background: #fff; }
}
.tzeile .standmarke { white-space: normal; line-height: 1.25; padding: .22rem .6rem; }
@media (max-width: 640px) {
  .kennzahlen { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
  .kz { padding: .5rem .55rem; border-top-width: 3px; }
  .kz .wert { font-size: 1.3rem; }
  .kz .titel { font-size: .72rem; line-height: 1.2; }
}
