/* Kabutschi · Eltern-Dashboard */
:root {
  --bg: #eef1f7;
  --card: #fff;
  --text: #1a2332;
  --muted: #5a6578;
  --accent: #3d6eb5;
  --accent-soft: #e8eef8;
  --accent-2: #5b8fd4;
  --border: rgba(26, 35, 50, 0.1);
  --ok: #1a7f4b;
  --warn: #b45309;
  --radius: 16px;
  --shadow: 0 10px 36px rgba(26, 35, 50, 0.07);
}

* { box-sizing: border-box; }

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

.eltern-app { max-width: 960px; margin: 0 auto; padding: 0 1rem 2.5rem; }

.eltern-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.75rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
}

.eltern-brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.eltern-brand span { color: var(--accent); font-weight: 700; }

.eltern-lead {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.92rem;
  max-width: 36rem;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}

.btn-ghost:hover { background: var(--card); color: var(--text); }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 1rem;
  margin: 0 0 0.55rem;
  font-weight: 700;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.panel-head h2 { margin: 0; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
}

button {
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font-size: 0.92rem;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  margin-top: 0.5rem;
  margin-right: 0.35rem;
  font-weight: 600;
}

button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

button:disabled { opacity: 0.55; cursor: default; }
button.small-pad { padding: 0.35rem 0.6rem; font-size: 0.82rem; margin-top: 0.25rem; }

.msg { font-size: 0.88rem; margin-top: 0.5rem; min-height: 1.25rem; }
.msg.err { color: #b42318; font-weight: 600; }
.msg.ok { color: var(--ok); }
.muted { color: var(--muted); font-size: 0.9rem; }
.hidden { display: none !important; }

.kinder-progress-preview {
  margin-top: 0.75rem;
}
.kinder-progress-preview .summary-cards {
  margin-bottom: 0.35rem;
}
.kinder-progress-preview .meta-line {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.panel.msg.err {
  border: 1px solid #fecdca;
  background: #fef3f2;
  color: #b42318;
}

/* Kind-Auswahl */
.eltern-child-bar {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.85rem;
  scrollbar-width: thin;
}

.child-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  margin: 0;
}

.child-pill.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.child-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.child-pill-dot.is-pending { background: var(--warn); }
.child-pill-dot.is-inactive { background: #cbd5e1; }

/* Tabs */
.eltern-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.eltern-tab-btn {
  flex: 1 1 auto;
  min-width: 5.5rem;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.eltern-tab-btn.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(61, 110, 181, 0.25);
}

.eltern-tab { display: none; }
.eltern-tab.is-active { display: block; }

.eltern-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 640px) {
  .eltern-grid-2 { grid-template-columns: 1fr; }
}

/* Kinder-Karten */
.siblings-list { list-style: none; padding: 0; margin: 0; }

.sibling-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 0.55rem;
  background: linear-gradient(145deg, #fff 0%, #fafbfd 100%);
}

.sibling-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }

.sibling-name { font-weight: 700; font-size: 1rem; margin: 0; }
.sibling-meta { font-size: 0.84rem; color: var(--muted); grid-column: 1 / -1; }

.sibling-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  align-self: start;
}

.sibling-status.is-pending { background: #fef3c7; color: #92400e; }
.sibling-status.is-inactive { background: #fde8e8; color: #9b1c1c; }

.sibling-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

button.btn-danger {
  background: #fef3f2;
  color: #b42318;
}

button.btn-danger:hover { background: #fee4e2; }

.eltern-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  max-width: min(92vw, 420px);
  box-shadow: var(--shadow);
}

.eltern-dialog::backdrop {
  background: rgba(26, 35, 50, 0.35);
}

.eltern-dialog h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.dialog-actions button { margin-top: 0; }

.add-child-box {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px dashed rgba(61, 110, 181, 0.35);
}

.sibling-plan-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.55rem 0; }

.sibling-plan-btn {
  flex: 1 1 9rem;
  padding: 0.55rem 0.65rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  margin: 0;
  color: var(--text);
}

.sibling-plan-btn.is-selected {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent);
}

/* Koppeln */
.pair-box {
  text-align: center;
  padding: 1rem;
  border-radius: 14px;
  background: var(--accent-soft);
  margin-top: 0.65rem;
}

.pair-code {
  font-size: 2.2rem;
  letter-spacing: 0.28em;
  font-weight: 800;
  color: var(--accent);
  margin: 0.35rem 0;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 0.35rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Prüfungskalender */
.exam-calendar-wrap { margin-bottom: 1rem; }

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

.exam-cal-nav h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.exam-cal-nav button {
  margin: 0;
  padding: 0.35rem 0.65rem;
  background: var(--accent-soft);
  color: var(--accent);
}

.exam-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  font-size: 0.78rem;
}

.exam-cal-dow {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  padding: 0.25rem 0;
  font-size: 0.72rem;
}

.exam-cal-day {
  aspect-ratio: 1;
  min-height: 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid transparent;
  position: relative;
  padding: 0.15rem;
}

.exam-cal-day.is-other { opacity: 0.35; }
.exam-cal-day.is-today { border-color: var(--accent); font-weight: 700; }
.exam-cal-day.has-exam { background: var(--accent-soft); cursor: pointer; }
.exam-cal-day.has-exam.is-ka { background: #fde8f0; }
.exam-cal-day.has-exam.is-test { background: #fff8e6; }

.exam-cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 1px;
}

.exam-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.exam-cal-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.exam-cal-legend .leg-ka::before { background: #e04d8b; }
.exam-cal-legend .leg-test::before { background: #e6a01a; }

.exam-schedule-list { list-style: none; padding: 0; margin: 0; }

.exam-schedule-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.exam-schedule-item:last-child { border-bottom: none; }

.exam-schedule-when { font-weight: 700; color: var(--accent); margin-left: 0.25rem; }
.exam-schedule-meta { font-size: 0.86rem; color: var(--muted); margin-top: 0.15rem; }
.exam-schedule-del { margin-top: 0.35rem; }

.exam-form-row { margin-top: 0.55rem; }

.exam-topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  max-height: 9rem;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.exam-topic-chk {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.exam-schedule-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Dashboard-Inhalte */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.card {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.card-label { display: block; font-size: 0.75rem; color: var(--muted); }
.card-sub { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.35rem;
  text-align: left;
}

.month-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.08rem 0.35rem;
  border-radius: 6px;
  margin-left: 0.25rem;
}

.budget-progress-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
  border: 1px solid var(--border);
}

.budget-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.ka-history-list { display: flex; flex-direction: column; gap: 0.55rem; }

.ka-history-entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.55);
}

.weak-list { list-style: none; padding: 0; margin: 0; }

.weak-list li {
  margin-bottom: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
}

.weak-item-low { background: rgba(253, 232, 232, 0.65); }
.weak-item-mid { background: rgba(254, 243, 199, 0.45); }
.weak-item-ok { background: rgba(220, 252, 231, 0.55); }

.weak-tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.82rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: #fde8e8;
  color: #9b1c1c;
}

.weak-tag.low { background: #fde8e8; color: #9b1c1c; }
.weak-tag.mid { background: #fef3c7; color: #92400e; }
.weak-tag.ok { background: #dcfce7; color: #166534; }

.subject-blocks { display: flex; flex-direction: column; gap: 0.85rem; }

.subject-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.45);
}

.subject-block-head {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.subject-block-head strong { color: var(--text); }

.subject-problems {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.6rem;
  background: #fde8e8;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #7f1d1d;
}

.subject-problems strong { color: #991b1b; }

.topic-table { margin-top: 0.35rem; font-size: 0.88rem; }

.topic-table .topic-row-massiv { background: rgba(254, 226, 226, 0.55); }
.topic-table .topic-row-weak { background: rgba(254, 243, 199, 0.45); }
.topic-table .topic-row-ok { background: rgba(220, 252, 231, 0.45); }

.topic-tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.08rem 0.38rem;
  border-radius: 6px;
  white-space: nowrap;
}

.topic-tag--ok { background: #dcfce7; color: #166534; }
.topic-tag--ueben { background: #fef3c7; color: #92400e; }
.topic-tag--massiv { background: #fde8e8; color: #9b1c1c; }
.topic-tag--wenig { background: #eef2f7; color: #475569; }

.eltern-foot {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.eltern-foot a { color: var(--accent); }

a { color: var(--accent); }

details > summary { cursor: pointer; font-weight: 600; }

.collapsible-section summary {
  list-style: none;
  font-size: 0.92rem;
  color: var(--accent);
}

.collapsible-section summary::-webkit-details-marker { display: none; }
