/* Funtime Design – Farben aus Logo & Themenwochen-PDF */
:root {
  --navy: #1F416F;
  --navy-dark: #17324f;
  --lightblue: #CCEAEB;
  --teal: #9AD5DB;
  --teal-dark: #6FBFC7;
  --orange: #E6A42C;
  --red: #C0392B;
  --green: #438E20;
  --white: #ffffff;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 4px 16px rgba(31, 65, 111, 0.12);
}

* { box-sizing: border-box; }

/* Barrierefreiheit: sichtbarer Tastatur-Fokus + Skip-Link */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 0 0 10px 0;
  z-index: 100;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

body {
  margin: 0;
  font-family: 'Baloo 2', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--lightblue);
  color: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--navy);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.topbar .logo-badge {
  background: var(--white);
  border-radius: 999px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
}
.topbar .logo-badge img { height: 34px; display: block; }
.topbar .bar-title { font-size: 1.05rem; font-weight: 600; opacity: 0.95; }
.topbar .spacer { flex: 1; }
.topbar a, .topbar button.linklike {
  color: var(--white); text-decoration: none; opacity: 0.85; font-size: 0.95rem;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.topbar a:hover, .topbar button.linklike:hover { opacity: 1; text-decoration: underline; }

main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 28px 18px 60px; }
main.narrow { max-width: 720px; }

.footer {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 14px;
  font-size: 0.85rem;
  opacity: 0.95;
}

h1, h2, h3 { font-weight: 700; }
h1 { font-size: 1.7rem; margin: 0 0 6px; }
.sub { opacity: 0.75; margin-bottom: 22px; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}
.card h2 { margin-top: 0; font-size: 1.2rem; }
.card h3 { font-size: 1.02rem; margin: 18px 0 8px; }

label.field { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.95rem; }
label.field .hint, .hint { font-weight: 400; opacity: 0.65; font-size: 0.85rem; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time],
input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 5px;
  border: 2px solid var(--teal);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--white);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); }
textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 11px 26px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: var(--navy-dark); }
.btn.secondary { background: var(--teal); color: var(--navy); }
.btn.secondary:hover { background: var(--teal-dark); }
.btn.ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); padding: 9px 24px; }
.btn.danger { background: var(--red); }
.btn.small { padding: 6px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.iconbtn {
  background: var(--lightblue); border: none; border-radius: 8px; cursor: pointer;
  padding: 4px 9px; font-size: 0.9rem; color: var(--navy); font-family: inherit;
}
.iconbtn:hover { background: var(--teal); }
.iconbtn.danger { color: var(--red); }

.badge {
  display: inline-block; border-radius: 999px; padding: 3px 12px;
  font-size: 0.78rem; font-weight: 700;
}
.badge.green { background: #e3f4d9; color: var(--green); }
.badge.orange { background: #fdeed2; color: #a06a00; }
.badge.navy { background: var(--lightblue); color: var(--navy); }
.badge.red { background: #fbe3e0; color: var(--red); }

table.list { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.list th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--lightblue); font-size: 0.85rem; }
table.list td { padding: 9px 10px; border-bottom: 1px solid #e8f3f4; vertical-align: top; }

/* Tabs (Admin-Editor) */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs button {
  border: none; background: var(--white); color: var(--navy); font-family: inherit;
  padding: 9px 18px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 0.92rem;
  box-shadow: var(--shadow);
}
.tabs button.active { background: var(--navy); color: var(--white); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* Editor-Items */
.item {
  border: 2px solid var(--lightblue); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 12px; background: #fbfeff;
}
.item .item-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.item .item-head .grow { flex: 1; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.row.tight > * { min-width: 100px; }

.savebar { position: sticky; bottom: 12px; text-align: right; margin-top: 10px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: var(--white); border-radius: 999px;
  padding: 10px 26px; font-weight: 700; box-shadow: var(--shadow); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--red); }

/* Wizard (öffentliche Anmeldung) */
.steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.steps .step {
  flex: 1; min-width: 90px; text-align: center; font-size: 0.8rem; font-weight: 700;
  padding: 8px 4px; border-radius: 999px; background: var(--white); opacity: 0.55;
}
.steps .step.active { background: var(--navy); color: var(--white); opacity: 1; }
.steps .step.done { background: var(--teal); color: var(--navy); opacity: 1; }

.offer-card {
  border: 2px solid var(--teal); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; background: var(--white);
  display: block; transition: border-color 0.15s, background 0.15s;
}
.offer-card:hover { border-color: var(--navy); }
.offer-card.selected { border-color: var(--navy); background: #eef7f8; }
.offer-card.full { opacity: 0.8; }
.offer-card .offer-title { font-weight: 700; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.offer-card .offer-days { font-size: 0.85rem; opacity: 0.8; margin-top: 5px; }
.offer-card input { display: none; }

.choice { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.choice label {
  border: 2px solid var(--teal); border-radius: 999px; padding: 7px 18px;
  cursor: pointer; font-size: 0.92rem; font-weight: 600; background: var(--white);
}
.choice label.selected,
.choice label:has(input:checked) { background: var(--navy); color: var(--white); border-color: var(--navy); }
.choice input { display: none; }

.q-block { margin-bottom: 18px; }
.q-block .q-label { font-weight: 700; font-size: 0.97rem; }
.q-block .q-label .req { color: var(--red); }

.child-block { border: 2px dashed var(--teal); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; background: #fbfeff; }
.child-block h3 { margin-top: 0; display: flex; justify-content: space-between; align-items: center; }

.wizard-nav { display: flex; justify-content: space-between; margin-top: 22px; gap: 10px; }
.error-box {
  background: #fbe3e0; color: var(--red); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 14px; white-space: pre-line; font-weight: 600; font-size: 0.92rem;
  display: none;
}
.error-box.show { display: block; }

.doc-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--white); border: 2px solid var(--teal); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--navy); font-weight: 600; margin-bottom: 8px;
}
.doc-link:hover { border-color: var(--navy); }

.summary-table { width: 100%; font-size: 0.93rem; border-collapse: collapse; }
.summary-table td { padding: 6px 8px; border-bottom: 1px solid #e8f3f4; }
.summary-table td:first-child { font-weight: 700; width: 40%; }

.mailpreview {
  background: #fbfeff; border: 2px solid var(--lightblue); border-radius: var(--radius-sm);
  padding: 16px; white-space: pre-wrap; font-size: 0.9rem; font-family: inherit;
}

.bigcheck { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; cursor: pointer; }
.bigcheck input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--navy); flex-shrink: 0; }

.login-wrap { max-width: 420px; margin: 60px auto; }
.login-wrap .logo-center { text-align: center; margin-bottom: 20px; }
.login-wrap .logo-center img { height: 70px; }

.stat-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
  background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 12px 18px; font-size: 0.85rem; min-width: 150px;
}
.stat b { display: block; font-size: 1.15rem; }

.muted { opacity: 0.65; }
.mt0 { margin-top: 0; }
.copyfield { display: flex; gap: 8px; align-items: center; }
.copyfield input { flex: 1; }

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  main { padding: 18px 12px 50px; }
  .card { padding: 16px; }
}

/* --- Personaltool-Ergänzungen --- */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filterbar a {
  text-decoration: none; color: var(--navy); background: var(--white); border-radius: 999px;
  padding: 7px 16px; font-weight: 700; font-size: 0.88rem; box-shadow: var(--shadow);
}
.filterbar a.active { background: var(--navy); color: var(--white); }
.filterbar .count { opacity: 0.6; font-weight: 400; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.detail-grid .dt { font-weight: 700; font-size: 0.85rem; opacity: 0.7; margin-top: 8px; }
.detail-grid .dd { font-size: 0.95rem; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }

.audit-list { list-style: none; padding: 0; margin: 0; font-size: 0.88rem; }
.audit-list li { padding: 8px 0; border-bottom: 1px solid #e8f3f4; }
.audit-list .when { opacity: 0.6; font-size: 0.8rem; }

.status-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* hidden-Attribut muss sich gegen display-Regeln (.btn etc.) durchsetzen */
[hidden] { display: none !important; }

/* Planungs-Matrizen (Modul D) */
.matrix-wrap { overflow-x: auto; }
table.matrix { border-collapse: collapse; font-size: 0.88rem; min-width: 100%; }
table.matrix th, table.matrix td { padding: 8px 10px; border-bottom: 1px solid #e8f3f4; text-align: left; white-space: nowrap; }
table.matrix th { font-size: 0.82rem; border-bottom: 2px solid var(--lightblue); }
table.matrix td:first-child, table.matrix th:first-child { position: sticky; left: 0; background: var(--white); font-weight: 700; }
.cell { display: inline-block; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 0.82rem; text-decoration: none; }
.cell.frei { background: #fbe3e0; color: var(--red); }
.cell.teil { background: #fdeed2; color: #a06a00; }
.cell.voll { background: #e3f4d9; color: var(--green); }
.cell.leer { background: transparent; color: inherit; opacity: 0.3; font-weight: 400; }
.kandidat-score { font-size: 1.05rem; font-weight: 700; min-width: 48px; text-align: center; }
.gruende { font-size: 0.85rem; opacity: 0.75; }

/* Aufklappbare Standort-Zeilen: eingeplante Personen je KW */
.matrix-toggle { background: none; border: none; cursor: pointer; font: inherit; font-weight: 700; color: inherit; padding: 0; text-align: left; }
.matrix-toggle .pfeil { display: inline-block; width: 14px; color: var(--navy); }
.matrix-toggle:hover { color: var(--navy); }
tr.matrix-personen td { background: #f4fafb; border-bottom: 2px solid var(--lightblue); }
tr.matrix-personen td:first-child { background: #f4fafb; }
.matrix-person { font-size: 0.8rem; font-weight: 400; line-height: 1.5; white-space: nowrap; }
.matrix-person .punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.punkt.green { background: var(--green); }
.punkt.orange { background: var(--orange); }
.punkt.navy { background: var(--navy); }
.punkt.red { background: var(--red); }

/* Schichtboard-Feed (Modul H) */
.board-feed { display: flex; flex-direction: column; gap: 10px; }
.board-post { border-radius: 12px; padding: 12px 14px; background: var(--lightblue); }
.board-post.orga { background: #fdeed2; }
.board-post.system { background: #f0f0f0; font-style: italic; }
.board-post-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.85rem; }

/* Analytics-Charts (Modul J): Ein-Serien-Balken, Werte immer beschriftet */
.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hbar-label { width: 170px; min-width: 170px; text-align: right; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; background: #eef6f7; border-radius: 4px; height: 14px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--navy); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-fill.voll { background: var(--green); }
.hbar-value { min-width: 90px; font-weight: 700; font-size: 0.88rem; }

.colchart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 20px; overflow-x: auto; }
.col-item { flex: 1; min-width: 60px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.col-value { font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; }
.col-bar { display: block; width: 70%; max-width: 48px; background: var(--navy); border-radius: 4px 4px 0 0; }
.col-label { font-size: 0.78rem; opacity: 0.7; margin-top: 6px; white-space: nowrap; }
