/* Minimale Basis-Gestaltung für die Anmeldung. Die vollständige Oberfläche folgt mit WP-12. */
:root {
  --green-900: #12301f;
  --green-700: #1f4d33;
  --gold-500: #b8962e;
  --bg: #f6f4ee;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #5b5b55;
  --danger: #a32323;
  --ok: #1f6b3a;
  --radius: 16px;
  --green-100: #e4f1e8;
  --line: #dfe5df;
  --shadow: 0 1px 2px rgba(18,48,31,.08), 0 6px 18px rgba(18,48,31,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101612;
    --surface: #18211b;
    --text: #ecebe4;
    --muted: #a7a79d;
    --danger: #ff8a8a;
    --ok: #7fd49a;
    --green-100: #223a2b;
    --line: #2b3a30;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
header { background: linear-gradient(90deg, rgba(10,35,20,.88), rgba(18,48,31,.55)), url(/images/header.jpg) center/cover, linear-gradient(135deg, #12301f, #2a5a3a 60%, #3d6b2f); color: #fff; padding: 20px 16px 36px; display: flex; align-items: center; gap: 14px; border-bottom: 3px solid var(--gold-500); }
header img { height: 64px; width: auto; border-radius: 8px; }
header .home-link { display: flex; align-items: center; gap: 14px; min-width: 0; color: inherit; text-decoration: none; }
header .brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
header .title { font: 700 1.5rem/1.15 Georgia, "Palatino Linotype", "Times New Roman", serif; letter-spacing: .2px; }
header .subtitle { font: 400 1rem Georgia, "Times New Roman", serif; opacity: .9; }
main { max-width: 34rem; margin: -20px auto 24px; padding: 0 16px; }
main:focus { outline: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; color: var(--green-700); }
p { margin: 0 0 12px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], select, textarea { width: 100%; padding: 12px; font-size: 1rem; border: 1px solid #8a8a80; border-radius: 8px; background: var(--surface); color: var(--text); font-family: inherit; min-height: 44px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; margin-right: 8px; vertical-align: middle; accent-color: var(--green-700); }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { font-weight: 400; display: flex; align-items: center; min-height: 44px; }
fieldset { border: 1px solid #c9c9bf; border-radius: 8px; padding: 12px; margin: 0; }
legend { padding: 0 6px; }
select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
button, .button { display: inline-block; padding: 12px 18px; font-size: 1rem; border: 0; border-radius: 8px; background: var(--green-700); color: #fff; cursor: pointer; text-decoration: none; min-height: 44px; }
button.secondary, .button.secondary { background: transparent; color: var(--green-700); border: 2px solid var(--green-700); }
@media (prefers-color-scheme: dark) { button.secondary, .button.secondary { color: var(--text); border-color: var(--text); } }
button.danger { background: var(--danger); color: #fff; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
.notice { color: var(--ok); font-weight: 600; }
.stack > * + * { margin-top: 12px; }
.codes { font: 1.05rem/1.9 ui-monospace, Consolas, monospace; columns: 2; padding: 12px; border: 2px dashed var(--gold-500); border-radius: 8px; list-style: none; margin: 12px 0; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px 4px; border-bottom: 1px solid #c9c9bf; }
table.roomy td, table.roomy th { padding-left: 14px; padding-right: 14px; }
table.roomy td:first-child, table.roomy th:first-child { padding-left: 4px; }

/* ---------- Anwendungsrahmen (WP-12): Telefon, Tablet, Desktop ---------- */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--gold-500); color: #1c1c1a; padding: 10px 14px; border-radius: 0 0 8px 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 0; }
header .header-logout { margin-left: auto; }
header .header-logout button { color: #fff; border-color: #fff; min-height: 40px; padding: 6px 14px; }
.shell { display: block; }
.icon { flex: none; }
.badge { background: var(--gold-500); color: #1c1c1a; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1; padding: 3px 6px; min-width: 20px; text-align: center; }

/* Startseite: Begrüßung, Raster, Terminzeilen, Geburtstage (nach Vorlage der Beispielbilder) */
.greeting { display: flex; align-items: center; gap: 14px; }
.greeting .icon { width: 44px; height: 44px; color: #e0a800; stroke-width: 1.5; }
.greeting h1 { margin: 0; }
.greeting p { margin: 0; }
.greeting-edit { margin-left: auto; color: var(--green-700); font-weight: 600; }
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.dash-grid > .card { margin-bottom: 0; }
.event-list, .birthday-list { list-style: none; margin: 0; padding: 0; }
.event-list li, .birthday-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.event-list li + li, .birthday-list li + li { border-top: 1px solid var(--line); }
.date-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; padding: 4px 6px; border-radius: 10px; background: var(--green-100); color: var(--green-700); line-height: 1.1; }
.date-chip strong { font-size: 1.35rem; }
.date-chip small { font-size: .7rem; text-transform: uppercase; }
.event-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.event-main a { color: var(--text); text-decoration: none; }
.pill { margin-left: auto; padding: 6px 12px; border-radius: 8px; background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.pill-ok { background: var(--green-100); color: var(--ok); font-weight: 600; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--green-100); color: var(--green-700); font-weight: 700; }
.birthday-list li { padding: 8px 10px; border-radius: 10px; }
.birthday-list li div { display: flex; flex-direction: column; }
.birthday-list li.soon { background: #fdf1cf; color: #1c1c1a; }
.birthday-list li.soon .muted { color: #5b5b55; }
.card-link { display: inline-block; color: var(--green-700); font-weight: 600; text-decoration: none; }
@media (prefers-color-scheme: dark) { .card-link, .greeting-edit, h2 { color: var(--ok); } .date-chip, .avatar { color: var(--ok); } }

/* Telefon: Leiste unten, Inhalt mit Platz darunter */
.sidebar { display: none; }
.bottomnav { display: none; }
.has-nav .bottomnav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--green-900); border-top: 3px solid var(--gold-500); padding-bottom: env(safe-area-inset-bottom); }
.has-nav .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 2px; color: #e8efe9; text-decoration: none; font-size: .72rem; }
.has-nav .bottomnav a[aria-current="page"] { color: var(--gold-500); font-weight: 700; }
.has-nav .bottomnav .icon-wrap { position: relative; display: inline-flex; }
.has-nav .bottomnav .badge { position: absolute; top: -6px; right: -12px; }
.has-nav .bottomnav a:focus-visible, .sidebar a:focus-visible { outline: 3px solid var(--gold-500); outline-offset: -3px; }
.has-nav main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.has-nav header .header-logout { display: none; }
header .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li + li { border-top: 1px solid #c9c9bf; }
.menu-list a { display: flex; align-items: center; gap: 12px; min-height: 52px; color: inherit; text-decoration: none; }

/* Tabellen und lange Inhalte laufen auf schmalen Bildschirmen nicht über */
main { overflow-wrap: anywhere; }
table { display: block; overflow-x: auto; }

/* Tablet (ab 768 px): Seitenleiste statt unterer Leiste */
@media (min-width: 768px) {
  .has-nav .bottomnav { display: none; }
  .has-nav header .header-logout { display: block; }
  .has-nav .shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; min-height: calc(100vh - 72px); }
  .has-nav .sidebar { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; padding: 16px 10px; min-height: calc(100vh - 72px); background: var(--green-900); }
  .sidebar a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: 10px; color: #e8efe9; text-decoration: none; }
  .sidebar a:hover { background: rgba(255,255,255,.1); }
  .sidebar a[aria-current="page"] { background: #2f7d4b; color: #fff; font-weight: 600; }
  .sidebar .badge { margin-left: auto; }
  .has-nav main { max-width: 48rem; margin: -20px 0 24px; padding: 0 24px 24px; }
  header .title { font-size: 2rem; }
  header img { height: 80px; }
}

/* Desktop (ab 1024 px): breitere Seitenleiste, mehr Platz für Inhalt */
@media (min-width: 1024px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid .card-events { grid-column: 1 / -1; }
  .has-nav .shell { grid-template-columns: 250px minmax(0, 1fr); }
  .has-nav main { max-width: 60rem; padding: 0 32px 32px; margin-left: 0; }
}
@media (min-width: 1440px) {
  .has-nav main { max-width: 68rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* ---------- Neugestaltung nach Vorlage: Seitenleiste mit Logo, Kopfbereich, Kacheln, Karten ---------- */
.content { min-width: 0; }
.hero-tools, .side-brand, header .sub-long { display: none; }
.side-sep { border: 0; border-top: 1px solid rgba(255,255,255,.14); margin: 10px 6px; width: calc(100% - 12px); }

.greeting-card { padding: 22px; }
.greeting-card .greeting { margin-bottom: 18px; }
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--green-100); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.stat:hover { box-shadow: var(--shadow); }
.stat .icon { width: 40px; height: 40px; color: var(--green-700); stroke-width: 1.4; }
.stat strong { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat small { display: block; color: var(--muted); font-size: .9rem; line-height: 1.2; }

.dash { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); margin-bottom: 20px; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-main > .card, .dash-side > .card, .dash-pair > .card, .dash > .card { margin-bottom: 0; }
.dash-pair { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 1.15rem; color: var(--text); }
.card-head h2 .icon { color: var(--green-700); }
.card-head .card-link { font-size: .92rem; white-space: nowrap; }
.count-badge { margin-left: 4px; min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--green-700); color: #fff; font-size: .85rem; text-align: center; }
.date-card { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; }
.date-card .icon { color: var(--green-700); }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.news-list li + li { border-top: 1px solid var(--line); }
.news-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; border: 2px solid var(--line); }
.news-list li.unread .news-dot { background: var(--ok); border-color: var(--ok); }
.news-list a { color: var(--text); text-decoration: none; }
.event-list li { flex-wrap: wrap; }
.event-main { overflow-wrap: break-word; min-width: 9rem; }
.event-main .muted .icon { width: 15px; height: 15px; margin-right: 5px; vertical-align: -2px; }
.quick h2 { color: var(--text); }
.quick h2 .icon { color: var(--green-700); }
.quick-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.quick-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 16px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); color: var(--green-700); font-weight: 600; text-align: center; text-decoration: none; }
.quick-grid a:hover { background: var(--green-100); }
.quick-grid .icon { width: 34px; height: 34px; stroke-width: 1.5; }
@media (prefers-color-scheme: dark) { .quick-grid a, .stat .icon, .card-head h2 .icon, .date-card .icon { color: var(--ok); } }

@media (min-width: 768px) {
  .has-nav .shell { grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
  .has-nav .sidebar { top: 0; height: 100vh; min-height: 0; overflow-y: auto; padding: 18px 12px; background: linear-gradient(180deg, #0f2a1a, #12301f 60%, #0d2416); border-right: 1px solid rgba(255,255,255,.06); }
  .side-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 20px; color: #fff; text-decoration: none; font: 400 1.15rem Georgia, "Times New Roman", serif; }
  .side-brand img { height: 92px; width: auto; padding: 6px; border-radius: 14px; background: #fff; }
  .sidebar a { min-height: 46px; border-radius: 12px; }
  .sidebar a[aria-current="page"] { background: #2f7d4b; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
  .has-nav header { position: relative; align-items: flex-start; min-height: 190px; padding: 34px 36px 76px; border-bottom: 0;
    background: radial-gradient(circle at 86% 40%, rgba(255,255,255,.1) 0 40px, transparent 41px 62px, rgba(255,255,255,.08) 63px 66px, transparent 67px 90px, rgba(255,255,255,.07) 91px 94px, transparent 95px),
      linear-gradient(90deg, rgba(10,35,20,.9), rgba(18,48,31,.55)), url(/images/header.jpg) center/cover, linear-gradient(135deg, #12301f, #2a5a3a 60%, #3d6b2f); }
  .has-nav header .home-link img { display: none; }
  .has-nav header .title { font-size: 2.7rem; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
  .has-nav header .sub-short { display: none; }
  .has-nav header .sub-long { display: inline; }
  .has-nav header .subtitle { font-size: 1.3rem; margin-top: 4px; }
  .has-nav .hero-tools { display: flex; align-items: center; gap: 14px; margin-left: auto; }
  .hero-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; }
  .hero-bell .icon { width: 24px; height: 24px; }
  .hero-dot { position: absolute; top: 8px; right: 9px; width: 11px; height: 11px; border-radius: 50%; background: #e5372f; border: 2px solid #1d4a2f; }
  .hero-user { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; }
  .hero-avatar { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--green-700); font-weight: 700; }
  .has-nav header .header-logout button { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
  .has-nav main { max-width: none; margin: -52px 0 0; padding: 0 32px 40px; position: relative; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .dash { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}
@media (min-width: 1360px) {
  .dash-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.stat span, .greeting-edit, .card-head .card-link { overflow-wrap: normal; }
.greeting-edit { white-space: nowrap; }
@media (max-width: 767px) {
  .stat { flex-direction: column; align-items: flex-start; gap: 6px; }
  .greeting { flex-wrap: wrap; }
  .greeting > div { flex: 1 1 12rem; min-width: 0; }
  .greeting-edit { margin-left: 58px; }
  .dash-main > .card, .dash-side > .card { padding: 16px; }
}

/* Das Attribut hidden muss auch gegen display-Regeln von Knöpfen gewinnen. */
[hidden] { display: none !important; }

/* Dokumente: Bereichsknöpfe und Detailzeilen mit den Knöpfen daneben */
.doc-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-tabs .button { flex: 1 1 200px; text-align: center; overflow-wrap: normal; hyphens: none; }
.doc-row { display: flex; gap: 12px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid #c9c9bf; padding-top: 10px; }
.doc-row .doc-info { flex: 1 1 260px; min-width: 0; display: grid; gap: 2px; }
.doc-row .doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-year > summary { cursor: pointer; padding: 6px 0; font-weight: 600; }

/* Termine: Zu-/Absage direkt in der Liste */
.rsvp { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.rsvp button { padding: 8px 14px; min-height: 40px; font-size: .95rem; }

.pager { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1rem; }
