:root {
  --green: #00875a;
  --green-light: #e6f4f0;
  --green-dark: #006644;
  --red: #de350b;
  --red-light: #ffebe6;
  --grey: #6b778c;
  --grey-light: #f4f5f7;
  --border: #dfe1e6;
  --text: #172b4d;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f5f7;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

.logo-icon {
  background: var(--green);
  color: white;
  font-size: 28px;
  font-weight: bold;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo h1 { font-size: 20px; font-weight: 700; }
.logo p { font-size: 13px; color: var(--grey); }

/* Badge */
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.badge--ok { background: var(--green-light); color: var(--green-dark); }
.badge--warn { background: #fff3cd; color: #856404; }
.badge--error { background: var(--red-light); color: var(--red); }

/* Card */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.card-header h2 { font-size: 16px; font-weight: 600; }
.toggle-icon { color: var(--grey); transition: transform 0.2s; }
.toggle-icon.collapsed { transform: rotate(-90deg); }

.card-body {
  padding: 0 20px 20px;
}

.card-body.hidden { display: none; }

hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Form */
.field-group {
  margin-bottom: 14px;
}

.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.field-group small {
  display: block;
  font-size: 12px;
  color: var(--grey);
  margin-bottom: 6px;
}

.optional { font-weight: 400; color: var(--grey); }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

input:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-light);
}

textarea { resize: vertical; }
code { background: var(--grey-light); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Buttons */
.btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--secondary {
  background: var(--grey-light);
  color: var(--text);
  border: 1px solid var(--border);
  display: inline-block;
  padding: 7px 14px;
}

.btn--secondary:hover { background: var(--border); }

.btn--outline {
  background: white;
  color: var(--green);
  border: 1px solid var(--green);
}

.btn--outline:hover { background: var(--green-light); }

.btn--danger {
  background: transparent;
  color: var(--red);
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
}

.btn--danger:hover { background: var(--red-light); }

/* Bild-Upload */
.bild-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 8px;
}

#bild-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.bild-placeholder {
  color: var(--grey);
  font-size: 13px;
  margin-bottom: 10px;
}

/* Meldungen */
.msg {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}
.msg--ok { background: var(--green-light); color: var(--green-dark); }
.msg--err { background: var(--red-light); color: var(--red); }

/* Tabelle */
.leer-hinweis { color: var(--grey); font-size: 14px; padding: 8px 0; }

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

.dienste-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--grey);
  padding: 6px 8px;
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dienste-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--grey-light);
  vertical-align: middle;
}

.dienste-table tr:last-child td { border-bottom: none; }
.dienste-table tr.vergangen { opacity: 0.55; }

.status-icon { font-size: 16px; }

.status-ok { color: var(--green); }
.status-wait { color: #ff8b00; }
.status-err { color: var(--red); }
