
/* Allgemein */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

/* Layout */
main {
  display: flex;
  height: calc(100vh - 70px);
}

#map {
  flex: 2;
}

/* Sidebar */
aside {
  flex: 1;
  max-width: 400px;
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #e5e5ea;
  padding: 1rem;
}

aside h3 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

aside button {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.1s;
}

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

.btn-primary {
  background: #007aff;
  color: #fff;
}

.btn-primary:hover {
  background: #0066d6;
}

.btn-secondary {
  background: #f2f2f7;
  color: #1d1d1f;
}

.btn-danger {
  background: #ff3b30;
  color: #fff;
}

/* Orders Liste */
.order {
  background: #f9f9fb;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: background 0.2s;
}

.order:hover {
  background: #f2f2f7;
}

.order b {
  font-weight: 600;
  font-size: 1rem;
}

.order small {
  color: #6e6e73;
  font-size: 0.8rem;
}

.ku-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.ku-badge.green { background: #e6f9ed; color: #2e865f; }
.ku-badge.gray { background: #f2f2f7; color: #6e6e73; }
.ku-badge.red { background: #fdecea; color: #d93025; }

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.hidden {
  display: none !important;
}

/* Formulare */
form label {
  display: block;
  margin: 0.5rem 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

form input, form textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  font-family: inherit;
  box-sizing: border-box;
}

form textarea {
  min-height: 80px;
  resize: vertical;
}

.textarea-full {
  width: 100%;
  min-height: 200px;
  padding: 0.8rem;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Tabs im Detail-Modal */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 8px;
  background: #f2f2f7;
  cursor: pointer;
  font-weight: 500;
}

.tab-btn.active {
  background: #007aff;
  color: #fff;
}

.tab-content {
  display: block;
  margin-bottom: 1rem;
}

.tab-content.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 900px) {
  main {
    flex-direction: column; /* Karte über Liste */
  }

  #map {
    height: 300px; /* Fixe Höhe für Karte auf Handy */
    flex: none;
  }

  aside {
    max-width: 100%;
    border-left: none;
    border-top: 1px solid #e5e5ea;
    padding: 1rem;
  }

  .order {
    padding: 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    height: auto;
    max-height: 90vh;
    border-radius: 12px;
    padding: 1.5rem;
  }

  form input, form textarea {
    font-size: 1rem;
    padding: 0.8rem;
  }

  .btn {
    font-size: 1rem;
    padding: 0.8rem 1rem;
  }
}
