/* Familienplaner — Desktop-first, klar, wenig Deko */

:root {
  --firma: #b8860b;
  --firma-bg: #fff8e1;
  --familie: #2e7d32;
  --familie-bg: #e8f5e9;
  --metime: #6a1b9a;
  --metime-bg: #f3e5f5;
  --bg: #fafafa;
  --card: #fff;
  --text: #222;
  --muted: #666;
  --border: #e0e0e0;
  --accent: #0b3d91;
  --danger: #c62828;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 10;
}
header .wrap { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.2em; font-weight: 600; text-decoration: none; color: var(--text); }
header nav a {
  margin-left: 20px; text-decoration: none; color: var(--muted); font-size: .95em;
}
header nav a:hover { color: var(--accent); }

main { padding: 24px 0 80px; }

h1 { margin: 0 0 16px; font-size: 1.6em; }
h2.bereich-header {
  margin: 32px 0 12px; padding: 8px 14px; border-radius: 6px;
  font-size: 1.15em; display: flex; align-items: center; justify-content: space-between;
}
.bereich-count { font-size: .85em; font-weight: 400; opacity: .8; }
h2.bereich-firma { background: var(--firma-bg); color: var(--firma); }
h2.bereich-familie { background: var(--familie-bg); color: var(--familie); }
h2.bereich-metime { background: var(--metime-bg); color: var(--metime); }
h3.ort-header {
  margin: 16px 0 6px; font-size: .95em; color: var(--muted);
  font-weight: 500; text-transform: none;
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 20px; margin-bottom: 20px;
}
.card.hero h1 { margin-top: 0; }
.card.empty { text-align: center; color: var(--muted); }

.filter { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-row .label {
  min-width: 80px; font-size: .9em; color: var(--muted); font-weight: 500;
}
.chip {
  display: inline-block; padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: #f5f5f5; color: var(--text);
  text-decoration: none; font-size: .88em; cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.chip-firma.active { background: var(--firma); border-color: var(--firma); }
.chip.chip-familie.active { background: var(--familie); border-color: var(--familie); }
.chip.chip-metime.active { background: var(--metime); border-color: var(--metime); }

.stats {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: .9em; color: var(--muted);
}
.stats .chip-firma { color: var(--firma); }
.stats .chip-familie { color: var(--familie); }
.stats .chip-metime { color: var(--metime); }
.stats .done { color: var(--familie); font-weight: 500; }

.progress-wrap { margin: 0 0 16px; }
.progress-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 1em; margin-bottom: 6px;
}
.progress-head strong { font-size: 1.4em; color: var(--accent); }
.progress-head .muted { color: var(--muted); font-size: .9em; }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  background: #eef2f7; color: var(--muted); font-size: .82em;
}
.pill.done { background: var(--familie-bg); color: var(--familie); font-weight: 500; }
.progress-bar {
  height: 10px; background: #eef2f7; border-radius: 5px; overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--familie), #66bb6a);
  transition: width .3s ease;
}
.verlauf {
  display: flex; align-items: flex-end; gap: 3px;
  height: 40px; padding: 4px 0;
}
.verlauf-bar {
  flex: 1; min-height: 4px; background: #c8e6c9; border-radius: 2px 2px 0 0;
  opacity: .8; transition: opacity .15s;
}
.verlauf-bar:hover { opacity: 1; }
.verlauf-bar.today { background: var(--familie); }

details > summary { cursor: pointer; user-select: none; }
details > summary::marker { color: var(--muted); }

.neu-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.neu-form input[type=text], .neu-form textarea, .neu-form select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 1em; font-family: inherit; background: #fff;
}
.neu-form input[type=text]:focus, .neu-form textarea:focus, .neu-form select:focus {
  outline: none; border-color: var(--accent);
}
.neu-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px;
}
.neu-form button, .edit-form button {
  padding: 9px 18px; background: var(--accent); color: #fff;
  border: none; border-radius: 5px; cursor: pointer; font-size: .95em;
}
.neu-form button:hover { background: #092e70; }
button.danger { background: var(--danger) !important; }

.task-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.kanban {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px; align-items: start;
}
.kanban-col { min-width: 0; }
.kanban-col .bereich-header { margin-top: 0; }
.tile-grid {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 0;
}
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 0; overflow: hidden;
}
.tile[open] { box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.tile-head {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  gap: 2px 10px; padding: 10px 14px; cursor: pointer; user-select: none;
  list-style: none; align-items: center;
}
.tile-head::-webkit-details-marker { display: none; }
.tile-head::marker { display: none; content: ''; }
.tile-title { font-weight: 500; font-size: .98em; }
.tile-meta { font-size: .8em; color: var(--muted); white-space: nowrap; }
.tile-progress {
  grid-column: 1 / -1; height: 3px; background: #eef2f7; border-radius: 2px;
  overflow: hidden; display: block;
}
.tile-progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--familie), #81c784);
  transition: width .3s ease;
}
.tile-quickadd {
  display: flex; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--border);
  background: #fafafa;
}
.tile-quickadd input[type=text] {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px;
  font-size: .9em; background: #fff;
}
.tile-quickadd input[type=text]:focus { outline: none; border-color: var(--accent); }
.tile-quickadd button {
  padding: 6px 14px; background: var(--accent); color: #fff; border: none;
  border-radius: 4px; cursor: pointer; font-size: 1.1em; line-height: 1;
}
.tile-tasks { display: flex; flex-direction: column; padding: 4px 0; }
.tile-tasks .task {
  border: none; border-top: 1px solid #f0f0f0; border-radius: 0;
  padding: 8px 14px;
}
.tile-tasks .task:first-child { border-top: none; }
.task {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 14px;
}
.task.done { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }

.check-form { margin: 0; }
.check {
  background: none; border: 2px solid var(--border); border-radius: 4px;
  width: 24px; height: 24px; padding: 0; cursor: pointer;
  font-size: 14px; line-height: 1; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.check:hover { border-color: var(--familie); color: var(--familie); }
.task.done .check { background: var(--familie); color: #fff; border-color: var(--familie); }

.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 1em; word-break: break-word; }

.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  background: #f0f0f0; color: var(--muted); font-size: .8em;
}
.badge.blocker { background: #ffebee; color: var(--danger); }
.badge.link { background: #e3f2fd; color: #1565c0; }
.badge.notiz { cursor: help; }

.task-actions { margin-left: auto; }
.task-actions > summary {
  padding: 4px 10px; color: var(--muted); font-size: 1.3em; line-height: 1;
  list-style: none;
}
.task-actions > summary::-webkit-details-marker { display: none; }
.task-actions[open] {
  flex: 100%; margin: 8px 0 0; padding: 12px; background: #fafafa;
  border-top: 1px solid var(--border); border-radius: 5px;
}
.edit-form { display: flex; flex-direction: column; gap: 8px; }
.edit-form input, .edit-form textarea, .edit-form select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px;
  font-size: .95em; font-family: inherit;
}
.edit-actions { display: flex; gap: 8px; margin-top: 4px; }

@media (max-width: 700px) {
  .filter-row .label { min-width: 60px; font-size: .85em; }
  .chip { padding: 4px 10px; font-size: .82em; }
  .wrap { padding: 0 12px; }
  .card { padding: 14px; }
  .neu-grid { grid-template-columns: 1fr 1fr; }
  .tile-grid { grid-template-columns: 1fr; gap: 10px; }
}
