:root {
  --bg: #f4efe7;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffaf3;
  --ink: #1e2a2f;
  --muted: #57656d;
  --accent: #c94b32;
  --accent-dark: #8d2f20;
  --line: rgba(30, 42, 47, 0.12);
  --soft-blue: #dbe9f4;
  --soft-amber: #f7e6b6;
  --soft-green: #d9efdf;
  --shadow: 0 18px 40px rgba(57, 39, 24, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Barlow", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(201, 75, 50, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(50, 101, 120, 0.15), transparent 24%),
    linear-gradient(180deg, #efe5d7 0%, #f6f1e8 46%, #ece5d8 100%);
  min-height: 100vh;
}

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

.shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255, 249, 240, 0.94), rgba(250, 236, 214, 0.88));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
}

.hero-copy,
.section-title p,
.section-inline p,
.mini-card p,
.map-note {
  color: var(--muted);
}

.clock-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 14px;
  min-width: 420px;
}

.clock-box,
.mini-card,
.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.clock-box span,
.stat-card span,
.incident-meta,
.timeline li,
.feedback {
  font-size: 0.92rem;
}

.clock-box strong {
  display: block;
  margin-top: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.25rem;
}

.tabs {
  display: flex;
  gap: 12px;
  margin: 22px 0;
  flex-wrap: wrap;
}

.tab,
.ortsteil-btn,
.status-btn,
.suggestion-btn,
.secondary,
.danger,
.primary {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.tab {
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
}

.tab.is-active,
.primary {
  background: linear-gradient(135deg, var(--accent), #d87731);
  color: white;
}

.tab:hover,
.ortsteil-btn:hover,
.status-btn:hover,
.secondary:hover,
.danger:hover,
.primary:hover {
  transform: translateY(-1px);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 22px;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.section-title,
.section-inline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-title {
  margin-bottom: 20px;
}

.sort-control {
  min-width: 220px;
}

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

label {
  display: block;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.suggestion-block,
.location-panel {
  margin: 22px 0;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 248, 238, 0.78);
  border: 1px solid rgba(201, 75, 50, 0.1);
}

.suggestions,
.ortsteil-buttons,
.status-actions,
.danger-actions,
.actions,
.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.suggestions.empty,
.empty-state {
  color: var(--muted);
}

.suggestion-btn,
.ortsteil-btn,
.status-btn,
.secondary {
  background: #f2e4ce;
  color: var(--ink);
}

.ortsteil-btn.is-active,
.status-btn.is-active {
  background: #2a6274;
  color: white;
}

.danger {
  background: #7c1b16;
  color: white;
}

.feedback {
  align-self: center;
  color: var(--muted);
}

.hidden {
  display: none;
}

.stats {
  margin-bottom: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
}

.incident-list {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.incident-card {
  border-radius: 20px;
  border: 1px solid rgba(30, 42, 47, 0.08);
  overflow: hidden;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.incident-card.is-expanded {
  box-shadow: 0 18px 38px rgba(19, 32, 40, 0.16);
}

.incident-card.status-neu {
  background: var(--soft-blue);
}

.incident-card.status-in-arbeit {
  background: var(--soft-amber);
}

.incident-card.status-erledigt {
  background: var(--soft-green);
}

.incident-summary {
  width: 100%;
  padding: 16px 18px;
  background: transparent;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  text-align: left;
}

.incident-summary:focus,
.incident-summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(42, 98, 116, 0.22);
}

.incident-summary-main {
  min-width: 0;
}

.incident-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.incident-title-row h3 {
  margin: 0;
}

.incident-summary-text {
  margin: 8px 0 0;
  color: var(--muted);
}

.incident-summary-side {
  display: grid;
  gap: 6px;
  justify-items: end;
  flex-shrink: 0;
}

.dispatch-number {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  color: var(--accent-dark);
}

.runtime {
  font-size: 1rem;
}

.priority-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.priority-badge {
  color: #fff;
}

.priority-0 {
  background: #8d1010;
}

.priority-1 {
  background: #c9641d;
}

.priority-2 {
  background: #987116;
}

.priority-3 {
  background: #52616b;
}

.status-pill {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.incident-expanded {
  display: none;
  padding: 0 18px 18px;
}

.incident-expanded.is-open {
  display: block;
}

.incident-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.incident-head h3 {
  margin-bottom: 4px;
}

.incident-meta {
  color: var(--muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.incident-body {
  margin: 14px 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.incident-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.95fr);
  gap: 18px;
}

.detail-box,
.timeline-box,
.report-box {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
}

.detail-box p,
.timeline-box p,
.report-box p,
.report-box h4 {
  margin-bottom: 10px;
}

.timeline {
  margin: 0;
  padding-left: 18px;
}

.timeline li + li {
  margin-top: 8px;
}

.report-form {
  display: grid;
  gap: 12px;
}

.incident-mini-map {
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(30, 42, 47, 0.08);
}

.custom-marker {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(19, 32, 40, 0.18);
}

.priority-ring-0 {
  box-shadow: 0 0 0 3px #8d1010;
}

.priority-ring-1 {
  box-shadow: 0 0 0 3px #c9641d;
}

.priority-ring-2 {
  box-shadow: 0 0 0 3px #987116;
}

.priority-ring-3 {
  box-shadow: 0 0 0 3px #52616b;
}

.marker-neu {
  background: #2f74d0;
}

.marker-in-arbeit {
  background: #d0871f;
}

.marker-erledigt {
  background: #3b9156;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

#map {
  height: 560px;
  margin-top: 18px;
  border-radius: 22px;
  overflow: hidden;
}

.map-legend {
  margin-top: 16px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(30, 42, 47, 0.08);
}

.legend-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.legend-group strong {
  font-size: 0.92rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.legend-dot,
.legend-ring {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.legend-dot {
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.legend-ring {
  background: #f7f4ee;
}

.settings-form {
  display: grid;
  gap: 18px;
}

@media (max-width: 1080px) {
  .hero,
  .layout-grid,
  .settings-grid,
  .incident-body,
  .incident-detail-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .clock-panel {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 18px;
  }

  .hero,
  .panel {
    padding: 18px;
  }

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

  .incident-summary,
  .incident-summary-side,
  .incident-head,
  .section-inline,
  .section-title {
    flex-direction: column;
    align-items: flex-start;
  }
}
