* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #eef6ec;
  margin: 0;
  color: #1b2e1f;
  position: relative;
}

/* Landschaftsgärtnerisches Hintergrund-Overlay: Bäume/Blätter, fixiert, dezent */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(34,139,69,0.12), transparent 40%),
    radial-gradient(circle at 92% 18%, rgba(22,101,52,0.10), transparent 38%),
    radial-gradient(circle at 12% 88%, rgba(34,139,69,0.10), transparent 42%),
    radial-gradient(circle at 95% 90%, rgba(22,101,52,0.12), transparent 40%),
    linear-gradient(180deg, #eef6ec 0%, #e3f1e0 100%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-repeat: no-repeat;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='220' viewBox='0 0 180 220'%3E%3Cg fill='%2316a34a' fill-opacity='0.18'%3E%3Cellipse cx='90' cy='70' rx='65' ry='62'/%3E%3Cellipse cx='55' cy='95' rx='45' ry='42'/%3E%3Cellipse cx='125' cy='95' rx='45' ry='42'/%3E%3Crect x='80' y='110' width='20' height='90' rx='6'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='170' viewBox='0 0 140 170'%3E%3Cg fill='%2315803d' fill-opacity='0.16'%3E%3Cellipse cx='70' cy='55' rx='50' ry='48'/%3E%3Crect x='60' y='90' width='18' height='70' rx='6'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M45 5 C20 25 10 50 45 85 C80 50 70 25 45 5 Z' fill='%2322c55e' fill-opacity='0.18'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M45 5 C20 25 10 50 45 85 C80 50 70 25 45 5 Z' fill='%2316a34a' fill-opacity='0.15'/%3E%3C/svg%3E");
  background-position:
    -30px -20px,
    bottom -20px right -10px,
    top 10% right 8%,
    bottom 8% left 6%;
  background-size: 220px 270px, 180px 220px, 70px 70px, 60px 60px;
}

.hidden { display: none !important; }

#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-box {
  background: rgba(255,255,255,0.94);
  padding: 32px;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(22,101,52,0.16);
  width: 320px;
  border: 1px solid #d3e8d4;
}
.auth-box h1 { font-size: 20px; margin: 0 0 16px; text-align: center; color: #15803d; }
.tabs { display: flex; margin-bottom: 16px; border-bottom: 1px solid #d3e8d4; }
.tab {
  flex: 1; padding: 8px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: #6b8a6f; border-bottom: 2px solid transparent;
}
.tab.active { color: #15803d; border-bottom-color: #15803d; font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; color: #2f4a33; }
.auth-form input {
  padding: 8px 10px; border: 1px solid #bfdcc1; border-radius: 6px; font-size: 14px;
}
.auth-form button {
  margin-top: 8px; padding: 10px; border: none; border-radius: 6px;
  background: #15803d; color: #fff; font-size: 14px; cursor: pointer;
}
.auth-form button:hover { background: #166534; }
.error { color: #dc2626; font-size: 13px; min-height: 16px; margin: 0; }

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: rgba(255,255,255,0.92); border-bottom: 1px solid #d3e8d4;
}
header h1 { font-size: 18px; margin: 0; color: #15803d; }
.user-bar { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.user-bar button {
  padding: 6px 12px; border: 1px solid #bfdcc1; border-radius: 6px; background: #fff; cursor: pointer; color: #2f4a33;
}

.week-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 16px; font-size: 14px;
}
.week-nav button {
  padding: 6px 12px; border: 1px solid #bfdcc1; border-radius: 6px; background: #fff; cursor: pointer; color: #2f4a33;
}
#week-label { font-weight: 600; min-width: 220px; text-align: center; color: #15803d; }

.table-wrap { padding: 0 24px 32px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: max-content; min-width: 100%; border-collapse: collapse; background: rgba(255,255,255,0.96); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(22,101,52,0.08); }
th, td { padding: 8px 10px; border-bottom: 1px solid #e3efe2; font-size: 13px; text-align: center; }
th { background: #e6f4e6; font-weight: 600; white-space: nowrap; color: #15803d; }
td input {
  width: 80px; padding: 5px; border: 1px solid #cfe5cf; border-radius: 4px; font-size: 13px; text-align: center;
}
td input[type="text"].baustellenname { width: 130px; text-align: left; }
.gesamt-cell { font-weight: 700; color: #15803d; }
.pause-cell { display: flex; gap: 4px; justify-content: center; }
.pause-btn {
  width: 44px; padding: 6px 0; border: 1px solid #bfdcc1; border-radius: 4px;
  background: #fff; font-size: 12px; cursor: pointer; color: #555;
}
.pause-btn.active { background: #15803d; border-color: #15803d; color: #fff; }
tfoot td { background: #eaf6ea; padding: 10px; }

.status-cell { display: flex; gap: 4px; justify-content: center; }
.status-btn {
  width: 56px; padding: 6px 0; border: 1px solid #bfdcc1; border-radius: 4px;
  background: #fff; font-size: 12px; cursor: pointer; color: #555;
}
.status-btn.urlaub.active { background: #16a34a; border-color: #16a34a; color: #fff; }
.status-btn.krank.active { background: #ea580c; border-color: #ea580c; color: #fff; }
.status-btn.feiertag.active { background: #2563eb; border-color: #2563eb; color: #fff; }

.employee-card {
  background: rgba(255,255,255,0.96); border-radius: 8px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(22,101,52,0.08);
}
.employee-header {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px 6px 18px;
}
.employee-toggle {
  flex: 1; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border: none; background: none; cursor: pointer; font-size: 15px; font-weight: 600; text-align: left; color: #1b2e1f;
}
.employee-toggle .chevron { transition: transform 0.15s; color: #6b8a6f; font-size: 13px; }
.employee-toggle.open .chevron { transform: rotate(90deg); }
.employee-body { display: none; padding: 0 18px 18px; }
.employee-body.open { display: block; }
.delete-btn {
  padding: 6px 12px; border: 1px solid #dc2626; border-radius: 6px; background: #fff;
  color: #dc2626; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.delete-btn:hover { background: #dc2626; color: #fff; }
.week-block { margin-top: 16px; }
.week-heading { display: flex; justify-content: space-between; align-items: center; }
.week-block h3 { font-size: 13px; margin: 0 0 8px; color: #2f4a33; }
.week-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.week-block table { box-shadow: none; border: 1px solid #e3efe2; }
.week-block tfoot td { text-align: right; font-weight: 700; color: #15803d; }

.krank-panel {
  margin: 0 24px 32px; padding: 18px 20px; background: rgba(255,247,237,0.95);
  border: 1px solid #fdba74; border-radius: 10px;
}
.krank-panel h3 { margin: 0 0 12px; font-size: 15px; color: #c2410c; }
.krank-fields { display: flex; flex-wrap: wrap; gap: 16px; }
.krank-fields label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; color: #7c2d12; }
.krank-fields input {
  padding: 7px 10px; border: 1px solid #fdba74; border-radius: 6px; font-size: 14px;
}
.krank-info { margin-top: 10px; padding: 10px 14px; background: #fff7ed; border: 1px solid #fdba74; border-radius: 6px; font-size: 13px; color: #7c2d12; }
.krank-bescheinigung { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 14px; font-size: 14px; color: #7c2d12; }
.krank-bescheinigung > span { font-weight: 600; }

/* Admin: Umschalter zwischen Stunden und Benutzerverwaltung */
.admin-nav { display: flex; gap: 8px; padding: 16px 24px 0; }
.admin-tab {
  padding: 8px 16px; border: 1px solid #bfdcc1; border-radius: 6px 6px 0 0;
  background: #fff; color: #6b8a6f; font-size: 14px; cursor: pointer;
}
.admin-tab.active { background: #15803d; border-color: #15803d; color: #fff; font-weight: 600; }

.user-admin-box {
  background: rgba(255,255,255,0.96); border-radius: 8px; padding: 18px 20px;
  margin-bottom: 16px; box-shadow: 0 1px 4px rgba(22,101,52,0.08);
}
.user-admin-box h3 { margin: 0 0 14px; font-size: 15px; color: #15803d; }
.add-user-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.add-user-form label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; color: #2f4a33; }
.add-user-form input[type="text"], .add-user-form input[type="password"] {
  padding: 8px 10px; border: 1px solid #bfdcc1; border-radius: 6px; font-size: 14px;
}
.checkbox-label { flex-direction: row !important; align-items: center; gap: 6px; }
.add-user-form button {
  padding: 9px 16px; border: none; border-radius: 6px; background: #15803d; color: #fff; font-size: 14px; cursor: pointer;
}
.add-user-form button:hover { background: #166534; }

.account-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid #e3efe2; font-size: 14px;
}
.account-row:last-child { border-bottom: none; }
.account-badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }
.account-badge.admin { background: #15803d; color: #fff; }
.account-badge.user { background: #e6f4e6; color: #15803d; }
