/* Reset & Base Styles – Mobile First (320px+) */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #2d6a4f;
  --color-primary-light: #40916c;
  --color-primary-dark: #1b4332;
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-border: #dee2e6;
  --color-error: #dc3545;
  --color-success: #198754;
  --color-warning: #ffc107;
  --color-info: #0dcaf0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --max-width: 640px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-width: 320px;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
.header {
  background-color: var(--color-primary);
  color: white;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, opacity 0.2s;
  min-height: 44px;
  min-width: 44px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background-color: var(--color-primary);
  color: white;
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
}

.btn--secondary {
  background-color: var(--color-border);
  color: var(--color-text);
}

.btn--danger {
  background-color: var(--color-error);
  color: white;
}

.btn--block {
  display: flex;
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  min-height: 44px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.2);
}

.form-control--error {
  border-color: var(--color-error);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Error messages */
.error-message {
  color: var(--color-error);
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert--error {
  background-color: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

.alert--success {
  background-color: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.alert--info {
  background-color: #cff4fc;
  color: #055160;
  border: 1px solid #b6effb;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge--offen {
  background-color: #fff3cd;
  color: #664d03;
}

.badge--bestaetigt {
  background-color: #d1e7dd;
  color: #0f5132;
}

.badge--abgesagt {
  background-color: #f8d7da;
  color: #842029;
}

.badge--abgeschlossen {
  background-color: #e2e3e5;
  color: #41464b;
}

/* Lists */
.list {
  list-style: none;
}

.list__item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.list__item:last-child {
  border-bottom: none;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--color-text-muted);
}

/* Utility */
.text-muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 2rem 1.5rem;
}

.login-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

/* Einsatz Header */
.einsatz-header__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.einsatz-header__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.einsatz-header__label {
  font-weight: 500;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.einsatz-header__value {
  font-weight: 600;
}

/* Felder */
.felder-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feld-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feld-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: var(--color-bg);
}

.feld-item__image {
  width: 100%;
}

.feld-item__image img {
  width: 100%;
  height: auto;
  display: block;
}

.btn--small {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  min-height: 36px;
  min-width: auto;
}

/* Helfer list items */
.helfer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.helfer-item__name {
  font-weight: 500;
}

.helfer-item__status {
  font-size: 0.875rem;
}

/* Radio group for voting */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  min-height: 44px;
}

.radio-option:hover {
  border-color: var(--color-primary-light);
}

.radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.radio-option__label {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Bilanz grid */
.bilanz-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.bilanz-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.bilanz-item:last-child {
  border-bottom: none;
}

.bilanz-item__label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.bilanz-item__value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Einsatz List */
.einsatz-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.einsatz-list__item {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow 0.2s, transform 0.1s;
}

.einsatz-list__item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.einsatz-list__item:active {
  transform: translateY(0);
}

.einsatz-list__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.einsatz-list__row + .einsatz-list__row {
  margin-top: 0.375rem;
}

.einsatz-list__datum {
  font-weight: 600;
  font-size: 0.9375rem;
}

.einsatz-list__hektar {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
}

.einsatz-list__actions {
  margin-top: 0.5rem;
}

/* Status actions */
.status-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Einsatz link row */
.einsatz-link-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Responsive: Tablet+ */
@media (min-width: 768px) {
  .container {
    padding: 1.5rem;
  }

  :root {
    --max-width: 720px;
  }

  .radio-group {
    flex-direction: row;
  }

  .radio-option {
    flex: 1;
  }
}
