/* Pilates Coaching – 10er Karten. Keine externen Abhängigkeiten, keine Inline-Styles (CSP). */

/* ---------- Tokens ---------- */
:root {
  /* Farben */
  --stone: #eeede9;        /* Seitenhintergrund, auch "durch das Loch" sichtbar */
  --paper: #ffffff;        /* Flächen */
  --ink: #23201c;          /* Text */
  --ink-2: #5d564d;        /* Nebentext */
  --line: #dedbd3;         /* Linien */
  --taupe: #afa291;        /* Markenfarbe: die Karte */
  --taupe-deep: #574c3e;   /* Buttons, Links, aktive Zustände */
  --taupe-soft: #e7e2d9;
  --spring: #2f6a55;       /* frei / bestätigt */
  --spring-soft: #e2efe8;
  --amber: #8a5b0b;
  --amber-soft: #f7ecd6;
  --red: #a1302b;
  --red-soft: #f8e5e3;
  --focus: #1f5fc4;

  /* Schrift */
  --font-display: "Avenir Next", Avenir, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --shadow: 0 1px 0 rgba(35,32,28,.04), 0 8px 24px -12px rgba(35,32,28,.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--stone); color: var(--ink);
  font: 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--taupe-deep); text-underline-offset: .18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight: 650; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; }

.eyebrow { font: 600 .72rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2); margin: 0 0 .5rem; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); letter-spacing: .04em; }
.mt { margin-top: 1rem; }
pre.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Rahmen ---------- */
.inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 600px; }
main { padding: 1.75rem 0 4rem; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap; min-height: 64px; }
.brand { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; color: var(--ink); padding: .9rem 0; }
.brand b { font: 700 .82rem/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; }
.brand span { font-size: .85rem; color: var(--ink-2); }
.brand::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--taupe); box-shadow: inset 0 0 0 3px var(--paper), 0 0 0 1.5px var(--taupe); align-self: center; }

.nav { display: flex; flex-wrap: wrap; gap: .15rem; align-items: center; }
.nav a, .nav button { position: relative; padding: .55rem .75rem; border-radius: var(--r-s); font: 500 .93rem/1 var(--font-body); color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { color: var(--ink); background: var(--stone); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: -13px; height: 2px; background: var(--ink); border-radius: 2px; }
.nav form { margin: 0 0 0 .5rem; padding-left: .5rem; border-left: 1px solid var(--line); }

.site-footer { color: var(--ink-2); font-size: .82rem; padding: 2rem 0 3rem; text-align: center; }
.site-footer a { color: inherit; }

/* ---------- Grundbausteine ---------- */
.card { background: var(--paper); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 1.35rem; margin-bottom: 1.25rem; }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-bottom: .9rem; }
.grid { display: grid; gap: 1.25rem; align-items: start; }
.grid > .card { margin-bottom: 0; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-main { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
}
.grid + .card, .grid + .grid { margin-top: 1.25rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.page-head { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.back { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .45rem 1.05rem .45rem .85rem; margin-bottom: 1rem;
  border: 1px solid #c4beb3; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: border-color .15s, background .15s; }
.back::before { content: "←"; font-size: 1.05rem; line-height: 1; }
.back:hover { border-color: var(--ink); color: var(--ink); }

.alert { border-radius: var(--r-s); padding: .85rem 1rem; margin-bottom: 1rem; border-left: 4px solid; background: var(--paper); box-shadow: var(--shadow); }
.alert-ok { border-color: var(--spring); background: var(--spring-soft); box-shadow: none; }
.alert-warn { border-color: var(--amber); background: var(--amber-soft); box-shadow: none; }
.alert-bad { border-color: var(--red); background: var(--red-soft); box-shadow: none; }
.alert-info { border-color: var(--taupe); white-space: pre-line; }

.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 999px; font: 600 .76rem/1.4 var(--font-body); background: var(--taupe-soft); color: var(--taupe-deep); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-aktiv, .badge-frei { background: var(--spring-soft); color: var(--spring); }
.badge-zukuenftig { background: #e4ebf5; color: #2a4f80; }
.badge-aufgebraucht, .badge-ausgebucht, .badge-blockiert { background: var(--amber-soft); color: var(--amber); }
.badge-abgelaufen, .badge-archiviert, .badge-storniert, .badge-gebucht, .badge-vorbei, .badge-ausserhalb { background: #ebe9e4; color: #5d564d; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
dl.facts dt { color: var(--ink-2); font-size: .9rem; }
dl.facts dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.field { margin-bottom: 1rem; }
.hint { color: var(--ink-2); font-size: .85rem; margin-top: .3rem; }
.error-text { color: var(--red); font-size: .875rem; margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: .7rem .8rem; border: 1px solid #cbc6bc; border-radius: var(--r-s); background: var(--paper); font: inherit; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #a9a294; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--taupe-deep); box-shadow: 0 0 0 3px rgba(87,76,62,.18); }
input[aria-invalid=true] { border-color: var(--red); }
textarea { min-height: 6rem; resize: vertical; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; font-size: .95rem; cursor: pointer; }
.check input { margin-top: .2rem; width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--taupe-deep); }
.check.inline { display: inline-flex; align-items: center; gap: .3rem; margin: 0 .5rem 0 0; font-size: .85rem; }
.check.inline input { margin: 0; width: 1rem; height: 1rem; }
.inline-form { display: inline; margin: 0; }
fieldset.reset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
fieldset.reset > legend { padding: 0; margin-bottom: .6rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .7rem 1.2rem; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 .95rem/1.1 var(--font-body); text-decoration: none; cursor: pointer; min-height: 44px;
  transition: background .15s, color .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--taupe-deep); border-color: var(--taupe-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-secondary { background: transparent; color: var(--ink); border-color: #c4beb3; }
.btn-secondary:hover { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-danger { background: transparent; color: var(--red); border-color: #dcb0ac; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.btn-small { padding: .35rem .8rem; min-height: 34px; font-size: .85rem; }
.btn[aria-disabled=true], .btn:disabled { opacity: .45; pointer-events: none; }

/* ---------- Signatur: die Stempelkarte ---------- */
.pass {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.28), transparent 55%),
    linear-gradient(160deg, #bbae9c 0%, var(--taupe) 45%, #a19480 100%);
  color: var(--ink); border-radius: var(--r-l); padding: 1.4rem 1.4rem 1.25rem;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 18px 40px -22px rgba(55,45,30,.55), 0 2px 6px -2px rgba(55,45,30,.25);
  margin-bottom: 1.25rem;
}
/* feine Prägung entlang des Randes */
.pass::after { content: ""; position: absolute; inset: 8px; border-radius: calc(var(--r-l) - 6px); border: 1px dashed rgba(35,32,28,.18); pointer-events: none; }
.pass-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.pass-brand { font: 700 .72rem/1.3 var(--font-display); letter-spacing: .22em; text-transform: uppercase; }
.pass-brand span { display: block; font-weight: 500; letter-spacing: .08em; text-transform: none; font-size: .8rem; opacity: .8; }
.pass .badge { background: rgba(255,255,255,.85); }
.pass-name { font: 650 1.45rem/1.15 var(--font-display); letter-spacing: -.01em; margin: 1.1rem 0 .15rem; }
.pass-number { font-family: var(--font-mono); font-size: .95rem; letter-spacing: .12em; opacity: .85; }

.holes { list-style: none; margin: 1.35rem 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem .6rem; justify-items: center; }
.hole {
  position: relative; width: 100%; max-width: 54px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  font: 600 .66rem/1.05 var(--font-body); letter-spacing: .01em;
}
/* frei: gedruckter Ring mit Feldnummer */
.hole.free { box-shadow: inset 0 0 0 1.5px rgba(35,32,28,.32); color: rgba(35,32,28,.55); font: 600 .8rem/1 var(--font-display); }
/* reserviert: weiße Marke mit Datum */
.hole.booked { background: #fff; box-shadow: 0 2px 6px -2px rgba(35,32,28,.4); color: var(--ink); }
/* genutzt: ausgestanzt – der Hintergrund scheint durch, oben liegt der Schatten der Kartenkante */
.hole.used { background: var(--stone); box-shadow: inset 0 4px 4px -1px rgba(35,32,28,.45), inset 0 -1px 0 rgba(255,255,255,.6), 0 1px 0 rgba(255,255,255,.35); }
.pass-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }
.pass-count { font: 650 1rem/1.2 var(--font-display); }
.pass-count strong { font-size: 1.6rem; letter-spacing: -.02em; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .8rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend .used { background: var(--stone); box-shadow: inset 0 1px 2px rgba(35,32,28,.45); }
.legend .booked { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.legend .free { background: var(--taupe); box-shadow: inset 0 0 0 1.5px rgba(35,32,28,.35); }

.pass.compact { padding: 1.1rem 1.1rem 1rem; }
.pass.compact .pass-name { font-size: 1.15rem; margin-top: .75rem; }
.pass.compact .holes { gap: .45rem; margin: 1rem 0 .75rem; }
.pass.compact .hole { max-width: 40px; font-size: .58rem; }

/* Einstanzen beim Laden – ein einziger, kurzer Moment */
@media (prefers-reduced-motion: no-preference) {
  .hole.used { animation: punch .45s cubic-bezier(.2,.9,.3,1.4) both; }
  .hole:nth-child(2) { animation-delay: .05s; } .hole:nth-child(3) { animation-delay: .1s; }
  .hole:nth-child(4) { animation-delay: .15s; } .hole:nth-child(5) { animation-delay: .2s; }
  .hole:nth-child(6) { animation-delay: .25s; } .hole:nth-child(7) { animation-delay: .3s; }
  .hole:nth-child(8) { animation-delay: .35s; } .hole:nth-child(9) { animation-delay: .4s; }
  .hole:nth-child(10) { animation-delay: .45s; }
  @keyframes punch { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
}

/* ---------- Terminliste (Kunden) ---------- */
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.agenda li:first-child { border-top: 0; }
.datebox { flex: none; width: 3.4rem; text-align: center; border-radius: var(--r-s); background: var(--stone); padding: .35rem 0 .4rem; line-height: 1; }
.datebox b { display: block; font: 700 1.35rem/1 var(--font-display); }
.datebox span { display: block; font: 600 .66rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-top: .25rem; }
.agenda .what strong { display: block; }
.agenda .what span { font-size: .88rem; color: var(--ink-2); }

/* ---------- Buchung: Tage mit Kurs-Kacheln ---------- */
.week { margin-bottom: 1.6rem; }
.week > h3 { font: 600 .72rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2); margin: 0 0 .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.day { display: grid; grid-template-columns: 3.4rem 1fr; gap: .9rem; margin-bottom: .9rem; align-items: start; }
.day-title { display: none; font: 650 .95rem/1.2 var(--font-display); }
.slots { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slot label { display: block; margin: 0; padding: .65rem .8rem; height: 100%; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-s);
  font-weight: 400; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.slot label:hover { border-color: var(--taupe-deep); }
.slot .time { display: block; font: 650 1.05rem/1.2 var(--font-display); }
.slot .place { display: block; font-size: .82rem; color: var(--ink-2); }
.slot .avail { display: block; margin-top: .35rem; font-size: .78rem; font-weight: 600; color: var(--spring); }
.slot .avail.low { color: var(--amber); }
.slot input:checked + label { border-color: var(--ink); background: var(--ink); color: #fff; box-shadow: 0 6px 16px -8px rgba(35,32,28,.6); }
.slot input:checked + label .place, .slot input:checked + label .avail { color: rgba(255,255,255,.8); }
.slot input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.slot input:disabled + label { cursor: default; background: transparent; border-style: dashed; color: var(--ink-2); }
.slot input:disabled + label .avail { color: var(--ink-2); font-weight: 500; }
.slot input:disabled + label:hover { border-color: var(--line); }

.confirm-bar { position: sticky; bottom: 0; z-index: 5; margin: 0 -1.35rem -1.35rem; padding: 1rem 1.35rem;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-m) var(--r-m); }
.confirm-bar .field { margin-bottom: .8rem; }

/* ---------- Tabellen (Admin) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card.table-wrap { padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid #ecebe6; vertical-align: middle; }
th { font: 600 .72rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); background: #faf9f7; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfaf8; }
td a { font-weight: 600; text-decoration: none; color: var(--ink); }
td a:hover { text-decoration: underline; }
td.actions { white-space: nowrap; text-align: right; }
.card:not(.table-wrap) table th:first-child, .card:not(.table-wrap) table td:first-child { padding-left: 0; }
.card:not(.table-wrap) table th, .card:not(.table-wrap) table { background: transparent; }
.is-cancelled td { color: var(--ink-2); }
.is-cancelled td:not(.keep) { text-decoration: line-through; text-decoration-color: rgba(93,86,77,.5); }
.usage { display: inline-flex; align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; }
.usage progress { width: 64px; }

/* Fortschrittsbalken (z. B. Belegung) */
progress.meter { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--taupe-soft); overflow: hidden; display: block; }
progress.meter::-webkit-progress-bar { background: var(--taupe-soft); border-radius: 999px; }
progress.meter::-webkit-progress-value { background: var(--taupe-deep); border-radius: 999px; }
progress.meter::-moz-progress-bar { background: var(--taupe-deep); border-radius: 999px; }

/* ---------- Filter, Suche, Seiten ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.toolbar .field { margin: 0; flex: 1 1 240px; }
.toolbar .field.auto { flex: 0 1 auto; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .42rem .85rem; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: .88rem; font-weight: 500; border: 1px solid transparent; }
.tabs a:hover { background: var(--paper); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.pagination { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 1rem; }
.pagination ul { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pagination a, .pagination span.cur, .pagination span.gap { display: inline-flex; min-width: 2.4rem; min-height: 2.4rem; align-items: center; justify-content: center;
  border-radius: 999px; text-decoration: none; padding: 0 .6rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.pagination a:hover { background: var(--paper); }
.pagination span.cur { background: var(--ink); color: #fff; font-weight: 700; }
.pagination span.gap { color: var(--ink-2); }

/* ---------- Admin: Übersicht & Kurse ---------- */
.stats { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: -.25rem 0 1.5rem; }
.stats a { text-decoration: none; color: var(--ink-2); font-size: .92rem; }
.stats a strong { font: 650 1.35rem/1 var(--font-display); color: var(--ink); margin-right: .35rem; }
.stats a:hover strong { text-decoration: underline; }

details summary { cursor: pointer; color: var(--taupe-deep); margin: .5rem 0; font-weight: 600; font-size: .92rem; }

dialog { border: 0; border-radius: var(--r-m); padding: 1.25rem; max-width: 480px; width: calc(100% - 32px); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.35); }

/* ---------- Wochen-Navigation ---------- */
.h-sub { font: 500 1rem/1 var(--font-body); color: var(--ink-2); letter-spacing: 0; margin-left: .4rem; white-space: nowrap; }
.week-nav { display: flex; gap: .4rem; align-items: center; }
.btn-icon { width: 44px; padding: 0; font-size: 1.35rem; line-height: 1; }
span.btn[aria-disabled=true] { opacity: .3; }
.week-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.week-title { font: 650 1.15rem/1.2 var(--font-display); margin-right: .5rem; }
.empty-week { padding: 1.5rem 0; text-align: center; }

/* ---------- Buchungskalender (Admin) ---------- */
.card-flush { padding: 0; overflow: hidden; }
.card-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.35rem .9rem; }
.card-bar h2 { margin: 0; }
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.cal th, .cal td { padding: .7rem .8rem; border: 0; border-left: 1px solid #ecebe6; border-top: 1px solid #ecebe6; vertical-align: top; background: transparent; }
.cal thead th { background: #faf9f7; border-top: 0; text-transform: none; letter-spacing: 0; color: var(--ink); }
.cal th:first-child, .cal td:first-child { border-left: 0; }
.cal .cal-time { width: 4.2rem; font: 600 .82rem/1.2 var(--font-body); color: var(--ink-2); text-align: right; padding-right: .9rem; background: #faf9f7; font-variant-numeric: tabular-nums; }
.cal-wd { display: block; font: 650 .95rem/1.2 var(--font-display); }
.cal-date { display: block; font: 500 .78rem/1.3 var(--font-body); color: var(--ink-2); }
.cal thead th.is-today { background: var(--ink); }
.cal thead th.is-today .cal-wd, .cal thead th.is-today .cal-date { color: #fff; }
.cal td.is-today { background: #fbfaf6; }
.cal-empty { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(35,32,28,.025) 6px 12px) !important; }
.cal-head { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; margin-bottom: .45rem; }
.cal-place { font-weight: 650; font-size: .92rem; }
.cal-count { font: 650 .85rem/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.cal-count.is-full { color: var(--amber); }
.cal-names { margin: .6rem 0 0; padding-left: 1.35rem; font-size: .85rem; line-height: 1.45; }
.cal-names a { color: var(--ink); text-decoration: none; }
.cal-names a:hover { text-decoration: underline; }
.cal-note { margin: .3rem 0 0; font-size: .8rem; color: var(--ink-2); }
.cal td.is-blocked { background: repeating-linear-gradient(135deg, var(--amber-soft) 0 8px, #fbf3e3 8px 16px); }
/* Vergangene Kurse zurücknehmen, kommende hervorheben */
.cal td.is-past { background: #f3f2ee; }
.cal td.is-past .cal-place, .cal td.is-past .cal-count, .cal td.is-past .cal-names a, .cal td.is-past .cal-names { color: #8a8378; }
.cal td.is-future { background: #eef6f1; box-shadow: inset 4px 0 0 var(--spring); }
.cal td.is-future .cal-place { color: var(--ink); }
.cal td.is-future .cal-count { color: var(--spring); }
.cal thead th.is-past-day .cal-wd, .cal thead th.is-past-day .cal-date { color: #9a9387; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; list-style: none; margin: 0; padding: .7rem 1.35rem; border-top: 1px solid #ecebe6; font-size: .8rem; color: var(--ink-2); }
.cal-legend li { display: inline-flex; align-items: center; gap: .45rem; }
.cal-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.cal-legend .lg-future { background: #eef6f1; box-shadow: inset 3px 0 0 var(--spring); }
.cal-legend .lg-past { background: #f3f2ee; border: 1px solid #e2dfd8; }
.cal-legend .lg-blocked { background: repeating-linear-gradient(135deg, var(--amber-soft) 0 3px, #fbf3e3 3px 6px); border: 1px solid #ecd49e; }
@media print { .cal td.is-future, .cal td.is-past, .cal td.is-blocked, .cal-legend i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.cal td.is-future.is-empty-slot .cal-count { color: var(--ink-2); }
.cal-compact td { padding: .6rem .8rem .7rem; }

/* ---------- Mobil ---------- */
@media (max-width: 560px) {
  main { padding-top: 1.25rem; }
  .card { padding: 1.1rem; border-radius: 12px; }
  .confirm-bar { margin: 0 -1.1rem -1.1rem; padding: .9rem 1.1rem calc(.9rem + env(safe-area-inset-bottom)); }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .5rem; }
  .nav a[aria-current="page"]::after { bottom: -2px; }
  .day { grid-template-columns: 1fr; gap: .5rem; }
  .day .datebox { display: none; }
  .day-title { display: block; }
  .slots { grid-template-columns: 1fr 1fr; }
  .h-sub { display: block; margin: .3rem 0 0; }
  .week-bar { flex-wrap: wrap; }
}

@media print {
  .site-header, .site-footer, .no-print, .toolbar, .pagination, .tabs { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; padding: 0; }
  main { padding: 0; }
  .cal-wrap { overflow: visible; }
  .cal { min-width: 0; font-size: 11pt; }
  .cal-slot, .cal-empty { background: #fff !important; }
  @page { size: landscape; margin: 12mm; }
}
.agenda a { color: var(--ink); text-decoration: none; font-weight: 600; }
.agenda a:hover { text-decoration: underline; }

/* Live-Suche */
.js .js-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-live-result] { transition: opacity .15s; }
[data-live-result].is-loading { opacity: .55; }
.empty-row { text-align: center; padding: 2rem 1rem !important; }

/* ---------- Listen-Kopf ---------- */
.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0 0 .6rem; }
.list-bar p { margin: 0; }

/* ---------- Druckansichten ---------- */
.print-page { background: var(--stone); }
.print-bar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.print-bar .inner { display: flex; justify-content: space-between; align-items: center; min-height: 64px; }
.print-bar .back { margin: 0; }
.print-sheet { max-width: 210mm; margin: 1.5rem auto 3rem; padding: 18mm 16mm; background: #fff; box-shadow: var(--shadow); border-radius: 4px; }
.print-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: 1rem; }
.print-head h1 { font-size: 1.5rem; margin: 0; }
.print-head p { margin: 0; color: var(--ink-2); }
.print-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.print-table th, .print-table td { padding: .4rem .5rem; border-bottom: 1px solid #ddd; text-align: left; vertical-align: top; background: none; }
.print-table th { font-size: .7rem; letter-spacing: .08em; border-bottom: 1.5px solid var(--ink); color: var(--ink); }
.print-table .num { text-align: right; width: 1%; white-space: nowrap; }
.print-table tbody tr:hover { background: none; }
.print-card { max-width: 125mm; }
.print-card .pass { margin-bottom: 1.5rem; }
.print-block { margin-top: 1.5rem; }
.print-block h2 { font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: .35rem; }
.print-link { font-family: var(--font-mono); font-size: .9rem; overflow-wrap: anywhere; padding: .5rem .7rem; background: var(--stone); border-radius: 6px; }
.print-foot { margin-top: 2rem; font-size: .75rem; color: var(--ink-2); }

@media print {
  .print-page { background: #fff; }
  .print-sheet { margin: 0; padding: 0; max-width: none; box-shadow: none; border-radius: 0; }
  .print-table tr { break-inside: avoid; }
  .print-table thead { display: table-header-group; }
  /* Karte in Farbe drucken (Browser lassen Hintergründe sonst weg) */
  .pass, .hole, .badge, .print-link { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hole { animation: none !important; }
}
@page { margin: 14mm; }

/* Kundenliste quer drucken */
.print-sheet:has(.print-quer) { max-width: 297mm; }
@page quer { size: A4 landscape; margin: 12mm; }
@media print { .print-quer { page: quer; } }
/* Admin: vergangene Kurse zum Nachtragen */
.slot.is-backfill label { background: #f6f5f1; border-style: dashed; border-color: #cbc6bc; }
.slot.is-backfill .avail { color: var(--amber); }
.slot.is-backfill input:checked + label { background: var(--ink); border-style: solid; }

/* E-Mail-Vorschau */
.stats .stats-link { margin-left: auto; align-self: center; text-decoration: underline; }
.mail-preview { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 900px) { .mail-preview { grid-template-columns: 280px minmax(0, 1fr); } }
.mail-list { display: flex; flex-direction: column; gap: .35rem; }
.mail-list a { display: block; padding: .7rem .9rem; border-radius: var(--r-s); background: var(--paper); text-decoration: none; color: var(--ink); border: 1.5px solid transparent; }
.mail-list a:hover { border-color: var(--line); }
.mail-list a[aria-current="page"] { border-color: var(--ink); }
.mail-list strong { display: block; font-size: .92rem; }
.mail-list span { display: block; font-size: .8rem; color: var(--ink-2); }
.mail-frame iframe { display: block; width: 100%; height: 820px; border: 0; border-top: 1px solid var(--line); background: var(--stone); }

/* Bestätigungsdialog (ersetzt Browser-confirm, siehe app.js) */
dialog.confirm { border: 0; border-radius: var(--r-m); box-shadow: var(--shadow); padding: 1.35rem; width: calc(100% - 2rem); max-width: 28rem; background: var(--paper); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(35,32,28,.45); }
dialog.confirm h2 { font-size: 1.15rem; }
.confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.btn-danger-solid { background: var(--red); border-color: var(--red); }
.btn-danger-solid:hover { background: #7f2420; border-color: #7f2420; }

/* Admins: Passwort ändern direkt in der Tabelle */
.details-form { display: inline-block; margin-right: .35rem; }
.details-form summary { list-style: none; }
.details-form summary::-webkit-details-marker { display: none; }
.details-form[open] { display: block; margin: 0 0 .75rem; text-align: left; white-space: normal; }
.details-form form { margin-top: .75rem; }
