/* Mobile-first Basis-Styling — Kalender-Styles folgen in M2 */
:root {
  --bg: #f4f4f2;
  --card: #ffffff;
  --text: #22282e;
  --muted: #6b7280;
  --accent: #2f6f4f;
  --border: #e2e2df;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.admin-link {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

h1 { font-size: 1.4rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }

.legend { list-style: none; padding: 0; margin: 0; }
.legend li { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }

.swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  vertical-align: middle;
}

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }

form label { display: block; margin-bottom: 0.25rem; font-weight: 600; }

input[type="password"], input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

.login-card { max-width: 360px; margin: 2rem auto; }
.error { color: #b3261e; }
.inline-form { display: inline; }

.link-button {
  background: none;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  text-decoration: underline;
}

.site-footer { padding: 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* --- Kalender (M2) --- */

.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.ansichten, .blaettern { display: flex; gap: 0.25rem; }

.ansichten a, .blaettern a {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.ansichten a.aktiv { background: var(--accent); color: #fff; border-color: var(--accent); }

.cal-titel { margin: 0.25rem 0 0.75rem; }

.hinweis-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}

.table-wrap { overflow-x: auto; }

table.monat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  table-layout: fixed;
  min-width: 320px;
}

table.monat th, table.monat td { border-bottom: none; text-align: center; padding: 0.2rem; }
table.monat th { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
table.monat .kw-col { width: 2rem; font-size: 0.7rem; color: var(--muted); }

table.monat td.tag { height: 3rem; vertical-align: top; }
table.monat td.tag .tag-nr {
  display: inline-block;
  min-width: 1.5rem;
  line-height: 1.5rem;
  border-radius: 50%;
  font-size: 0.9rem;
}
table.monat td.tag.heute .tag-nr { background: var(--accent); color: #fff; font-weight: 700; }
table.monat td.tag.aussen { opacity: 0.3; }
table.monat .tonnen { display: block; line-height: 1; }

table.monat.kompakt td.tag { height: 1.6rem; }
table.monat.kompakt td.tag .tag-nr { min-width: 1.1rem; line-height: 1.1rem; font-size: 0.7rem; }
table.monat.kompakt th { font-size: 0.6rem; }
table.monat.kompakt .kw-col { font-size: 0.6rem; width: 1.4rem; }

.tonne-icon { vertical-align: middle; }

.jahr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}

.mini-monat h3 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.mini-monat h3 a { color: var(--text); text-decoration: none; }

.woche-detail .zustaendig { margin: 0 0 0.5rem; font-size: 1.05rem; }
.wochen-tage { list-style: none; margin: 0; padding: 0; }
.wochen-tage li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.wochen-tage li:last-child { border-bottom: none; }
.wochen-tage li.heute { font-weight: 700; }
.wochen-tage .wt-tonnen { text-align: right; }
.wochen-tage .wt-tonne { white-space: nowrap; margin-left: 0.5rem; }
.wochen-tage .leer { color: var(--muted); }

.legende-spalten { display: flex; gap: 2rem; flex-wrap: wrap; }
.abo { margin: 0.75rem 0 0; }

/* --- Admin (M3) --- */

.admin-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-nav a {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.admin-nav a.aktiv { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-nav .inline-form { margin-left: auto; }

.meldung { border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 1rem; }
.meldung.ok { background: #e6f4ea; border: 1px solid #b7dfc2; }
.meldung.fehler { background: #fdecea; border: 1px solid #f5c6c0; color: #b3261e; }

.hint { color: var(--muted); font-size: 0.85rem; }

.drag-handle { cursor: grab; color: var(--muted); width: 1.5rem; }
tr.dragging { opacity: 0.4; }

.aktionen { white-space: nowrap; text-align: right; }

.btn-klein {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.btn-gefahr { background: #fdecea; border-color: #f5c6c0; color: #b3261e; }

.btn-sekundaer {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}

.aktionszeile { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.75rem; }

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin: 0.5rem 0; }
.checkbox-label input { width: auto; margin: 0; }

.formular input[type="color"] { padding: 0; width: 4rem; height: 2.2rem; border: 1px solid var(--border); border-radius: 6px; }

select {
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--card);
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  vertical-align: middle;
}

tr.aktuelle-woche { outline: 2px solid var(--accent); }
tr.vergangen { opacity: 0.5; }

.tausch-form { display: flex; gap: 0.4rem; align-items: center; }

.termin-neu-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.termin-neu-form input[type="date"] { width: auto; margin: 0; padding: 0.4rem; border: 1px solid var(--border); border-radius: 6px; }
.termin-neu-form label { margin: 0; }

.jahr-filter a { margin-right: 0.5rem; }
.jahr-filter a.aktiv { font-weight: 700; text-decoration: none; color: var(--text); }

.url-input { flex: 1; min-width: 240px; padding: 0.4rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; }
.vorschau-tabelle { max-height: 20rem; overflow-y: auto; }
.auto-status { margin-top: 0.5rem; }
