:root {
  --background: #f4fff8;
  --foreground: #101512;
  --muted: #4e6559;
  --line: #b8e7c8;
  --panel: #ffffff;
  --ink: #101512;
  --ready: #00a651;
  --working: #0071ce;
  --done: #00a651;
  --waiting: #ffcb05;
  --not-ready: #111111;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(0, 166, 81, 0.2), transparent 28rem),
    linear-gradient(135deg, rgba(255, 203, 5, 0.16), transparent 42rem),
    var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 24px;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--ready);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.reset-button,
.notification-button,
.diagram-button,
.report-button,
.report-overview-actions button,
.dialog-actions button {
  min-height: 42px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 750;
  padding: 0 16px;
}

.diagram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #1558a6;
  background: #eaf3ff;
  text-decoration: none;
  white-space: nowrap;
}

.diagram-button:hover {
  background: #1558a6;
  color: #ffffff;
}

.report-button {
  width: 100%;
  margin-top: 8px;
  border-color: #b42318;
  background: #fff3f2;
  color: #8a1710;
}

.report-button:hover {
  background: #b42318;
  color: #ffffff;
}

.notification-button {
  border-color: var(--ready);
  background: var(--ready);
  color: #ffffff;
}

.notification-button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--ink);
}

.notification-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.summary-item {
  min-height: 84px;
  border: 1px solid rgba(0, 166, 81, 0.28);
  border-left: 6px solid var(--not-ready);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.summary-item strong {
  display: block;
  margin-top: 4px;
  font-size: 2.1rem;
  line-height: 1;
}

.summary-item.i-gang {
  border-left-color: var(--working);
}

.summary-item.faerdig {
  border-left-color: var(--done);
}

.summary-item.venter {
  border-left-color: var(--waiting);
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 14px;
}

.city-card {
  border: 2px solid #101512;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(0, 166, 81, 0.14);
  overflow: hidden;
}

.city-card h2 {
  margin: 0;
  padding: 16px;
  border-bottom: 2px solid #101512;
  background: var(--ready);
  color: #ffffff;
  font-size: 1.35rem;
}

.city-picker {
  align-items: stretch;
}

.city-link {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: space-between;
  color: inherit;
  text-decoration: none;
}

.city-link span {
  display: block;
  color: var(--ink);
  font-weight: 850;
  padding: 16px;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--ready);
  font-weight: 850;
  text-decoration: none;
}

.single-city {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.single-city .station-row {
  border: 2px solid #101512;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(0, 166, 81, 0.14);
}

.station-row {
  padding: 14px;
  border-bottom: 1px solid rgba(0, 166, 81, 0.22);
}

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

.station-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 10px;
  font-weight: 800;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #101512;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.status-pill.i-gang {
  background: rgba(0, 113, 206, 0.14);
  color: var(--working);
}

.status-pill.faerdig {
  background: rgba(0, 166, 81, 0.16);
  color: var(--done);
}

.status-pill.venter {
  background: rgba(255, 203, 5, 0.38);
  color: #6a4d00;
}

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

.status-controls button {
  min-height: 38px;
  border: 1px solid rgba(16, 21, 18, 0.24);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  padding: 0 8px;
}

.status-controls button.active {
  border-color: #101512;
  background: #101512;
  color: #ffffff;
}

.drawing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  width: 100%;
  margin-top: 8px;
  border: 2px solid var(--ready);
  border-radius: 7px;
  background: rgba(0, 166, 81, 0.1);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: none;
}

.drawing-button:hover {
  background: var(--ready);
  color: #ffffff;
}

.waiting-note {
  margin: 10px 0 0;
  border-left: 3px solid var(--waiting);
  color: #5d4700;
  font-size: 0.9rem;
  line-height: 1.35;
  padding-left: 10px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(16, 21, 18, 0.68);
  padding: 18px;
}

.hidden {
  display: none;
}

.dialog {
  width: min(520px, 100%);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 22px;
}

.dialog h2 {
  margin-bottom: 12px;
  font-size: 1.45rem;
  line-height: 1.12;
}

.dialog label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.dialog textarea {
  width: 100%;
  resize: vertical;
  border: 2px solid rgba(0, 166, 81, 0.35);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.4;
  padding: 12px;
}

.dialog input {
  width: 100%;
  min-height: 44px;
  margin-bottom: 14px;
  border: 2px solid rgba(0, 166, 81, 0.35);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
}

.report-dialog textarea {
  margin-bottom: 4px;
}

.dialog .checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
}

.dialog .checkbox-field input {
  width: 22px;
  height: 22px;
  min-height: 0;
  margin: 0;
  accent-color: var(--ready);
}

.form-message {
  margin: 12px 0 0;
  border-radius: 7px;
  padding: 10px 12px;
}

.form-message.error {
  background: #fff3f2;
  color: #8a1710;
}

.report-overview {
  margin-top: 28px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  padding: 18px;
}

.report-overview-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.report-overview-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
}

.report-overview-actions {
  display: flex;
  gap: 8px;
}

.report-overview-actions .primary {
  border-color: var(--ready);
  background: var(--ready);
  color: #ffffff;
}

.report-overview-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.report-group {
  border: 1px solid rgba(16, 21, 18, 0.24);
  border-radius: 8px;
  overflow: hidden;
}

.report-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #101512;
  color: #ffffff;
  padding: 10px 12px;
}

.report-group-title h3 {
  margin: 0;
  font-size: 1rem;
}

.report-group-title span,
.report-entry time {
  font-size: 0.84rem;
}

.report-list {
  display: grid;
}

.report-entry {
  display: grid;
  grid-template-columns: 145px minmax(160px, 0.7fr) minmax(280px, 1.3fr);
  gap: 14px;
  align-items: start;
  border-top: 1px solid rgba(16, 21, 18, 0.14);
  padding: 12px;
}

.report-entry:first-child {
  border-top: 0;
}

.report-entry dl,
.report-entry dd {
  margin: 0;
}

.report-entry dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(180px, 1fr);
  gap: 12px;
}

.report-entry dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-entry dd {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.report-empty-bar,
.empty-reports {
  margin: 0;
  color: var(--muted);
  padding: 12px;
}

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

.dialog-actions .primary {
  border-color: #101512;
  background: var(--ready);
  color: #ffffff;
}

@media (max-width: 1200px) {
  .city-grid {
    grid-template-columns: repeat(3, minmax(250px, 1fr));
  }
}

@media (max-width: 900px) {
  .summary,
  .city-grid,
  .single-city {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .report-overview-heading,
  .report-overview-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .report-entry,
  .report-entry dl {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary,
  .city-grid,
  .single-city {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.25rem;
  }
}
