:root {
  /* Offizielle CI-Farben Gemeinde Hemmingen / KiFaZ (Design-Spec 2024).
     Alte Variablennamen bleiben, sind aber neu belegt – so ziehen alle Regeln mit. */
  --yellow: #FFE000;   /* Anker */
  --orange: #F26522;   /* Begleit */
  --violet: #A64BC4;   /* Begleit (weiße Schrift ok) */
  --green:  #6FA82C;   /* Begleit */
  --yellow-soft: #FFF3B8;
  --orange-soft: #FBD9C4;
  --violet-soft: #E5D0EE;
  --green-soft:  #DDEBC6;

  --bg: #fdfbf3;
  --card: #ffffff;
  --panel: #fbfaf4;
  --ink: #1D1D1B;
  --muted: #55554f;
  --line: #e9e8df;
  --line-strong: #dad9cd;
  --accent: #F26522;        /* Akzent = Orange */
  --accent-ink: #b3431a;    /* dunkleres Orange für Text/Zahlen auf hell */
  --accent-bg: #FBE7DA;     /* helle Orange-Fläche */
  --warn: #A64BC4;          /* Violett = Unterbesetzung (Palette hat kein Rot) */
  --radius: 14px;
  --radius-sm: 9px;
  --grad-warm:  linear-gradient(120deg, #FFE000 0%, #F26522 100%);
  --grad-fresh: linear-gradient(120deg, #FFE000 0%, #6FA82C 100%);
  --font-head: 'Bebas Neue', 'Mulish', sans-serif;
  --font-body: 'Mulish', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  /* meshLight-Hintergrund laut Spec §7: heller Grund + weiche Gelb/Orange/Grün-Flächen. */
  background:
    radial-gradient(48% 40% at 100% 0%, rgba(242, 101, 34, 0.10), transparent 60%),
    radial-gradient(52% 44% at 0% 8%, rgba(255, 214, 8, 0.17), transparent 62%),
    radial-gradient(62% 55% at 50% 108%, rgba(111, 168, 44, 0.11), transparent 60%),
    #fdfbf3;
  background-attachment: fixed;
  line-height: 1.5;
}

/* Bebas Neue nur für echte Überschriften; kleine Labels bleiben Mulish. */
h1, h2, h3, .brand-title, .g-name { font-family: var(--font-head); letter-spacing: 0.02em; }

/* --- Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 22px;
  flex-wrap: wrap;
  padding: 12px 22px;
  color: var(--ink);
  /* meshLight-Kopfzeile (Gelb-Anker + weiche Orange/Grün-Flächen), wie im Mittagstool. */
  background:
    radial-gradient(72% 120% at 6% -10%, rgba(242, 101, 34, 0.40), transparent 55%),
    radial-gradient(66% 130% at 99% 118%, rgba(111, 168, 44, 0.34), transparent 55%),
    radial-gradient(55% 130% at 80% -25%, rgba(255, 255, 255, 0.55), transparent 60%),
    linear-gradient(112deg, #FFE95F 0%, #FFE000 55%, #FFD608 100%);
  box-shadow: inset 0 -1px 0 rgba(29, 29, 27, 0.12), 0 4px 16px rgba(242, 101, 34, 0.10);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }

.brand-mark {
  height: 34px; width: auto; flex: none; display: block;
  filter: drop-shadow(0 1px 1px rgba(29, 29, 27, 0.22));
}

.brand-title { font-size: 26px; font-weight: 400; letter-spacing: 0.045em; text-transform: uppercase; color: var(--ink); }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-sub { font-family: var(--font-body); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); opacity: 0.66; margin-top: 3px; }

/* --- Tabs --- */
.tabs { display: flex; gap: 4px; background: rgba(29, 29, 27, 0.08); padding: 4px; border-radius: 12px; flex-wrap: wrap; }

.tab {
  font-family: var(--font-head);
  text-transform: uppercase; letter-spacing: 0.03em;
  font-size: 16px; color: var(--ink);
  background: transparent; border: none; border-radius: 9px;
  padding: 7px 15px; cursor: pointer; opacity: .78;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, color .15s, opacity .15s;
}
.tab:hover { opacity: 1; background: rgba(29, 29, 27, 0.06); }
.tab.active {
  background: var(--ink);
  color: #fff; opacity: 1;
  box-shadow: 0 1px 3px rgba(29, 29, 27, 0.2);
}
.tab i { font-size: 13px; }

/* --- Layout --- */
main { max-width: 1140px; margin: 0 auto; padding: 22px; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* Wiederkehrender Verlaufs-Akzent (Spec §7): warmer Streifen oben an jeder Karte. */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-warm);
  border-radius: 16px 16px 0 0;
}

.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
h2 { font-size: 20px; margin: 0 0 2px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

.count-pill {
  font-size: 13px; font-weight: 700; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--yellow-soft), var(--orange-soft));
  padding: 4px 12px; border-radius: 20px;
}

.muted { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.placeholder { display: flex; align-items: center; gap: 8px; }

.mode-banner {
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(120deg, #fdf2dc, #f9e6c6);
  border: 1px solid #f0d59a; color: #855012;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 18px;
}
.mode-banner code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* --- Views --- */
.view { display: none; }
.view.active { display: block; }

/* --- Bereiche --- */
.bereich { margin-top: 20px; }
.bereich:first-child { margin-top: 10px; }

.bereich-title {
  font-size: 13px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px; padding-left: 2px;
}

/* Gruppen: große Boxen untereinander */
.group-grid { display: flex; flex-direction: column; gap: 16px; }

.group-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.group-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: #f4f4ef;
  background: linear-gradient(115deg,
    color-mix(in srgb, var(--gc) 30%, #fff) 0%,
    color-mix(in srgb, var(--gc) 9%, #fff) 60%,
    #ffffff 100%);
}
.g-dot {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  background: var(--gc, var(--accent));
  background: linear-gradient(135deg, var(--gc, var(--accent)), color-mix(in srgb, var(--gc) 55%, #000));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 22%, #fff);
}
.g-name {
  font-size: 18px; font-weight: 600; letter-spacing: 0.7px; text-transform: uppercase;
  color: #33332e;
  color: color-mix(in srgb, var(--gc) 55%, #23231f);
}
.g-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.warn { color: var(--warn); font-weight: 700; margin-left: 4px; }

/* Personen: Zeilen untereinander (tabellarisch) */
.persons { padding: 4px 18px 12px; }

.p-header-row,
.person {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}
.p-header-row { padding: 9px 6px 7px; }
.person:last-child { border-bottom: none; }
.person:hover { background: #faf9f4; }
.person.inactive { opacity: .5; }

.p-main { width: 194px; flex: none; }
.p-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.p-name { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.p-sub { margin-top: 3px; }

.qual {
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 8px; border-radius: 20px; color: var(--qc);
  background: color-mix(in srgb, var(--qc) 14%, white);
  border: 1px solid color-mix(in srgb, var(--qc) 32%, white);
}
.flag { font-size: 11px; color: #855012; background: #fbeed9; border-radius: 6px; padding: 1px 7px; }
.notiz { font-size: 11.5px; color: var(--muted); font-style: italic; line-height: 1.35; margin-top: 3px; }

.days { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dh { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--muted); }
.day {
  text-align: center; font-size: 12px; white-space: nowrap;
  background: #f6f6f2; border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 4px;
}
.day.off { background: transparent; border-style: dashed; color: #b6b6ad; }

.p-total {
  width: 96px; flex: none; text-align: right;
  font-size: 12.5px; color: var(--accent-ink); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px;
}
.p-total.head { color: var(--muted); font-size: 11px; letter-spacing: .4px; }
.p-total i { font-size: 11px; }

.empty { color: var(--muted); font-size: 13px; font-style: italic; padding: 10px 4px; }

@media (max-width: 680px) {
  main { padding: 14px; }
  .app-header { padding: 10px 14px; }
  .persons { padding: 4px 12px 10px; overflow-x: auto; }
  .p-header-row, .person { min-width: 460px; }
  .p-main { width: 128px; }
  .days { gap: 5px; }
  .day { font-size: 11px; padding: 5px 2px; }
  .p-total { width: 60px; font-size: 11px; }
}

/* --- Bearbeiten: Buttons, Popover, Modal --- */
.btn-primary, .btn-ghost, .btn-danger {
  font-family: var(--font-body); font-weight: 700; font-size: 13px; line-height: 1;
  border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #35352f; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: #f2f2ec; }
.btn-danger { background: #fff; border-color: #e4b0aa; color: var(--warn); }
.btn-danger:hover { background: #fbeae7; }

.card-head { flex-wrap: wrap; }
#add-person { margin-left: auto; }

.p-edit {
  background: transparent; border: none; cursor: pointer; color: var(--muted);
  font-size: 12px; padding: 3px 6px; border-radius: 6px; margin-left: 2px;
  opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.person:hover .p-edit, .p-edit:focus { opacity: 1; }
.p-edit:hover { background: #ebeae4; color: var(--ink); }

.day[data-person] { cursor: pointer; }
.day[data-person]:hover { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-ink); }

.cell-pop {
  position: absolute; z-index: 60; width: 214px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 11px;
  box-shadow: 0 10px 30px rgba(0,0,0,.17); padding: 11px 12px;
}
.cell-pop-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 9px; }
.cell-pop-row { display: flex; align-items: center; gap: 7px; }
.cell-pop-row input { flex: 1; min-width: 0; }
.cell-pop-foot { display: flex; align-items: center; gap: 7px; margin-top: 11px; }
.spacer { flex: 1; }

input[type="time"], input[type="text"], input[type="date"], select {
  font-family: var(--font-body); font-size: 13px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 9px; background: #fff;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,30,28,.42);
  display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px;
}
.modal {
  width: 460px; max-width: 100%;
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 55px rgba(0,0,0,.3); overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-family: var(--font-head); font-size: 18px; font-weight: 400; text-transform: uppercase; letter-spacing: .03em; margin: 0; }
.modal-x { background: transparent; border: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 4px; }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 17px 18px; display: flex; flex-direction: column; gap: 13px; }
.modal-body label { font-size: 11.5px; font-weight: 700; letter-spacing: .3px; color: var(--muted); text-transform: uppercase; display: flex; flex-direction: column; gap: 5px; }
.modal-body label.check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 400; color: var(--ink); }
.modal-body input, .modal-body select { width: 100%; }
.modal-body label.check input { width: auto; flex: none; }
.field-row { display: flex; gap: 12px; }
.field-row label { flex: 1; min-width: 0; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: #faf9f5; }

[hidden] { display: none !important; }

/* --- Tagesansicht --- */
.day-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.day-nav .btn-sm { padding: 6px 10px; }
.day-date {
  font-family: var(--font-head); font-weight: 400; font-size: 19px;
  text-transform: uppercase; letter-spacing: .03em; min-width: 220px;
}
#day-today { margin-left: 2px; }
.day-empty { padding: 34px; text-align: center; color: var(--muted); font-style: italic; }

.week-tabs { display: flex; gap: 6px; margin: 2px 0 12px; flex-wrap: wrap; }
.week-tab { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 60px; padding: 6px 12px; border: 1px solid var(--line-strong); background: #fff; border-radius: 9px; cursor: pointer; color: var(--ink); font-family: var(--font-body); transition: background .12s; }
.week-tab:hover { background: #f2f2ec; }
.week-tab.active { background: var(--yellow); border-color: #ecc400; color: var(--ink); }
.week-tab.today:not(.active) { border-color: var(--accent); }
.wt-day { font-size: 12.5px; font-weight: 700; letter-spacing: .3px; }
.wt-date { font-size: 11px; color: var(--muted); }
.week-tab.active .wt-date { color: rgba(29,29,27,.6); }

.day-axis, .bar-row { display: flex; align-items: center; gap: 12px; }
.day-axis { margin: 10px 0 4px; }
.bar-name {
  width: 132px; flex: none; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.bar-q { font-size: 9px; font-weight: 700; color: var(--muted); background: #eeeee7; border-radius: 10px; padding: 1px 5px; }

.ax-track, .bar-track, .mittag-track {
  position: relative; flex: 1; border-radius: 6px;
  background-image:
    /* Ränder des Mittagsfensters (11:45 = 47,5 % / 14:00 = 70 % der Achse 7–17 Uhr) */
    linear-gradient(to right,
      transparent 0 47.3%, rgba(197,155,0,.55) 47.3% 47.7%,
      transparent 47.7% 69.8%, rgba(197,155,0,.55) 69.8% 70.2%, transparent 70.2% 100%),
    /* Offenes Mittagessen 11:45–14:00 – deutlich hervorgehoben */
    linear-gradient(to right, transparent 0 47.5%, rgba(255,224,0,.30) 47.5% 70%, transparent 70% 100%),
    /* Kernzeit 8–14 nur noch ganz dezent */
    linear-gradient(to right, transparent 0 10%, rgba(242,101,34,.04) 10% 70%, transparent 70% 100%),
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 10%);
}

/* Beschriftetes Band über der Stundenachse */
.mittag-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; }
.mittag-track { height: 20px; }
.mittag-band {
  position: absolute; top: 0; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .03em;
  font-size: 13px; white-space: nowrap; color: #6b5200;
  background: linear-gradient(120deg, var(--yellow) 0%, #FFD608 100%);
  border-radius: 6px; box-shadow: 0 1px 2px rgba(29,29,27,.12);
}
@media (max-width: 680px) { .mittag-band { font-size: 10.5px; letter-spacing: 0; } }
.ax-track { height: 18px; }
.ax-tick { position: absolute; top: 1px; transform: translateX(-50%); font-size: 11px; color: var(--muted); }

.day-bereich { margin-top: 14px; }
.glane { margin: 6px 0 12px; }
.glane-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.glane-head .g-name { font-size: 15px; }
.glane-count { font-size: 11.5px; color: var(--muted); font-weight: 700; background: #f0f0ea; border-radius: 20px; padding: 1px 9px; }
.glane-body { display: flex; flex-direction: column; gap: 5px; }
.lane-empty { font-size: 12.5px; color: var(--muted); font-style: italic; padding: 3px 0 3px 144px; }

.bar-track { height: 24px; }
.bar {
  position: absolute; top: 2px; height: 20px; border-radius: 6px;
  display: flex; align-items: center; gap: 5px; padding: 0 7px; overflow: hidden;
  /* Erst einfache Farben als Rückfall (color-mix gibt es erst ab Chrome 111),
     danach die feineren Abstufungen für moderne Browser. */
  background: #f0efe9;
  border: 1px solid var(--gc, var(--line-strong));
  color: var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gc) 28%, #fff), color-mix(in srgb, var(--gc) 15%, #fff));
  border: 1px solid color-mix(in srgb, var(--gc) 45%, #fff);
  color: color-mix(in srgb, var(--gc) 72%, #1f1f1c);
}
.bar-label { font-size: 11px; font-weight: 700; white-space: nowrap; }
.bar-pause { font-size: 9.5px; font-weight: 700; background: rgba(255,255,255,.65); border-radius: 10px; padding: 0 5px; margin-left: auto; }

.day-legend { font-size: 12px; color: var(--muted); margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; line-height: 1.6; }

@media (max-width: 680px) {
  .bar-name { width: 96px; font-size: 11.5px; }
  .lane-empty { padding-left: 108px; }
  .day-date { min-width: 0; font-size: 14px; }
}

/* --- Besetzung / Unterbesetzung (M3) --- */
.cov-banner { border-radius: 11px; padding: 11px 14px; margin: 6px 0 2px; font-size: 13px; }
.cov-banner.ok { background: linear-gradient(120deg, var(--green-soft), #cfe6b3); color: #3b6d11; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cov-banner.warn { background: linear-gradient(120deg, var(--violet-soft), #efd9f6); color: #7a2e8f; border: 1px solid #ddb6e9; }
.cov-banner-head { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.cov-banner ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.cov-banner li { line-height: 1.5; }
.cov-tag { font-size: 10px; font-weight: 700; border-radius: 20px; padding: 1px 8px; margin-right: 3px; }
.cov-tag.under { background: var(--violet); color: #fff; }
.cov-tag.fk { background: var(--orange-soft); color: #8a3a12; }

.cover-row { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.cov-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.cov-label i { font-size: 10px; margin-right: 4px; }
.cover-row.warn .cov-label { color: var(--warn); }
.cov-track { height: 10px; background: none !important; }
.cov-window { position: absolute; top: 3px; height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--gc) 32%, #fff); }
.cov-band { position: absolute; top: 0; height: 10px; border-radius: 3px; }
.cov-band.under { background: rgba(166,75,196,.4); border: 1px solid var(--violet); }
.cov-band.fk { background: rgba(242,101,34,.28); border: 1px solid var(--orange); }

.bar[data-person] { cursor: pointer; }
.bar[data-person]:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc) 55%, #fff); }
.bar-vertretung { font-size: 9px; font-weight: 700; background: var(--violet); color: #fff; border-radius: 10px; padding: 1px 6px; }
#group-pop { width: 262px; }
.gp-foot { flex-wrap: wrap; }
.grund-vertretung { background: #e1f5ee; color: #0f6e56; }
.gp-lbl { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin: 8px 0 3px; }
.gp-hint { font-weight: 400; }
#group-pop select { width: 100%; }
.gp-times { display: flex; align-items: center; gap: 6px; }
.gp-times input { flex: 1; min-width: 0; }
.day-add-btn { margin-left: auto; }

/* --- Rollen ---
   Ohne Code (Team) und als Mittagsverantwortliche ist die PERSONALPLANUNG nur
   lesbar: alle vier Hauptansichten bleiben sichtbar, aber die Bearbeiten-
   Bedienelemente sind aus. Reine Pflege-Workflows (Abwesenheiten/Entwurf)
   sieht nur die Leitung. Die Mittagsplanung schaltet js/mittag.js frei. */
.team-mode .tab[data-view="abwesend"],
.team-mode .tab[data-view="entwurf"] { display: none; }

/* Team (ohne Code): nur die beiden Tagesansichten – „heute" reicht zum Nachsehen.
   Mittagsverantwortliche: zusätzlich der Mittags-Wochenplan.
   Die allgemeinen Personal-Ansichten sieht nur die Leitung. */
.role-team .tab[data-view="allgemein"],
.role-team .tab[data-view="mittag-woche"] { display: none; }
.role-mittag .tab[data-view="allgemein"] { display: none; }
.team-mode #add-person,
.team-mode .p-edit,
.team-mode .req-stepper,
.team-mode .req-reset { display: none; }
.team-mode .day[data-person] { pointer-events: none; }

/* „Personal heute" darf auch die Mittagsrolle bearbeiten – gesperrt ist nur das reine Team. */
.role-team #day-add { display: none; }
.role-badge { background: var(--accent-bg); color: var(--accent-ink); }
.role-team .bar[data-person] { pointer-events: none; cursor: default; box-shadow: none !important; }
.team-badge { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-bg); border-radius: 20px; padding: 3px 11px; display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; }
.team-badge i { font-size: 11px; }
.hdr-access { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; flex-wrap: wrap; }
.hdr-link { font-size: 13px; font-weight: 700; color: var(--accent-ink); text-decoration: none; background: var(--accent-bg); padding: 5px 12px; border-radius: 20px; }
.hdr-link:hover { filter: brightness(.97); }
.hdr-btn { font-size: 12px; font-weight: 700; border: 1px solid var(--line-strong); background: #fff; border-radius: 20px; padding: 4px 11px; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; }
.hdr-btn:hover { background: #f2f2ec; }
/* Hinweis, wenn ein freigeschalteter Browser den Nur-Lesen-Link (?team) geöffnet hat. */
.hdr-switch { text-decoration: none; background: var(--yellow); border-color: #ecc400; font-weight: 700; }
.hdr-switch:hover { background: #ffe95f; }

/* --- Abwesenheiten --- */
.abs-form { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 6px 0 18px; }
.abs-fields { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; align-items: flex-end; }
.abs-fields[hidden] { display: none; }
.abs-fields label { font-size: 11px; font-weight: 700; letter-spacing: .3px; color: var(--muted); text-transform: uppercase; display: flex; flex-direction: column; gap: 5px; }
.abs-fields select, .abs-fields input { min-width: 148px; }
.abs-items { display: flex; flex-direction: column; gap: 6px; }
.abs-item { display: flex; align-items: center; gap: 11px; padding: 9px 13px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.abs-grund { font-size: 11px; font-weight: 700; border-radius: 20px; padding: 2px 10px; }
.grund-krankheit { background: #fbeaea; color: #a32d2d; }
.grund-urlaub { background: #e1f5ee; color: #0f6e56; }
.grund-gleittag { background: #e6f1fb; color: #185fa5; }
.grund-geburtstag { background: #fbeaf0; color: #993556; }
.grund-fortbildung { background: #eeedfe; color: #3c3489; }
.abs-who { font-weight: 700; font-size: 14px; }
.abs-when { color: var(--muted); font-size: 13px; margin-left: auto; }
.abs-del { background: transparent; border: none; cursor: pointer; color: var(--muted); padding: 5px 7px; border-radius: 6px; font-size: 13px; }
.abs-del:hover { background: #fbeae7; color: var(--warn); }

.bar-abs { position: absolute; top: 2px; height: 20px; border-radius: 5px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #3f3f3c; background: repeating-linear-gradient(45deg, rgba(150,150,146,.5) 0 5px, rgba(120,120,116,.5) 5px 10px); }

.abs-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.abs-planned { margin-top: 6px; }
.abs-planned-head { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 2px 0 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.abs-item { transition: border-color .12s; }
.abs-item:hover { border-color: var(--line-strong); }
.abs-confirm { background: var(--ink); color: #fff; border: none; border-radius: 8px; padding: 6px 13px; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.abs-confirm:hover { background: #35352f; }

/* --- Mindestbesetzung-Maske --- */
.req-rows { display: flex; flex-direction: column; gap: 2px; }
.req-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.req-row:last-child { border-bottom: none; }
.req-label { font-weight: 700; font-size: 14px; min-width: 190px; }
.req-win { font-size: 12.5px; color: var(--muted); }
.req-stepper { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.req-step { width: 30px; height: 32px; border: 1px solid var(--line-strong); background: #fff; border-radius: 8px; cursor: pointer; font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1; }
.req-step:hover { background: #f2f2ec; }
.req-input { width: 54px; text-align: center; font-weight: 700; }
.req-std { font-size: 11px; color: #b6b6ad; min-width: 78px; text-align: right; }
.req-reset { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent-bg); border: none; border-radius: 20px; padding: 4px 10px; cursor: pointer; min-width: 78px; display: inline-flex; align-items: center; gap: 5px; justify-content: center; }
.req-reset:hover { filter: brightness(.97); }
.req-row.custom .req-label { color: var(--accent-ink); }

@media (max-width: 640px) {
  .req-label { min-width: 0; font-size: 13px; }
  .req-win { display: none; }
}

/* --- Abwesenheiten-Monatskalender --- */
.abs-cal-wrap { margin-top: 22px; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }
.cal-title { font-family: var(--font-head); font-weight: 400; font-size: 18px; text-transform: uppercase; letter-spacing: .03em; min-width: 160px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--muted); text-transform: uppercase; padding-bottom: 2px; }
.cal-cell { min-height: 68px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 5px; background: #fff; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.empty { border: none; background: transparent; }
.cal-cell.weekend { background: #f6f6f2; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-day { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-cell.today .cal-day { color: var(--accent-ink); }
.cal-chips { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-chip { font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .cal-cell { min-height: 52px; padding: 3px; }
  .cal-chip { font-size: 9px; padding: 1px 3px; }
}


/* --- Folgen einer Abwesenheit: Live-Vorschau unter der Maske --- */
.abs-folgen {
  margin-top: 10px; padding: 9px 13px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.abs-folgen.ok { background: var(--green-soft); color: #3b6d11; }
.abs-folgen.warn { background: linear-gradient(120deg, var(--violet-soft), #f3e3f8); color: #7a2e8f; border: 1px solid #ddb6e9; }
.abs-folgen i { font-size: 12px; }

/* --- Hinweis-Dialog --- */
.warn-modal { width: 540px; }
.warn-modal .modal-body { gap: 0; }
.warn-lead { font-size: 14px; margin: 0 0 10px; }
.warn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.warn-list li {
  font-size: 13px; padding: 7px 11px; border-radius: 8px;
  background: var(--violet-soft); color: #5d2270;
}
.warn-mehr { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.warn-mittag {
  margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 13px;
  background: var(--orange-soft); color: #8a3a12; border-left: 4px solid var(--orange);
}
.warn-frage { font-size: 14px; font-weight: 700; margin: 14px 0 0; }
.modal-foot .btn-ghost[hidden] { display: none; }

/* --- Kalender: Tage mit Unterbesetzung --- */
.cal-cell.hat-luecke { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.cal-day { display: flex; align-items: center; justify-content: space-between; }
.cal-luecke { color: var(--warn); font-size: 10px; }


/* --- „Ablauf & Infos" (Mittagsansicht, für alle sichtbar) --- */
.mt-info-btn { margin-left: auto; }
.info-modal { width: 640px; max-height: 86vh; display: flex; flex-direction: column; }
.info-body { overflow-y: auto; gap: 0; font-size: 13.5px; line-height: 1.5; }
.info-body h4 {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .03em;
  font-size: 16px; font-weight: 400; margin: 14px 0 5px;
  padding-bottom: 3px; border-bottom: 2px solid var(--yellow);
}
.info-body h4:first-child { margin-top: 0; }
.info-body p { margin: 0 0 7px; }
.info-body ul { margin: 0 0 7px; padding-left: 18px; }
.info-body li { margin-bottom: 3px; }
.info-zeit { display: flex; gap: 6px; margin-bottom: 4px; }
.info-zeit div {
  flex: 1; min-width: 0; text-align: center; padding: 7px 4px; border-radius: 8px;
  background: var(--yellow-soft); font-size: 10.5px; line-height: 1.3;
}
.info-zeit div:nth-child(2) { background: var(--orange-soft); }
.info-zeit div:nth-child(3) { background: var(--green-soft); }
.info-zeit div:nth-child(4) { background: var(--violet-soft); }
.info-zeit div:nth-child(5) { background: #eeede7; }
.info-zeit b { display: block; font-family: var(--font-head); font-size: 17px; font-weight: 400; letter-spacing: .02em; }
.info-zeit span { display: block; margin-top: 2px; font-weight: 700; }
.info-zeit i { font-weight: 400; font-style: normal; opacity: .7; }
.info-box {
  border-left: 4px solid var(--orange); border-radius: 0 8px 8px 0;
  background: linear-gradient(120deg, var(--orange-soft) 0%, #fff 92%);
  padding: 8px 12px; margin: 6px 0;
}
.info-box.neu-box { border-left-color: var(--violet); background: linear-gradient(120deg, var(--violet-soft) 0%, #fff 92%); }
.info-box.gruen-box { border-left-color: var(--green); background: linear-gradient(120deg, var(--green-soft) 0%, #fff 92%); }
.info-box ul { margin: 0; }
.modal-foot a.btn-ghost { text-decoration: none; }


/* --- Startfehler: Firebase-Baustein nicht ladbar (Netzwerkfilter / alter Browser) --- */
.startfehler {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(29, 29, 27, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.startfehler-karte {
  background: #fff; border-radius: 16px; max-width: 520px; padding: 24px 26px;
  box-shadow: 0 20px 55px rgba(0,0,0,.3); font-family: var(--font-body); color: var(--ink);
  border-top: 6px solid var(--orange);
}
.startfehler-karte h2 { margin: 0 0 10px; font-size: 22px; }
.startfehler-karte p { margin: 0 0 9px; font-size: 14px; line-height: 1.5; }
.startfehler-karte ul { margin: 0 0 9px; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.startfehler-fuss { color: var(--muted); font-size: 13px !important; border-top: 1px solid var(--line); padding-top: 10px; }

/* --- Quittieren von Besetzungs-Meldungen ("Passt so") --- */
.cov-banner li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cov-btn {
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
  border: 1px solid rgba(29,29,27,.22); background: rgba(255,255,255,.75);
  color: var(--ink); border-radius: 20px; padding: 3px 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.cov-btn:hover { background: #fff; border-color: var(--ink); }
.cov-btn i { font-size: 10px; }
.cov-schlechter {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--warn);
  border-radius: 20px; padding: 2px 9px;
}
.cov-quittiert-box { margin: 6px 0 2px; }
.cov-toggle {
  font-family: var(--font-body); font-size: 12px; font-weight: 700;
  background: transparent; border: none; cursor: pointer; color: var(--muted);
  padding: 4px 2px; display: inline-flex; align-items: center; gap: 6px;
}
.cov-toggle:hover { color: var(--ink); }
.cov-toggle i { font-size: 10px; color: #3b6d11; }
.cov-quittiert-liste { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cov-quittiert {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px;
}
.cov-quittiert .cov-tag { opacity: .6; }
.cov-quittiert strong { color: var(--ink); }
