:root {
  --bg: #f4f6f3;
  --panel: #ffffff;
  --ink: #1d2a23;
  --muted: #6a786f;
  --border: #d7dfd9;
  --brand: #2f7a44;
  --brand-dark: #205832;
  --danger: #b63b33;
  --shadow: 0 14px 28px rgba(21, 39, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #e8efe8 0%, var(--bg) 55%);
}

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

.sidebar {
  background: color-mix(in srgb, var(--panel) 92%, #f7fbf7 8%);
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.sidebar__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar__actions {
  display: flex;
  gap: 0.4rem;
}

.sidebar__mobile-close {
  display: none;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0.15rem 0 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

h2 {
  margin: 0;
  font-size: 1rem;
}

.mode-note {
  background: #edf4ed;
  border: 1px solid #d4e2d6;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  color: #2f503a;
}

.admin-tools {
  border: 1px solid var(--border);
  background: #f7faf7;
  border-radius: 12px;
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.admin-tools__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.admin-tools__row:last-child {
  grid-template-columns: 1fr;
}

.is-hidden {
  display: none;
}

.filters {
  display: grid;
  gap: 0.35rem;
}

label {
  font-size: 0.83rem;
  color: var(--muted);
}

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

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #fff;
}

.task-list-wrapper {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  overflow-y: auto;
}

.task-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.65rem;
  display: grid;
  gap: 0.35rem;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.task-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(19, 47, 30, 0.09);
}

.task-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.task-item__title {
  font-weight: 600;
  line-height: 1.2;
}

.task-item__meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.badge {
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  border: 1px solid transparent;
}

.badge--offen {
  background: #fdeece;
  color: #8d5a00;
  border-color: #f3d38e;
}

.badge--in-arbeit {
  background: #e4f0ff;
  color: #1f4a81;
  border-color: #b9d0f4;
}

.badge--erledigt {
  background: #e7f6e8;
  color: #2f6d35;
  border-color: #bfe3c2;
}

.badge--prio-niedrig {
  background: #eff2ef;
  color: #4b5a4d;
}

.badge--prio-mittel {
  background: #fef0d8;
  color: #8d620d;
}

.badge--prio-hoch {
  background: #fde2de;
  color: #8f2e23;
}

.map-container {
  position: relative;
}

#map {
  width: 100%;
  height: 100vh;
}

.mobile-panel-toggle {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 1200;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 43, 29, 0.92);
  color: #fff;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  display: none;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.btn--primary:hover {
  background: linear-gradient(145deg, #2a6b3c, #1d512d);
}

.btn--ghost {
  background: #eef2ee;
  color: var(--ink);
}

.marker-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18), 0 5px 12px rgba(0, 0, 0, 0.35);
}

.marker-dot--offen {
  background: #f5a623;
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.35), 0 5px 12px rgba(0, 0, 0, 0.35);
}

.marker-dot--in-arbeit {
  background: #2f80ed;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.3), 0 5px 12px rgba(0, 0, 0, 0.35);
}

.marker-dot--erledigt {
  background: #3ea15a;
  box-shadow: 0 0 0 4px rgba(62, 161, 90, 0.25), 0 5px 12px rgba(0, 0, 0, 0.35);
}

.marker-dot--hoch {
  transform: scale(1.15);
  box-shadow: 0 0 0 5px rgba(182, 59, 51, 0.28), 0 6px 14px rgba(0, 0, 0, 0.38);
}

.field-shape {
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.26));
}

.field-draft-shape {
  filter: drop-shadow(0 0 10px rgba(59, 127, 206, 0.55));
}

.field-draft-line {
  filter: drop-shadow(0 0 8px rgba(59, 127, 206, 0.45));
}

.popup-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.popup-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: #1d2a23;
  border-radius: 8px;
  font-size: 0.78rem;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
}

.popup-btn--danger {
  border-color: #e7beb9;
  color: var(--danger);
}

.marker-dialog {
  border: none;
  border-radius: 14px;
  width: min(95vw, 460px);
  padding: 0;
}

.marker-dialog::backdrop {
  background: rgba(18, 31, 22, 0.45);
}

.marker-dialog form {
  padding: 1rem;
  display: grid;
  gap: 0.55rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.empty-note {
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.7rem;
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(88vw, 360px);
    height: 100vh;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.23);
    transform: translateX(-110%);
    transition: transform 0.2s ease;
    z-index: 1400;
  }

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

  .sidebar__mobile-close {
    display: inline-block;
  }

  .mobile-panel-toggle {
    display: inline-block;
  }

  .map-container {
    height: 100vh;
  }

  #map {
    height: 100vh;
  }
}
