:root {
  --accent: #7d2635;
  --accent-contrast: #ffffff;
  --bg: #faf5ec;
  --card-bg: #fffdf8;
  --card-shadow: rgba(120, 84, 32, 0.08);
  --text: #2c2417;
  --text-muted: #8a7a63;
  --border: #ece0cd;
  --danger: #b3261e;
  --radius: 16px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #d97a72;
    --accent-contrast: #2a100d;
    --bg: #17130f;
    --card-bg: #211a13;
    --card-shadow: rgba(0, 0, 0, 0.35);
    --text: #f5efe2;
    --text-muted: #b0a189;
    --border: #372c1f;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
}

.brand {
  text-align: center;
  margin-bottom: 20px;
}

.brand .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text);
}

.brand .brand-role {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 2px 4px var(--card-shadow), 0 12px 28px var(--card-shadow);
}

.hero-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-top: 20px;
  object-fit: cover;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 14px;
  line-height: 1.35;
  text-wrap: balance;
}

h1.claim {
  font-size: 1.7rem;
  line-height: 1.25;
  margin-bottom: 12px;
}

p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

textarea,
input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  margin-bottom: 6px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field {
  margin-bottom: 16px;
}

.error-text {
  color: var(--danger);
  font-size: 0.8rem;
  min-height: 1.1em;
  margin: -2px 0 10px;
}

.checkbox-field {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.checkbox-field input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-field label {
  font-weight: 400;
  font-size: 0.9rem;
  margin: 0;
}

.hint-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

button.primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 10px;
  padding: 13px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}

button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 1rem;
  cursor: pointer;
}

.thank-you {
  text-align: center;
}

.thank-you h2 {
  color: var(--accent);
}

footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
}

.form-error {
  background: rgba(179, 38, 30, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* --- Admin-Bereich --- */

.admin-wrap {
  width: 100%;
  max-width: 960px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
}

.filter-row .field {
  margin-bottom: 0;
}

.filter-row label {
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.filter-row select,
.filter-row input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 480px;
}

thead th {
  text-align: left;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

.status-select {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.status-select.status-neu {
  background: rgba(138, 122, 99, 0.18);
  color: var(--text-muted);
}

.status-select.status-kontaktiert {
  background: rgba(196, 130, 20, 0.16);
  color: #a5680f;
}

.status-select.status-termin_vereinbart {
  background: rgba(125, 38, 53, 0.14);
  color: var(--accent);
}

.status-select.status-abgeschlossen {
  background: rgba(34, 110, 70, 0.16);
  color: #1f7a4d;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.bar-row .bar-label {
  width: 90px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.bar-row .bar-track {
  flex: 1;
  height: 14px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.bar-row .bar-fill {
  height: 100%;
  background: var(--accent);
}

.bar-row .bar-count {
  width: 28px;
  text-align: right;
  color: var(--text-muted);
}

.empty-state {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px 0;
  text-align: center;
}

.login-card {
  max-width: 360px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
