/* ============================================================
   Wochenplaner Prototyp — Graf Hauswartungen
   Brand: Blau #69b1e2 / #3f6a88 / #203544, Grün #96c11f
   Ruhig, hell, frisch. Keine Muster-Hintergründe.
   ============================================================ */

:root {
  /* --- Light surfaces + brand ------------------------------------------- */
  --bg: #F2F6F9;
  --card: #FFFFFF;
  --ink: #203544;
  --ink-soft: #5E7385;
  --line: #DCE5EC;
  --line-strong: #C3D2DD;
  --blue: #69B1E2;
  --blue-deep: #3F6A88;
  --blue-tint: #D2E8F6;
  --green: #96C11F;
  --green-dark: #5A7413;
  --green-tint: #DFECBC;

  /* --- Dark surfaces (SideNav, Detail-Panel, Phone-Kopf, Toast) --------- */
  --ink-2: #24394B;             /* Verlauf oben */
  --ink-3: #182833;             /* Verlauf unten */
  --ink-4: #16232E;             /* tiefster Ton (Brand-Mark) */
  --on-dark: #EDF3F7;           /* Primärtext auf dunkel */
  --on-dark-dim: #9FB4C2;       /* Sekundärtext auf dunkel */
  --on-dark-mute: #718799;      /* Tertiärtext */
  --on-dark-rail: #93A8B8;      /* Idle-Nav */
  --on-dark-label: #647A8B;     /* Gruppen-Labels */
  --on-dark-faint: #536775;     /* Fusszeilen-Credit */
  --surface-dark: #2A4255;      /* dunkle Buttons (da-btn) */
  --surface-dark-hover: #31506A;
  --border-dark: #3A5366;
  --divider-dark: #35495A;

  /* --- Semantische Farben ----------------------------------------------- */
  --danger: #C0392B;
  --danger-tint: #FBE3D4;
  --danger-tint-soft: #FCEFE3;
  --danger-border-dark: #6E4A4A;
  --warn-ink: #A8541E;
  --warn-tag-bg: #FBE9CF;
  --warn-tag-ink: #A96A12;
  --warn-accent: #E8A33D;

  /* --- Typo-Skala (Basis 15px) ------------------------------------------ */
  --fs-2xs: .625rem;    /*  ~9px  — Micro-Labels, Ticks, Kicker */
  --fs-xs:  .6875rem;   /* ~10px  — kleine Labels, Meta */
  --fs-sm:  .75rem;     /* ~11px  — Captions, Sekundärtext */
  --fs-md:  .8125rem;   /* ~12px  — Standard-UI, Buttons */
  --fs-base: .875rem;   /* ~13px  — Fliesstext, Tabellen */
  --fs-lg:  .9375rem;   /* ~14px  — kleine Titel */
  --fs-xl:  1rem;       /*  15px  — Karten-Titel */
  --fs-2xl: 1.15rem;    /* ~17px  — grosse Zahlen */
  --fs-3xl: 1.3125rem;  /* ~20px  — Section-Titel */
  --fs-4xl: 1.5rem;     /* ~22px  — View-Titel */
  --fs-5xl: 1.75rem;    /* ~26px  — Panel-Titel */
  --fs-6xl: 2.125rem;   /* ~32px  — Hero */

  /* --- Radius ------------------------------------------------------------ */
  --radius-xs: 4px;
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* --- Control-Höhen (Buttons/Inputs) ----------------------------------- */
  --ctl-h-sm: 32px;
  --ctl-h-md: 38px;
  --ctl-h-lg: 42px;

  /* --- Spacing-Skala (4px-Raster) --------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --gutter: 28px;                        /* horizontaler Seiten-Rand app-weit */
  --view-pad: 18px var(--gutter) 26px;   /* einheitlicher Inhalts-Rahmen je Ansicht */

  --slot-h: 30px;
  --shadow: 0 1px 2px rgba(32, 53, 68, .06), 0 8px 24px rgba(32, 53, 68, .07);
  font-size: 15px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Albert Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, .display {
  font-family: "Bricolage Grotesque", sans-serif;
  letter-spacing: -0.015em;
}

/* ---------------------------------------------------- App-Shell + SideNav */

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

/* Dunkle Betriebs-Leiste — nutzt Brand-Ink, rhymt mit dem Detail-Panel */
.sidenav {
  --rail-idle: #93A8B8;
  flex: none;
  width: 236px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  background: linear-gradient(200deg, var(--ink-2) 0%, var(--ink) 55%, var(--ink-3) 100%);
  color: var(--on-dark);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
  z-index: 50;
}

.sidenav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 20px;
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 65%, var(--ink-4) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800; font-size: var(--fs-3xl);
  flex: none; position: relative; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.brand-mark::after {
  content: "";
  position: absolute; right: -7px; bottom: -7px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-org {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800; font-size: var(--fs-xl);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-app {
  font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--rail-idle); margin-top: 3px;
}

.nav-scroll { flex: 1; overflow-y: auto; padding: 6px 12px; }
.nav-group { margin-top: 16px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group-label {
  display: block;
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--on-dark-label); padding: 0 12px 8px;
}
.nav-item {
  position: relative;
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px;
  background: transparent; border: none;
  border-radius: var(--radius-md); cursor: pointer;
  font-family: inherit; font-size: var(--fs-lg); font-weight: 600;
  color: var(--rail-idle);
  text-align: left;
  transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: var(--on-dark); }
.nav-ico { width: 20px; height: 20px; flex: none; opacity: .8; }
.nav-item.active { background: rgba(150,193,31,.15); color: #fff; }
.nav-item.active .nav-ico { opacity: 1; color: var(--green); }
.nav-item.active::before {
  content: "";
  position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--green);
}
.nav-item:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.sidenav-foot {
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: var(--fs-xs); line-height: 1.5;
}
.foot-data { color: var(--on-dark-mute); letter-spacing: .02em; }
.foot-credit { color: var(--on-dark-faint); margin-top: 4px; letter-spacing: .06em; }

/* Firma/Mandant-Umschalter in der SideNav (globaler Kontext) */
.sidenav-firma { padding: 12px 16px 4px; }
.sf-label {
  display: block; font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--on-dark-label); padding: 0 2px 7px;
}
.firma-switch {
  display: flex; gap: 3px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md); padding: 3px;
}
.firma-switch button {
  flex: 1; font: inherit; font-size: var(--fs-sm); font-weight: 600;
  padding: 6px 3px; cursor: pointer; border: none; background: transparent;
  color: var(--rail-idle); border-radius: var(--radius-sm); white-space: nowrap;
  transition: background .14s, color .14s;
}
.firma-switch button:hover { color: var(--on-dark); }
.firma-switch button.active { background: var(--green); color: var(--ink-4); }
.firma-switch button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

.workspace {
  flex: 1;
  min-width: 0;
  background: linear-gradient(180deg, #EAF2F8 0%, var(--bg) 240px);
}

/* ---------------------------------------------------- Toolbar */

main { display: block; padding: 0 0 80px; }

.toolbar {
  --ctl-h: var(--ctl-h-lg);
  display: flex;
  align-items: center;
  gap: 12px 14px;
  padding: 16px var(--gutter) 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, #EAF2F8, var(--bg));
  box-shadow: 0 1px 0 var(--line);
  animation: rise .35s ease both;
}
.tb-time { display: flex; align-items: center; gap: 10px; }

/* Einheitliche Sekundär-Controls (Heute, Ansicht) — gleiche Höhe/Radius */
.tb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: var(--ctl-h); padding: 0 14px;
  font: inherit; font-size: var(--fs-md); font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  transition: border-color .12s, color .12s;
}
.tb-btn:hover { border-color: var(--blue); }
.tb-btn.has { border-color: var(--blue-deep); color: var(--blue-deep); }
.tb-btn .fb-ico { width: 16px; height: 16px; }
/* Aktions-Buttons in der Toolbar auf gleiche Höhe + Rechteck-Radius bringen */
.toolbar .btn-primary, .toolbar .btn-ghost, .toolbar .btn-reset {
  height: var(--ctl-h); display: inline-flex; align-items: center;
  padding: 0 16px; border-radius: var(--radius-sm);
}
.tb-pop-wrap { position: relative; }
.tb-pop-wrap .tb-pop { left: auto; right: 0; }
.fp-check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); font-weight: 600; color: var(--ink); cursor: pointer; }
.fp-check input { width: 16px; height: 16px; accent-color: var(--green); }
.tb-context {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-left: 16px; border-left: 1px solid var(--line);
}
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-legend {
  flex-basis: 100%;
  display: flex; gap: 16px; align-items: center;
  font-size: var(--fs-xs); color: var(--ink-soft);
  padding-top: 2px;
}
.tb-legend span { display: flex; align-items: center; gap: 6px; }
.tb-legend i { width: 12px; height: 12px; display: inline-block; border-radius: var(--radius-xs); }
.tb-legend .l-holiday {
  background: repeating-linear-gradient(-45deg, var(--blue-tint) 0 4px, #fff 4px 8px);
  border: 1px solid var(--blue);
}
.tb-legend .l-vacation {
  background: repeating-linear-gradient(-45deg, var(--green-tint) 0 4px, #fff 4px 8px);
  border: 1px solid var(--green);
}

.kw-stepper {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.kw-stepper button {
  width: 40px; height: 46px;
  background: transparent;
  border: none;
  font-size: var(--fs-2xl);
  cursor: pointer;
  color: var(--blue-deep);
  font-family: inherit;
  transition: background .12s;
}
.kw-stepper button:hover { background: var(--blue-tint); }
.kw-display {
  padding: 5px 18px;
  text-align: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 132px;
}
.kw-display .kw-num {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: var(--fs-3xl);
  line-height: 1.1;
}
.kw-display .kw-range { font-size: var(--fs-xs); color: var(--ink-soft); }

.kw-parity { font-weight: 700; color: var(--blue-deep); }
.kw-parity.gerade { color: var(--green-dark); }

.ma-select { display: flex; gap: 6px; flex-wrap: wrap; }
.ma-select button {
  font-family: inherit;
  font-weight: 600;
  font-size: var(--fs-md);
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .12s;
}
.ma-select button:hover { border-color: var(--blue); color: var(--ink); }
.ma-select button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.toggle-sa {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.toggle-sa .switch {
  width: 38px; height: 22px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
  position: relative;
  transition: background .15s;
}
.toggle-sa .switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(32,53,68,.25);
  transition: transform .15s ease;
}
.toggle-sa.on .switch { background: var(--green); }
.toggle-sa.on .switch::after { transform: translateX(16px); }

/* ---------------------------------------------------- Variante A: Wochenraster */

.week-grid-wrap {
  padding: var(--view-pad);
  overflow-x: auto;
  animation: rise .4s .05s ease both;
}

.week-grid {
  display: grid;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 900px;
  overflow: hidden;
}

.wg-corner, .wg-dayhead {
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 14px;
  background: var(--card);
}
.wg-dayhead { border-left: 1px solid var(--line); position: relative; }
.wg-dayhead .day-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: var(--fs-lg);
}
.wg-dayhead .day-date { font-size: var(--fs-sm); color: var(--ink-soft); }
.wg-dayhead .holiday-tag {
  position: absolute;
  top: 12px; right: 10px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--blue-deep);
  background: var(--blue-tint);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
}

.wg-timecol {
  display: grid;
  border-right: 1px solid var(--line-strong);
  background: var(--card);
}
.wg-time {
  height: var(--slot-h);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  padding: 2px 10px 0 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wg-time.hour { color: var(--ink); font-weight: 600; }

.wg-daycol {
  position: relative;
  border-left: 1px solid var(--line);
  /* nur Stundenlinien, bewusst dezent */
  background:
    repeating-linear-gradient(to bottom,
      transparent 0,
      transparent calc(var(--slot-h) * 2 - 1px),
      var(--line) calc(var(--slot-h) * 2 - 1px),
      var(--line) calc(var(--slot-h) * 2));
}
.wg-daycol.is-holiday {
  background-image: repeating-linear-gradient(-45deg, rgba(105,177,226,.14) 0 8px, transparent 8px 16px);
}
.wg-daycol.is-vacation {
  background-image: repeating-linear-gradient(-45deg, rgba(150,193,31,.16) 0 8px, transparent 8px 16px);
}
.col-overlay-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3em;
  font-size: var(--fs-lg);
  color: var(--blue-deep);
  opacity: .5;
  pointer-events: none;
}
.is-vacation .col-overlay-label { color: var(--green-dark); }

.appt {
  position: absolute;
  left: 5px; right: 5px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--c, var(--blue-deep));
  background: color-mix(in srgb, var(--c, #999) 16%, #fff);
  padding: 5px 8px 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.appt:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(32,53,68,.18);
  z-index: 5;
}
.appt .a-time {
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.appt .a-name {
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.appt .a-meta {
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* 30-Min-Blöcke: nur Name zeigen, Rest würde überlaufen */
.appt.tiny { padding-top: 3px; }
.appt.tiny .a-time, .appt.tiny .a-meta, .appt.tiny .a-badge { display: none; }
.appt.tiny .a-name { font-size: var(--fs-xs); }

.appt .a-badge {
  display: inline-block;
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--green-tint);
  color: var(--green-dark);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  margin-top: 2px;
}

.unplanned-tray {
  margin: 0 28px 28px;
  border: 1.5px dashed var(--blue);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--blue-tint) 40%, #fff);
}
.unplanned-tray .tray-label {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--blue-deep);
  margin-right: 10px;
}
.unplanned-tray .appt { position: static; width: 220px; }

/* ---------------------------------------------------- Variante B: Mobile Agenda */

.mobile-stage {
  display: flex;
  gap: 60px;
  justify-content: center;
  align-items: flex-start;
  padding: 46px var(--gutter);
  flex-wrap: wrap;
  animation: rise .4s .05s ease both;
}

.phone {
  width: 392px;
  border: 10px solid var(--ink);
  border-radius: 44px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(32,53,68,.22);
  overflow: hidden;
  flex: none;
}
.phone-notch {
  height: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
}
.phone-notch::after {
  content: "";
  width: 100px; height: 8px;
  background: var(--ink);
  border-radius: var(--radius-pill);
}
.phone-screen {
  height: 700px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.m-head {
  padding: 14px 20px 12px;
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.m-head .m-greeting {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--blue);
}
.m-head h2 {
  font-size: var(--fs-4xl);
  font-weight: 800;
}
.m-head .m-kw { font-size: var(--fs-sm); color: var(--on-dark-dim); margin-top: 2px; }

.day-chips {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--ink);
  position: sticky;
  top: 84px;
  z-index: 2;
  border-radius: 0 0 20px 20px;
}
.day-chips button {
  flex: 1;
  border: none;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  padding: 8px 0 6px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  color: #C7D5DF;
  transition: all .12s;
}
.day-chips button .c-day { display: block; font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; }
.day-chips button .c-date { display: block; font-size: var(--fs-base); font-weight: 600; font-variant-numeric: tabular-nums; }
.day-chips button.active { background: var(--green); color: #fff; }
.day-chips button.is-holiday:not(.active) { color: var(--blue); }

.m-list { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.m-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(32,53,68,.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise .3s ease both;
}
.m-card .mc-tap {
  display: grid;
  grid-template-columns: 88px 1fr;
  cursor: pointer;
}
.m-card.done { opacity: .82; }
.m-card.running { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-tint); }
.m-card:nth-child(2) { animation-delay: .05s; }
.m-card:nth-child(3) { animation-delay: .1s; }
.m-card:nth-child(4) { animation-delay: .15s; }
.m-card:nth-child(5) { animation-delay: .2s; }

.m-card .mc-time {
  background: var(--c-bg, var(--bg));
  border-left: 5px solid var(--c, var(--blue-deep));
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.m-card .mc-time .t-start {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: var(--fs-2xl);
  line-height: 1;
}
.m-card .mc-time .t-end { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: 3px; }
.m-card .mc-time .t-dur {
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--green-dark);
  margin-top: 6px;
  text-transform: uppercase;
}

.m-card .mc-body { padding: 12px 14px; }
.m-card .mc-body h3 { font-size: var(--fs-xl); font-weight: 700; }
.m-card .mc-addr { font-size: var(--fs-md); color: var(--ink-soft); margin-top: 2px; }
.mc-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.mc-tags span {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .03em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink-soft);
}
.mc-tags .tag-zutritt { background: var(--green-tint); color: var(--green-dark); }
.mc-tags .tag-fenster { background: var(--blue-tint); color: var(--blue-deep); }

.m-empty {
  text-align: center;
  padding: 60px 30px;
  color: var(--ink-soft);
}
.m-empty .e-big {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: var(--fs-5xl);
  color: var(--green-dark);
}
.m-empty.holiday .e-big { color: var(--blue-deep); }

.m-foot { flex: none; background: #fff; }
.m-summary {
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-md);
  font-weight: 600;
  background: #fff;
}
.m-summary b { font-variant-numeric: tabular-nums; color: var(--green-dark); }
/* Arbeitszeit-Stempel des Tages — dunkler Streifen, klar getrennt vom Auftrags-Rapport */
.m-arbeitszeit {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; background: var(--ink); color: var(--on-dark); font-size: var(--fs-sm);
}
.az-l { text-transform: uppercase; letter-spacing: .08em; font-size: var(--fs-2xs); font-weight: 700; color: var(--blue); }
.az-v { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.az-fahr { margin-left: auto; color: var(--on-dark-dim); white-space: nowrap; }

/* Check-in/out je Einsatz (Zeiterfassung) */
.mc-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px 9px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.mc-track.running { background: var(--green-tint); }
.mc-track.done { background: var(--bg); }
.mc-track .trk-state { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.mc-track .trk-state small { font-weight: 600; color: var(--ink-soft); }
.mc-track.running .trk-state { color: var(--green-dark); }
.ci-btn {
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--fs-md);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: filter .12s;
}
.ci-btn:hover { filter: brightness(.95); }
.ci-btn.in { background: var(--green); color: #fff; width: 100%; }
.ci-btn.out { background: var(--blue-deep); color: #fff; }
.ci-btn.undo { background: transparent; color: var(--ink-soft); padding: 6px 10px; font-size: var(--fs-xl); }

/* Sperrbildschirm (Login-Demo) */
.phone-screen.locked { background: var(--ink); justify-content: center; }
.lock-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 32px;
  gap: 14px;
}
.lock-logo {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: var(--fs-4xl);
  letter-spacing: -.01em;
}
.lock-logo span { color: var(--green); margin-left: 6px; }
.lock-ma { font-size: var(--fs-lg); color: var(--on-dark-dim); font-weight: 600; }
.lock-fp {
  width: 78px; height: 78px;
  display: grid; place-items: center;
  font-size: var(--fs-6xl);
  border-radius: 50%;
  background: rgba(150,193,31,.16);
  border: 2px solid var(--green);
  margin: 8px 0;
}
.lock-btn {
  border: none;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--fs-lg);
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.lock-btn:disabled { opacity: .7; cursor: default; }
.lock-note { font-size: var(--fs-sm); color: var(--on-dark-dim); line-height: 1.5; margin-top: 4px; }
.m-lock {
  border: none; background: rgba(255,255,255,.12);
  color: #fff; cursor: pointer;
  border-radius: var(--radius-md); padding: 2px 8px; font-size: var(--fs-base);
  margin-left: 8px; vertical-align: middle;
}

/* Check-in-Methodenwahl (QR / NFC / manuell) im Modal */
.ci-method { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.ci-method-btn {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); background: #fff;
  font-family: inherit; font-weight: 600; font-size: var(--fs-lg);
  padding: 13px 16px; border-radius: var(--radius);
  cursor: pointer; text-align: left; transition: all .12s;
}
.ci-method-btn:hover { border-color: var(--green); background: var(--green-tint); }
.ci-method-btn.ghost { color: var(--ink-soft); }
.ci-method-btn .cm-ico { font-size: var(--fs-2xl); width: 24px; text-align: center; }
.ci-method-btn small { color: var(--ink-soft); font-weight: 500; }
.ci-hint { font-size: var(--fs-md); color: var(--ink-soft); line-height: 1.5; margin-top: 10px; }

.mobile-aside { max-width: 330px; padding-top: 30px; }
.mobile-aside h2 {
  font-size: var(--fs-6xl);
  font-weight: 800;
  line-height: 1.02;
}
.mobile-aside h2 em { color: var(--blue-deep); font-style: normal; }
.mobile-aside p { margin-top: 16px; font-size: var(--fs-lg); line-height: 1.55; color: var(--ink-soft); }
.mobile-aside ul { margin: 14px 0 0 18px; font-size: var(--fs-base); line-height: 1.7; color: var(--ink-soft); }
.mobile-aside li::marker { color: var(--green); }

/* ---------------------------------------------------- Variante C: Team */

.team-wrap { padding: var(--view-pad); animation: rise .4s .05s ease both; }

.team-grid {
  display: grid;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 980px;
  overflow: hidden;
}
.tg-corner, .tg-mahead {
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 14px;
}
.tg-mahead { border-left: 1px solid var(--line); }
.tg-mahead .ma-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: var(--fs-lg);
}
.tg-mahead .ma-load { font-size: var(--fs-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tg-mahead .load-bar {
  height: 6px;
  background: var(--bg);
  border-radius: var(--radius-pill);
  margin-top: 6px;
  position: relative;
  overflow: hidden;
}
.tg-mahead .load-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: var(--radius-pill);
  width: var(--w, 0%);
}

.tg-macol {
  position: relative;
  border-left: 1px solid var(--line);
  background:
    repeating-linear-gradient(to bottom,
      transparent 0,
      transparent calc(var(--slot-h) * 2 - 1px),
      var(--line) calc(var(--slot-h) * 2 - 1px),
      var(--line) calc(var(--slot-h) * 2));
}
.tg-macol.is-vacation {
  background-image: repeating-linear-gradient(-45deg, rgba(150,193,31,.16) 0 8px, transparent 8px 16px);
}
.tg-macol.is-holiday {
  background-image: repeating-linear-gradient(-45deg, rgba(105,177,226,.14) 0 8px, transparent 8px 16px);
}

.week-mini {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
}
.week-mini button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-pill);
  font-family: inherit;
  padding: 8px 16px;
  cursor: pointer;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-soft);
  transition: all .12s;
}
.week-mini button:hover { border-color: var(--blue); color: var(--ink); }
.week-mini button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.week-mini button.is-holiday { border-color: var(--blue); color: var(--blue-deep); }
.week-mini button.active.is-holiday { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }

/* ---------------------------------------------------- Detail-Panel */

.detail-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 360px;
  z-index: 100;
  display: flex;
}
.detail-panel[hidden] { display: none; }
.detail-inner {
  background: var(--ink);
  color: var(--on-dark);
  flex: 1;
  padding: 34px 30px;
  border-radius: 22px 0 0 22px;
  box-shadow: -10px 0 40px rgba(32,53,68,.35);
  animation: slide-in .22s ease both;
  overflow-y: auto;
}
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }

.detail-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none;
  border: none;
  color: var(--on-dark);
  font-size: var(--fs-5xl);
  cursor: pointer;
  line-height: 1;
}
.detail-kicker {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--blue);
}
.detail-inner h2 {
  font-size: var(--fs-5xl);
  font-weight: 800;
  margin: 6px 0 4px;
}
.detail-color-strip {
  height: 6px;
  border-radius: var(--radius-pill);
  margin: 14px 0 20px;
  background: var(--c, var(--green));
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider-dark);
  font-size: var(--fs-base);
}
.detail-row dt { color: var(--on-dark-dim); flex: none; }
.detail-row dd { text-align: right; font-weight: 600; }
.detail-foot { margin-top: 22px; font-size: var(--fs-sm); color: #7E94A5; line-height: 1.5; }

.detail-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.da-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: var(--fs-base);
  text-align: left;
  border: 1px solid var(--border-dark);
  background: var(--surface-dark);
  color: var(--on-dark);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  cursor: pointer;
  transition: all .12s;
}
.da-btn:hover { border-color: var(--blue); background: var(--surface-dark-hover); }
.da-btn small { display: block; font-weight: 500; font-size: var(--fs-xs); color: var(--on-dark-dim); }
.da-btn.danger { border-color: var(--danger-border-dark); }
.da-btn.danger:hover { border-color: var(--danger); background: #4A3340; }

/* -------------------------------- Zusatzaufträge / Aufgaben (im Detail-Panel) */
.aufg-box {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--divider-dark);
}
.aufg-title {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--on-dark-label);
  margin-bottom: 12px;
}
.aufg-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aufg-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 10px;
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
}
.aufg-typ {
  flex: none;
  white-space: nowrap;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(105, 177, 226, .13);
  border-radius: var(--radius-xs);
  padding: 3px 7px;
}
.aufg-t {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-base);
  color: var(--on-dark);
  line-height: 1.35;
}
.aufg-t b { color: var(--green); font-weight: 700; }
.aufg-rm {
  flex: none;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none;
  color: var(--on-dark-mute);
  font-size: var(--fs-3xl); line-height: 1;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: color .12s, background .12s;
}
.aufg-rm:hover { color: var(--danger); background: rgba(192, 57, 43, .15); }
.aufg-empty {
  color: var(--on-dark-mute);
  font-size: var(--fs-base);
  font-style: italic;
  padding: 2px 0;
}
.aufg-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.aufg-newtyp,
.aufg-newtitel {
  height: var(--ctl-h-md);
  font: inherit;
  font-size: var(--fs-md);
  color: var(--on-dark);
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  min-width: 0;
  transition: border-color .12s, background .12s;
}
.aufg-newtyp {
  grid-column: 1 / -1;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239FB4C2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.aufg-newtyp option { color: var(--ink); }
.aufg-newtitel { grid-column: 1; }
.aufg-newtitel::placeholder { color: var(--on-dark-mute); }
.aufg-newtyp:hover,
.aufg-newtitel:hover { border-color: var(--on-dark-mute); }
.aufg-newtyp:focus,
.aufg-newtitel:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface-dark-hover);
}
.aufg-addbtn {
  grid-column: 2;
  height: var(--ctl-h-md);
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  font-size: var(--fs-md);
  white-space: nowrap;
  color: var(--ink-4);
  background: var(--green);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter .12s;
}
.aufg-addbtn:hover { filter: brightness(1.06); }
.aufg-addbtn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------------------------------------------------- Sonstiges */

.colophon {
  border-top: 1px solid var(--line);
  padding: 14px var(--gutter);
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  letter-spacing: .02em;
  color: var(--ink-soft);
  background: var(--card);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------- Buttons */

.btn-primary, .btn-ghost, .btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--ctl-h-md);
  padding: 0 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .12s;
}
.btn-primary {
  background: var(--green);
  border: 1px solid var(--green);
  color: #fff;
}
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-ghost {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--blue-deep);
}
.btn-ghost:hover { border-color: var(--blue); }
.btn-reset {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--ink-soft);
  font-weight: 600;
}
.btn-reset:hover { border-color: var(--ink-soft); color: var(--ink); }

.hint-line {
  padding: 0 var(--gutter) 8px;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.team-wrap .hint-line { padding: 10px 0 0; }

.view-title {
  font-size: var(--fs-4xl);
  font-weight: 800;
}
.count-pill {
  font-size: var(--fs-sm);
  font-weight: 700;
  background: var(--blue-tint);
  color: var(--blue-deep);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
}

/* ---------------------------------------------------- Abgesagte Termine */

.appt.cancelled {
  border-left-color: var(--line-strong);
  background: repeating-linear-gradient(-45deg, #F4F1EA 0 6px, #fff 6px 12px);
  color: var(--ink-soft);
  cursor: pointer;
}
.appt.cancelled .a-name { text-decoration: line-through; font-weight: 600; }
.appt.cancelled .a-meta { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; }

/* ---------------------------------------------------- Drag & Drop */

.appt { touch-action: none; }
.drag-ghost {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  opacity: .9;
  box-shadow: 0 14px 34px rgba(32,53,68,.3);
  transform: rotate(1.5deg);
}
.drag-source { opacity: .35; }
.drop-hover {
  outline: 2px dashed var(--green);
  outline-offset: -2px;
  background-color: color-mix(in srgb, var(--green-tint) 40%, transparent) !important;
}

/* ---------------------------------------------------- Scope-Popover */

.scope-popover {
  position: fixed;
  z-index: 400;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(32,53,68,.28);
  padding: 14px;
  width: 270px;
  animation: rise .15s ease both;
}
.scope-popover .sp-title { font-weight: 800; font-size: var(--fs-lg); }
.scope-popover .sp-sub { font-size: var(--fs-sm); color: var(--ink-soft); margin: 2px 0 12px; }
.scope-popover button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--fs-base);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 6px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  transition: all .12s;
}
.scope-popover button small { display: block; font-weight: 500; font-size: var(--fs-xs); color: var(--ink-soft); }
.scope-popover .sp-week { border-color: var(--blue); }
.scope-popover .sp-week:hover { background: var(--blue-tint); }
.scope-popover .sp-rule { border-color: var(--green); }
.scope-popover .sp-rule:hover { background: var(--green-tint); }
.scope-popover .sp-cancel { border: none; color: var(--ink-soft); font-weight: 600; text-align: center; }

/* ---------------------------------------------------- Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(32,53,68,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade .15s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(32,53,68,.35);
  padding: 28px 30px;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  animation: rise .2s ease both;
}
.modal h3 { font-size: var(--fs-3xl); font-weight: 800; margin-bottom: 4px; }
.modal .modal-sub { font-size: var(--fs-md); color: var(--ink-soft); margin-bottom: 6px; }
.modal h4.list-title {
  font-size: var(--fs-md);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  margin: 18px 0 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 16px;
}
.form-grid .span2 { grid-column: span 2; }
.form-grid label.hidden { display: none; }

.modal label, .customer-form-wrap label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-soft);
}
.modal label small, .customer-form-wrap label small { font-weight: 500; }
.modal input, .modal select, .customer-form-wrap input {
  font-family: inherit;
  font-size: var(--fs-lg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: #fff;
  transition: border-color .12s;
}
.modal input:focus, .modal select:focus, .customer-form-wrap input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-tint);
}

.conflict-hint {
  min-height: 0;
  margin-top: 10px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--warn-ink);
  background: var(--danger-tint-soft);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  transition: all .15s;
}
.conflict-hint.show { padding: 9px 12px; max-height: 80px; }

.scope-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.scope-choice label {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.scope-choice label:has(input:checked) {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green-tint) 40%, #fff);
}
.scope-choice small { display: block; font-weight: 500; color: var(--ink-soft); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.vac-list { list-style: none; max-height: 180px; overflow-y: auto; }
.vac-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-md);
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}
.vac-list li.empty { color: var(--ink-soft); border: none; }
.vac-remove {
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: var(--fs-2xl);
  cursor: pointer;
  line-height: 1;
}
.vac-remove:hover { color: var(--danger); }

/* ---------------------------------------------------- Variante D: Kunden */

.customer-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  padding: var(--view-pad);
  align-items: start;
  animation: rise .4s .05s ease both;
}

.customer-table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.customer-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.customer-table th {
  text-align: left;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
}
.customer-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.customer-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.customer-table tbody tr { cursor: pointer; transition: background .1s; }
.customer-table tbody tr:hover { background: var(--bg); }
.customer-table tbody tr.selected { background: var(--blue-tint); }

.customer-form-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 84px;
}
.customer-form-wrap h3 { font-size: var(--fs-2xl); font-weight: 800; }
.form-placeholder {
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--fs-base);
  padding: 30px 10px;
  line-height: 1.6;
}

/* ---------------------------------------------------- Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 16px);
  z-index: 500;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-base);
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  box-shadow: 0 10px 30px rgba(32,53,68,.3);
  opacity: 0;
  transition: all .25s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidenav {
    position: sticky; top: 0;
    width: auto; height: auto;
    flex-direction: row; align-items: center;
    background: linear-gradient(90deg, var(--ink-2), var(--ink));
    border-right: none; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .sidenav-brand { padding: 12px 8px 12px 14px; }
  .brand-app { display: none; }
  .nav-scroll {
    flex: 1; display: flex; align-items: center;
    overflow-x: auto; overflow-y: hidden; padding: 8px 8px;
  }
  .nav-group { margin: 0; display: flex; align-items: center; }
  .nav-group:first-child { margin: 0; }
  .nav-group-label { display: none; }
  .nav-item { margin: 0 2px; white-space: nowrap; }
  .nav-item.active::before { display: none; }
  .sidenav-foot, .sidenav-firma { display: none; }
}

/* Mobile: Ansicht B ist auf echtem Handy die App selbst — Phone-Frame auspacken,
   Marketing-Aside + Planer-Toolbar raus, damit es sich wie das Tool anfühlt. */
@media (max-width: 640px) {
  [data-view="B"] .toolbar { display: none; }
  .mobile-stage { display: block; padding: 0; gap: 0; }
  .mobile-aside { display: none; }
  .phone {
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .phone-notch { display: none; }
  .phone-screen {
    height: auto;
    min-height: calc(100vh - 60px);   /* abzüglich Nav-Top-Bar */
  }
}

/* ============================================================
   Kundenfeedback 2026-07 — Etappe 1: Mandant, Kategorien,
   Filter, Auftragstyp, Notizfeld
   ============================================================ */

/* Firmen-Punkt in der MA-Auswahl */
.ma-select button { display: inline-flex; align-items: center; gap: 5px; }
.firma-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--f, var(--blue-deep)); flex: none;
}
/* Firmen-Badge in den Team-Köpfen (Ansicht C) */
.firma-badge {
  font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 1px 6px; border-radius: var(--radius-pill);
  color: #fff; background: var(--f, var(--blue-deep)); vertical-align: middle;
}

/* Kategorie-Punkt am Termin-Block */
.appt .kat-dot {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--k, var(--blue-deep));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}
.appt.tiny .kat-dot { top: 3px; right: 3px; width: 6px; height: 6px; }

/* Filter-Gruppe in der Toolbar */
.filter-group { display: flex; gap: 6px; align-items: center; }
.mini-select {
  font: inherit; font-size: var(--fs-md); color: var(--ink);
  padding: 5px 8px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--card); cursor: pointer;
}
.mini-select:focus { outline: none; border-color: var(--blue); }

/* Kontext-Kopf je Ansicht (was sehe ich?) */
.view-head { padding: 14px var(--gutter) 2px; animation: rise .3s ease both; }
.vh-kicker {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-soft);
}
.vh-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800; font-size: var(--fs-4xl); line-height: 1.1; margin-top: 3px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.vh-sub { font-size: var(--fs-md); color: var(--ink-soft); margin-top: 4px; }

/* Kompaktes Filter-Popover (Firma + Kategorie gebündelt) */
.filter-wrap { position: relative; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: var(--fs-md); font-weight: 600; color: var(--ink);
  height: var(--ctl-h, 42px); padding: 0 14px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); transition: border-color .12s, color .12s;
}
.filter-btn:hover { border-color: var(--blue); }
.filter-btn.has { border-color: var(--blue-deep); color: var(--blue-deep); }
.filter-btn .fb-ico { width: 16px; height: 16px; }
.filter-btn .fb-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: var(--radius-pill); background: var(--blue-deep); color: #fff;
  font-size: var(--fs-xs); font-weight: 700;
}
.filter-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; width: 232px;
  display: flex; flex-direction: column; gap: 12px;
  animation: rise .16s ease both;
}
.filter-pop[hidden] { display: none; }
.fp-row { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); }
.fp-row .mini-select { width: 100%; }
.filter-clear {
  font: inherit; font-size: var(--fs-md); font-weight: 600; cursor: pointer;
  padding: 7px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-soft);
}
.filter-clear:hover { border-color: var(--ink-soft); color: var(--ink); }

/* MA-Picker (Wochenplan): Personen-Icon + Dropdown gruppiert nach Firma — skaliert */
.ma-picker {
  display: inline-flex; align-items: center; gap: 8px;
  height: var(--ctl-h, 42px); padding: 0 12px 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--card);
}
.ma-picker:focus-within { border-color: var(--blue); }
.ma-picker-ico { width: 18px; height: 18px; color: var(--ink-soft); flex: none; }
.ma-picker-dd {
  font: inherit; font-size: var(--fs-base); font-weight: 600; color: var(--ink);
  border: none; background: transparent; cursor: pointer; min-width: 78px;
  padding: 0; height: 100%;
}
.ma-picker-dd:focus { outline: none; }

/* ---- Team-Board: Dispo-Zeitstrahl (Zeilen = MA, gemeinsame Zeitachse) ---- */
.board-wrap { padding: var(--view-pad); animation: rise .4s .05s ease both; }
.board-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.board-controls .week-mini { margin: 0; flex-wrap: wrap; }
.sort-ctl { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); }

.board { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.board-axis, .lane { display: grid; grid-template-columns: 190px 1fr; }
.board-axis { border-bottom: 1px solid var(--line-strong); background: var(--bg); }
.ba-head {
  padding: 8px 14px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-soft); border-right: 1px solid var(--line);
  display: flex; align-items: center;
}
.ba-scale { position: relative; height: 30px; }
.ba-tick {
  position: absolute; top: 8px; transform: translateX(-50%);
  font-size: var(--fs-2xs); color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.ba-tick:first-child { transform: translateX(0); }

.board-lanes { max-height: 64vh; overflow-y: auto; }
.lane { border-bottom: 1px solid var(--line); min-height: 48px; }
.lane:last-child { border-bottom: none; }
.lane:hover { background: color-mix(in srgb, var(--blue-tint) 22%, #fff); }
.lane-head {
  padding: 6px 14px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
}
.lane-name { font-weight: 700; font-size: var(--fs-md); display: flex; align-items: center; gap: 6px; }
.lane-load { display: flex; align-items: center; gap: 8px; }
.ll-h { font-size: var(--fs-xs); color: var(--ink-soft); font-variant-numeric: tabular-nums; min-width: 36px; }
.ll-h.over { color: var(--danger); font-weight: 700; }
.ll-bar { flex: 1; max-width: 96px; height: 5px; background: var(--bg); border-radius: var(--radius-pill); overflow: hidden; }
.ll-bar i { display: block; height: 100%; width: var(--w); background: var(--bc, var(--green)); border-radius: var(--radius-pill); }

.lane-track {
  position: relative;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
}
.lane-track.blocked {
  background: repeating-linear-gradient(-45deg, var(--bg) 0 6px, #fff 6px 12px);
}
.lane-track.drop-hover { outline: 2px dashed var(--blue); outline-offset: -2px; background-color: var(--blue-tint); }
.lane-appt {
  position: absolute; top: 5px; bottom: 5px; left: 0;
  border-radius: var(--radius-sm); border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 15%, #fff);
  padding: 3px 7px; overflow: hidden; cursor: grab;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  box-shadow: 0 1px 2px rgba(32,53,68,.08);
}
.lane-appt:hover { filter: brightness(.98); box-shadow: 0 2px 6px rgba(32,53,68,.16); }
.la-time { font-size: var(--fs-xs); font-weight: 700; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.la-title { font-size: var(--fs-xs); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.lane-note {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: var(--fs-sm); font-weight: 600;
}
.lane-note.free { color: var(--ink-soft); opacity: .6; }
.lane-note.blocked { color: var(--blue-deep); }
.drag-ghost { position: fixed; z-index: 200; pointer-events: none; opacity: .9; }

@media (max-width: 720px) {
  .board-axis, .lane { grid-template-columns: 120px 1fr; }
  .ll-bar { display: none; }
}

/* Auftragstyp-Umschalter (Serie / Einzelauftrag) */
.typ-row { display: flex; flex-direction: column; gap: 5px; }
.typ-label { font-size: var(--fs-md); font-weight: 600; color: var(--ink-soft); }
.segmented {
  display: inline-flex; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); overflow: hidden; width: fit-content;
}
.segmented label {
  display: inline-flex; align-items: center; gap: 4px; margin: 0;
  padding: 7px 14px; font-size: var(--fs-md); cursor: pointer;
  background: var(--card); color: var(--ink-soft);
  border-right: 1px solid var(--line);
}
.segmented label:last-child { border-right: none; }
.segmented label.on { background: var(--blue-deep); color: #fff; }
.segmented label small { color: inherit; opacity: .8; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }

/* Notiz-Textfeld im Auftrag */
.modal textarea.notiz-area {
  width: 100%; font: inherit; font-size: var(--fs-lg); color: var(--ink);
  padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--card);
  resize: vertical; min-height: 62px; line-height: 1.4;
}
.modal textarea.notiz-area:focus { outline: none; border-color: var(--blue); }

/* ============================================================
   Kundenfeedback 2026-07 — Etappe 2: Planer-Umschalter,
   Verschiebungs-Marker, Ferienausfall, Ansicht E
   ============================================================ */


/* Verschiebungs-/Änderungs-Marker am Block */
.appt .a-moved {
  position: absolute; top: 3px; right: 17px;
  font-size: var(--fs-sm); font-weight: 700; color: var(--blue-deep);
  background: rgba(255, 255, 255, .8); border-radius: var(--radius-xs); padding: 0 2px;
}
.appt.tiny .a-moved { display: none; }

/* Ausfall-Block (Ferien / Feiertag entfällt) — durchgestrichen */
.appt.ausfall {
  background: repeating-linear-gradient(45deg, #EEF3F7, #EEF3F7 6px, #E4EBF1 6px, #E4EBF1 12px);
  border: 1px dashed var(--line-strong); border-left: 4px dashed var(--line-strong);
  box-shadow: none; cursor: pointer; z-index: 2;
}
.appt.ausfall .a-name { text-decoration: line-through; color: var(--ink-soft); }
.appt.ausfall .a-meta {
  text-decoration: none; font-size: var(--fs-2xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--green-dark);
}

/* Ansicht E — Auswertung / Kontrolle */
.ausw-wrap { padding: var(--view-pad); }
.ausw-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.ausw-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.ausw-tabs button {
  font: inherit; font-size: var(--fs-base); font-weight: 600; padding: 7px 14px;
  border: none; background: transparent; color: var(--ink-soft);
  border-radius: var(--radius-sm); cursor: pointer;
}
.ausw-tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(32,53,68,.12); }
.ausw-body { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ausw-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.ausw-table th {
  text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.ausw-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ausw-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ausw-table tbody tr:hover { background: var(--bg); }
.ausw-table tfoot td { font-weight: 700; background: var(--bg); border-top: 2px solid var(--line-strong); }
.ausw-table .empty { text-align: center; color: var(--ink-soft); padding: 26px; }
.ausw-table .pos { color: var(--green-dark); }
.ausw-table .neg { color: var(--danger); }
.ausw-table .warn-num { color: var(--danger); font-weight: 700; }

/* Status-Pills + Aktions-Buttons in Ansicht E */
.st { font-size: var(--fs-sm); font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
.st.ok { background: var(--green-tint); color: var(--green-dark); }
.st.open { background: var(--blue-tint); color: var(--blue-deep); }
.st.warn { background: var(--danger-tint); color: var(--danger); }
.mini-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl-h-sm); padding: 0 14px; line-height: 1;
  font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
  border: 1px solid var(--green); background: var(--green); color: #fff; border-radius: var(--radius-sm);
}
.mini-btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.mini-btn.ghost { background: var(--card); color: var(--blue-deep); border-color: var(--line-strong); font-weight: 600; }
.mini-btn.ghost:hover { background: var(--card); border-color: var(--blue); }

/* Schnittstellen-Stubs (Ansicht E, Tab 4 — T46/T47) */
.stub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; padding: 16px; }
.stub-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px;
}
.stub-card.on { border-color: var(--green-dark); box-shadow: 0 0 0 1px var(--green-dark) inset; }
.stub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.stub-head h3 { margin: 0; font-size: var(--fs-xl); }
.stub-state { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.stub-state.ok { color: var(--green-dark); }
.stub-purpose { margin: 0; font-size: var(--fs-base); color: var(--ink); }
.stub-meta { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.stub-meta div { display: grid; grid-template-columns: 74px 1fr; gap: 8px; }
.stub-meta dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.stub-meta dd { margin: 0; font-size: var(--fs-md); color: var(--ink); }
.tag-research {
  display: inline-block; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .04em;
  padding: 1px 6px; border-radius: var(--radius-pill); background: var(--warn-tag-bg); color: var(--warn-tag-ink); vertical-align: middle;
}
.stub-toggle { margin-top: auto; align-self: flex-start; }
