:root {
  --bg: #f4f1ec;
  --panel: #fffdfa;
  --panel-strong: #f8faf6;
  --text: #1f2722;
  --muted: #66706a;
  --line: #d9ded8;
  --green: #2f7d57;
  --green-dark: #1f5d3f;
  --blue: #356c90;
  --amber: #b8791b;
  --red: #b8463c;
  --ink: #26312b;
  --shadow: 0 12px 34px rgba(36, 45, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

textarea {
  resize: vertical;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: #26312b;
  color: #f7f3ed;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  font-weight: 800;
}

.brand small,
.user-pill span,
.muted,
.subline {
  color: var(--muted);
}

.brand small {
  display: block;
  color: #bfc9c1;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  border-radius: 8px;
  color: #dfe8e0;
  padding: 11px 12px;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.nav-group-label {
  margin: 10px 0 -2px;
  padding: 0 12px;
  color: #8b978f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.sidebar-version {
  color: #8b978f;
  font-size: 12px;
}

.logout {
  margin: 0;
}

.logout .button.ghost {
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
}

.logout .button.ghost:hover,
.logout .button.ghost:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
  color: #17352a;
}

.main {
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 22px;
}

.topbar,
.detail-header,
.section-heading,
.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-heading {
  margin-bottom: 10px;
}

.topbar h1,
.detail-header h2,
.section h2,
.login-panel h1 {
  margin: 0;
  line-height: 1.15;
}

.topbar h1 {
  font-size: 30px;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
}

.sidebar-scrim {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.user-pill {
  display: block;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
  text-align: right;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.user-pill:hover,
.user-pill:focus-visible {
  border-color: var(--green);
  background: #eef8f0;
}

.user-pill.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(47, 125, 87, 0.24);
}

.user-pill span {
  display: block;
  font-size: 13px;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-indicator {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #b83227;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.warning-indicator b {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 22px;
  height: 22px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #ffffff;
  color: #b83227;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.section,
.detail-header,
.metric,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section,
.detail-header {
  padding: 20px;
}

.detail-header > div:first-child {
  flex: 1;
  min-width: 240px;
}

.detail-header .progress-row {
  margin-top: 10px;
  max-width: 420px;
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.header-actions select {
  width: auto;
  min-height: 42px;
}

.narrow {
  max-width: 980px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 34px;
}

.button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.button:hover,
.icon-button:hover {
  border-color: #a9b4ab;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.button.ghost {
  background: transparent;
}

.button.danger,
.icon-button.danger {
  border-color: #e0b0aa;
  color: var(--red);
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.flash {
  border-radius: 8px;
  border: 1px solid #cdd8cf;
  background: #eef8f0;
  color: #245337;
  padding: 12px 14px;
}

.flash.error {
  background: #fff0ee;
  border-color: #edc6c0;
  color: #8f342d;
}

.notice-list {
  border: 1px solid #d9ded8;
  border-radius: 8px;
  background: #f8faf6;
  margin-top: 16px;
  padding: 14px;
}

.notice-list h3 {
  margin: 0 0 8px;
}

.notice-list p {
  margin: 6px 0;
}

.notice-list.error-list {
  border-color: #edc6c0;
  background: #fff0ee;
  color: #8f342d;
}

.danger-zone {
  border-color: #e0b0aa;
  background: #fff8f6;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.subline {
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.actions-cell {
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  background: #edf0ee;
  color: var(--ink);
}

.badge-green {
  background: #e5f3ea;
  color: var(--green-dark);
}

.badge-blue {
  background: #e8f1f6;
  color: var(--blue);
}

.badge-amber {
  background: #fff2d8;
  color: #855411;
}

.badge-red {
  background: #fde9e5;
  color: var(--red);
}

.badge-dark {
  background: #2c332f;
  color: white;
}

.badge-muted {
  background: #edf0ee;
  color: #5e6861;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.coord-pair {
  display: flex;
  gap: 8px;
}

.coord-pair input {
  min-width: 0;
  width: auto;
  flex: 1;
}

label,
.stack {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-readonly {
  display: grid;
  gap: 7px;
}

.field-readonly span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-readonly strong {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid #cbd2cc;
  border-radius: 8px;
  background: #f7f9f7;
  padding: 10px 11px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd2cc;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  min-height: 42px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(47, 125, 87, 0.18);
  border-color: var(--green);
}

.form-actions,
.inline-form,
.quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.filter-bar a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 12px;
}

.filter-bar a.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.derived-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.derived-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 14px;
}

.derived-summary span,
.derived-summary small {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.derived-summary strong {
  display: block;
  font-size: 30px;
  margin: 3px 0;
}

.module-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.module-strip a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
}

.module-strip strong,
.module-strip span {
  display: block;
}

.module-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.module-strip a[aria-current="page"] {
  border-color: var(--green);
  background: var(--panel-strong);
}

/* Tab-Leiste der Durchführungs-Seite: Menü als Reiter, nur aktiver Bereich sichtbar. */
.operation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.operation-tab {
  flex: 1 1 150px;
  text-align: left;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 10px 14px;
  color: var(--text);
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.operation-tab:hover {
  background: var(--panel-strong);
}

.operation-tab strong,
.operation-tab span {
  display: block;
}

.operation-tab span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.operation-tab.is-active {
  background: var(--green);
  border-color: var(--green-dark);
  box-shadow: var(--shadow);
}

.operation-tab.is-active strong,
.operation-tab.is-active span {
  color: #fff;
}

.operation-tab-panel {
  margin-top: 24px;
}

.operation-tab-panel[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .operation-tab {
    flex-basis: 100%;
  }
}

.progress-row {
  justify-content: flex-start;
}

.progress {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e6e1;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.calendar-scroll {
  overflow-x: auto;
}

.shift-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 8px;
  min-width: 980px;
}

.calendar-weekday {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 6px 4px;
  text-transform: uppercase;
}

.calendar-day {
  align-content: start;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 10px;
}

.calendar-day.is-today {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(47, 125, 87, 0.24);
}

.calendar-day-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.calendar-day-head strong {
  font-size: 18px;
}

.calendar-day-head span,
.calendar-empty {
  color: var(--muted);
  font-size: 12px;
}

.calendar-shift {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 8px;
}

.calendar-shift.is-understaffed {
  border-left-color: var(--amber);
}

.calendar-shift time,
.calendar-shift small {
  color: var(--muted);
  font-size: 12px;
}

.calendar-shift span {
  font-weight: 800;
}

.calendar-assignees {
  display: grid;
  gap: 2px;
  margin-top: 2px;
}

.calendar-assignee-line {
  color: var(--text);
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.calendar-assignee-line b {
  color: var(--muted);
  font-weight: 900;
  margin-right: 3px;
}

.shift-list {
  display: grid;
  gap: 10px;
}

.shift-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.shift-row p {
  margin: 0;
}

.shift-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.shift-summary::-webkit-details-marker,
.shift-summary::marker {
  display: none;
  content: '';
}

.shift-summary-toggle {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid var(--muted);
  transition: transform 0.15s ease;
}

.shift-row[open] > .shift-summary .shift-summary-toggle {
  transform: rotate(90deg);
}

.shift-summary-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.shift-summary-time {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.shift-summary-title {
  font-size: 15px;
}

.shift-summary-location {
  color: var(--muted);
  font-size: 13px;
}

.shift-summary-main > .calendar-assignees {
  flex-basis: 100%;
  margin-top: 0;
}

.shift-summary-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 8px;
}

.shift-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}

.note {
  margin: 10px 0 0 0;
  color: var(--muted);
}

.self-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.my-shift-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.my-shift-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  min-height: 88px;
  padding: 14px;
}

.my-shift-summary span,
.my-shift-meta span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.my-shift-summary strong {
  display: block;
  font-size: 26px;
  line-height: 1.2;
}

.my-shift-list {
  display: grid;
  gap: 12px;
}

.my-shift-list.compact .my-shift-card {
  opacity: 0.78;
}

.my-shift-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--panel-strong);
  display: grid;
  gap: 14px;
  padding: 16px;
}

.my-shift-card.is-current {
  border-left-color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(184, 121, 27, 0.18);
}

.my-shift-card h3,
.my-shift-card p {
  margin: 0;
}

.my-shift-card-head,
.my-shift-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.my-shift-card-head p span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.my-shift-badges,
.my-shift-actions {
  flex-wrap: wrap;
}

.my-shift-badges {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.my-shift-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.my-shift-meta div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.my-shift-meta strong {
  display: block;
}

.my-shift-meta small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.my-shift-actions {
  justify-content: flex-start;
}

.my-shift-actions form {
  display: inline-flex;
}

.calendar-month {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.calendar-month-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.calendar-month-head h3 {
  margin: 0;
}

.calendar-shift.is-current {
  border-left-color: var(--amber);
}

.calendar-shift.is-past {
  opacity: 0.68;
}

.calendar-shift.is-provisional {
  border-left-color: var(--blue);
}

.calendar-week {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.calendar-week-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.calendar-week-head h3 {
  font-size: 15px;
  margin: 0;
}

.calendar-day.is-outside {
  opacity: 0.5;
}

.calendar-agenda {
  display: grid;
  gap: 10px;
}

.calendar-agenda-day {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.calendar-agenda-day.is-today {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(47, 125, 87, 0.24);
}

.calendar-agenda-head {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.calendar-agenda-head strong {
  font-size: 16px;
}

.calendar-agenda-head span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-agenda-shifts {
  display: grid;
  gap: 8px;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.location-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.location-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 16px;
}

.compact-heading {
  align-items: flex-start;
}

.location-editor h3 {
  margin: 0;
}

.location-readonly {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0 0;
}

.location-readonly div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.location-readonly dd {
  margin: 4px 0 0;
}

.location-editor label span,
.location-editor .location-readonly span,
.location-editor em {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  margin-top: 3px;
}

.delete-location-form {
  margin-top: 10px;
}

.location-form {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.new-location-panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.new-location-panel summary {
  cursor: pointer;
  list-style: none;
  width: fit-content;
}

.new-location-panel summary::-webkit-details-marker,
.new-location-panel summary::marker {
  display: none;
  content: '';
}

.new-location-panel[open] summary {
  margin-bottom: 16px;
}

.location-create-split,
.event-primary-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

.event-primary-fields {
  display: grid;
  gap: 16px;
}

.location-edit-fields {
  display: grid;
  gap: 16px;
}

.location-editor-meta {
  align-items: center;
  display: flex;
  gap: 10px;
}

.location-order-actions {
  display: flex;
  gap: 4px;
}

.event-primary-map .osm-picker {
  min-height: 320px;
}

.event-primary-map p.muted {
  margin-top: 8px;
}

.location-create-map .osm-picker {
  min-height: 320px;
}

.location-create-map p.muted {
  margin-top: 8px;
}

.osm-picker {
  min-height: 240px;
  border: 1px solid #cbd2cc;
  border-radius: 8px;
  overflow: hidden;
  background: #e8eee9;
}

.event-location-map {
  min-height: 360px;
  border: 1px solid #cbd2cc;
  border-radius: 8px;
  overflow: hidden;
  background: #e8eee9;
}

.location-chips {
  margin-top: 12px;
}

.location-chips em {
  color: var(--amber);
  display: block;
  font-style: normal;
  font-weight: 800;
  margin-top: 3px;
}

.map-fallback {
  display: grid;
  min-height: 240px;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

.assignment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.assignment-table th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0 8px 6px;
}

.assignment-table td {
  padding: 8px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.assignment-table tbody tr:first-child td {
  border-top: 1px solid var(--line);
}

.assignment-table td.empty {
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.conflict-note {
  display: block;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.assignment-row-status-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-row-status-form select {
  min-height: 30px;
  min-width: 170px;
  padding: 4px 8px;
  font-size: 13px;
  width:340px;
}

.assignment-add-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shift-editor-panel {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.shift-editor-panel > .eyebrow {
  margin: 0 0 10px;
}

.shift-editor {
  padding-top: 2px;
}

.shift-editor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.shift-delete-form {
  margin: 0;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.map-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
  min-height: 560px;
}

.lageplan-map {
  min-height: 560px;
  border: 1px solid #c8d0ca;
  border-radius: 8px;
  overflow: hidden;
  background: #e8eee9;
}

.event-marker-icon span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 3px;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(20, 30, 24, 0.45);
  margin: 2px auto 0;
}

.map-side {
  align-self: start;
}

.map-side-form-heading {
  margin-top: 16px;
}

.grid-toggle-form {
  margin-top: 12px;
}

.poi-picker-toggle {
  width: 100%;
  margin-top: 4px;
}

.poi-picker-toggle.is-active {
  border-color: var(--green);
  color: var(--green);
  font-weight: 800;
}

.lageplan-map.poi-picking {
  cursor: crosshair;
}

.poi-preview-icon span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px dashed #1f2937;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 4px rgba(20, 30, 24, 0.45);
  animation: poi-preview-pulse 1.1s ease-in-out infinite;
}

@keyframes poi-preview-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}

.grid-label {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  color: #2f7d57;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
  padding: 0 3px;
  text-align: center;
  white-space: nowrap;
}

.marker-type-legend {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.legend-toggle {
  align-items: center;
  display: flex;
  gap: 9px;
  font-size: 13px;
}

.legend-toggle input[type="checkbox"] {
  accent-color: var(--green);
  flex-shrink: 0;
  height: 15px;
  margin: 0;
  width: 15px;
}

.color-field input[type="color"] {
  width: 64px;
  min-height: 42px;
  padding: 3px;
  cursor: pointer;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.map-details > summary {
  cursor: pointer;
  list-style: none;
}

.map-details > summary::-webkit-details-marker {
  display: none;
}

.map-details-summary h2::after {
  content: " \25BE";
  color: var(--muted);
  font-weight: 400;
}

.map-details:not([open]) > .map-details-summary h2::after {
  content: " \25B8";
}

.map-details-actions {
  margin: 12px 0;
}

.facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
}

.facts dt {
  font-weight: 800;
}

.facts dd {
  margin: 0;
}

.timeline,
.feed {
  display: grid;
  gap: 10px;
}

.timeline-item,
.feed-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr 150px;
  gap: 12px;
  align-items: start;
}

.timeline-item-main {
  display: grid;
  gap: 6px;
}

.timeline-item time,
.feed-item time,
.feed-item span {
  color: var(--muted);
  font-size: 13px;
}

.timeline-item strong span {
  color: var(--muted);
  font-weight: 700;
}

.timeline-helper-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-helper-list li {
  color: var(--text);
  font-size: 13px;
}

.helper-status-tag {
  color: var(--muted);
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  margin-right: 8px;
  min-width: 40px;
  text-transform: uppercase;
}

.feed-item p {
  margin: 7px 0;
}

.feed-item-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.feed-item-head time,
.feed-item-head strong {
  margin-right: 8px;
}

.marker-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.marker-chips > span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  padding: 8px 11px;
}

.location-chip {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 9px;
  padding: 8px 12px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.location-chip:hover:not(:disabled) {
  border-color: #a9b4ab;
}

.location-chip:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.location-chip.is-active {
  box-shadow: 0 0 0 2px var(--chip-color, var(--green)) inset;
}

.location-chip-dot {
  background: var(--chip-color, var(--muted));
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
  height: 10px;
  width: 10px;
}

.location-marker-icon span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(20, 30, 24, 0.45);
}

.warning-panel {
  border-color: #e7c58a;
}

.warning-list {
  display: grid;
  gap: 10px;
}

.warning-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  display: grid;
  gap: 5px;
  grid-template-columns: auto 1fr auto;
  padding: 12px;
}

.warning-item p {
  color: var(--muted);
  grid-column: 1 / -1;
  margin: 0;
}

.member-list {
  display: grid;
  gap: 14px;
}

.member-directory {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.member-directory-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.member-directory-head,
.member-directory-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.6fr) minmax(105px, 0.8fr) minmax(72px, 0.55fr) minmax(82px, 0.65fr);
  gap: 12px;
  align-items: center;
}

.member-directory-head {
  background: var(--panel-strong);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 10px 12px;
  text-transform: uppercase;
}

.member-directory-row {
  background: #fff;
  border-bottom: 1px solid var(--line);
  min-height: 62px;
  padding: 10px 12px;
}

.member-directory-row:last-child {
  border-bottom: 0;
}

.member-directory-row:hover,
.member-directory-row.is-selected {
  background: #eef8f0;
}

.member-directory-row.is-selected {
  box-shadow: inset 4px 0 0 var(--green);
}

.member-directory-row.is-inactive {
  opacity: 0.72;
}

.member-directory-row strong,
.member-directory-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-directory-row small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.member-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 16px;
}

.member-detail-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.member-detail-header h3,
.member-detail-empty h3 {
  margin: 0;
}

.member-detail-header span:not(.badge) {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.member-detail-form.form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-detail-empty {
  min-height: 180px;
  display: grid;
  align-content: center;
}

.role-form,
.event-member-list {
  margin-top: 14px;
}

.event-member-list.compact {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.member-row {
  align-items: center;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: space-between;
  padding: 8px 12px;
}

.member-row:last-child {
  border-bottom: none;
}

.member-row.is-inactive {
  opacity: 0.6;
}

.member-row-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 140px;
}

.member-row-name span {
  color: var(--muted);
  font-size: 13px;
}

.member-row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-row-actions select {
  min-height: 32px;
  min-width: 150px;
  padding: 4px 8px;
  width: auto;
}

.member-row-actions .check-label {
  gap: 6px;
  min-height: auto;
}

.member-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 16px;
}

.member-card.is-inactive {
  opacity: 0.72;
}

.member-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.member-card-header strong,
.member-card-header span {
  display: block;
}

.member-card-header div span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.check-label {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 42px;
}

.check-label input {
  min-height: auto;
  width: auto;
}

.member-delete-form {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.empty {
  color: var(--muted);
  margin: 0;
}

.small {
  font-size: 13px;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 430px);
}

.login-panel {
  padding: 28px;
}

@media (max-width: 980px) {
  .app-shell,
  .map-layout,
  .operation-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1010;
    width: min(84vw, 300px);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim[data-open] {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1005;
    background: rgba(23, 49, 40, 0.45);
  }

  .module-strip,
  .metrics,
  .my-shift-summary,
  .my-shift-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .location-create-split,
  .event-primary-split {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .member-directory {
    grid-template-columns: 1fr;
  }

  .member-detail-form.form-grid.compact {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px;
  }

  .map-board {
    min-height: 0;
    padding: 8px;
  }

  .lageplan-map {
    min-height: 340px;
    height: 55vh;
  }

	  .topbar,
	  .detail-header,
	  .section-heading,
	  .shift-summary,
	  .member-card-header,
	  .member-detail-header,
	  .my-shift-card-head,
	  .calendar-month-head {
	    align-items: flex-start;
	    flex-direction: column;
	  }

	  .shift-summary-toggle {
	    display: none;
	  }

  .member-directory-head {
    display: none;
  }

  .member-directory-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

	  .metrics,
	  .module-strip,
	  .two-cols,
	  .my-shift-summary,
	  .my-shift-meta {
	    grid-template-columns: 1fr;
	  }

	  .my-shift-badges {
	    justify-content: flex-start;
	  }

  .location-list {
    grid-template-columns: 1fr;
  }

  .timeline-item,
  .facts div,
  .warning-item {
    grid-template-columns: 1fr;
  }

  .user-area,
  .user-pill {
    width: 100%;
  }

  .user-area {
    align-items: flex-start;
    justify-content: space-between;
  }

  .user-pill {
    text-align: left;
  }
}

.section-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.view-toggle {
  display: flex;
  gap: 6px;
}

[data-view-panel][hidden] {
  display: none;
}

.member-card-actions {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
}

.compact-list {
  display: grid;
  gap: 6px;
}

.list-row {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 12px;
}

.list-row.is-inactive {
  opacity: 0.72;
}

.list-row-info {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.list-row-key {
  color: var(--muted);
  font-size: 13px;
}

.list-row-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.list-row-actions .inline-form {
  display: inline-flex;
}

.modal-overlay {
  align-items: center;
  background: rgba(23, 49, 40, 0.45);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  overflow-y: auto;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 22px 60px rgba(20, 30, 24, 0.28);
  max-height: calc(100vh - 48px);
  max-width: 640px;
  overflow-y: auto;
  padding: 22px;
  width: 100%;
}

.modal-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 20px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  width: 32px;
}

.modal-close:hover {
  border-color: #a9b4ab;
}

.modal-form-actions {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .modal {
    padding: 16px;
  }
}

.emergency-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.emergency-item {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 10px 12px;
}

.emergency-icon {
  align-items: center;
  background: rgba(47, 125, 87, 0.1);
  border: 1px solid rgba(47, 125, 87, 0.28);
  border-radius: 8px;
  color: var(--green);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  line-height: 1;
  min-width: 34px;
  padding: 0 6px;
}

.emergency-icon.small {
  font-size: 11px;
  height: 24px;
  margin-right: 6px;
  min-width: 24px;
}

.emergency-item-text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.emergency-item-text span {
  color: var(--muted);
  font-size: 13px;
}

.emergency-call {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .emergency-item {
    flex-wrap: wrap;
  }

  .emergency-call {
    margin-left: 48px;
  }
}

/* --- Download-Liste: Dokumente im Block "Wichtige Informationen" --- */
.download-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.download-item {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 10px 12px;
}

.download-icon {
  align-items: center;
  background: rgba(47, 125, 87, 0.1);
  border: 1px solid rgba(47, 125, 87, 0.28);
  border-radius: 8px;
  color: var(--green);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  letter-spacing: 0.04em;
  line-height: 1;
  min-width: 40px;
  padding: 0 6px;
}

.download-item-text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.download-item-text strong {
  overflow-wrap: anywhere;
}

.download-item-text span {
  color: var(--muted);
  font-size: 13px;
}

.download-action {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .download-item {
    flex-wrap: wrap;
  }

  .download-action {
    margin-left: 52px;
  }
}

/* --- Einsatzkarte: Editor (P2-004, P2-011, P2-012, P2-013, P2-015, P2-017, P2-018) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.map-tool-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.map-save-group {
  margin-left: auto;
}

.map-tool.is-active {
  border-color: var(--green);
  color: var(--green);
  font-weight: 800;
}

.map-dirty-badge {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border-radius: 999px;
  padding: 3px 10px;
}

.map-tool-hint {
  margin: 0 0 10px;
  min-height: 16px;
}

.map-save-form {
  margin: 0;
}

.lageplan-map.map-picking {
  cursor: crosshair;
}

.map-control-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.map-control-block .eyebrow {
  margin: 0;
}

.map-fallback-forms {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.map-fallback-forms > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.map-fallback-forms > form {
  margin-top: 12px;
}

/* Leaflet-Controls */
.map-zoom-display {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  box-shadow: 0 1px 4px rgba(20, 30, 24, 0.35);
}

.map-center-icon span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #2f6fed;
  background: rgba(47, 111, 237, 0.25);
  box-shadow: 0 0 0 2px #fff;
}

.print-handle-icon span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid #c0392b;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 4px rgba(20, 30, 24, 0.45);
}

/* Marker-Bearbeitungs-Popup */
.marker-popup-form {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.marker-popup-form label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
}

.marker-popup-form select,
.marker-popup-form input,
.marker-popup-form textarea {
  font-size: 13px;
}

.marker-popup-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.marker-edit {
  display: inline-block;
}

.marker-edit-form {
  margin-top: 8px;
  min-width: 240px;
}

.document-upload {
  margin-bottom: 6px;
}

.document-upload input[type="file"] {
  padding: 8px;
}

.member-lock-status {
  align-items: center;
  background: var(--danger-soft, #fdecea);
  border: 1px solid var(--danger, #c0392b);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.member-lock-status > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Editor fuer Helferinformationen (P2-044) */
.rich-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.rich-editor-toolbar {
  background: var(--panel-strong);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
}

.rich-editor-toolbar .button.small {
  min-width: 34px;
}

.rich-editor-surface {
  background: #fff;
  min-height: 160px;
  padding: 10px 12px;
}

.rich-editor-surface:focus {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.rich-editor-surface ul,
.rich-editor-surface ol,
.helper-notes ul,
.helper-notes ol {
  margin: 0.4em 0;
  padding-left: 1.4em;
}

.helper-notes a {
  color: var(--green);
}
