/* Tanzstudio 60/30 – interner Bereich (Prototyp)
   Gesetzt im Programmheft-Stil der Website:
   Papierweiß, Haarlinien, Gill Sans, Kursfarben nur als kleine Striche. */

/* ---------- Schriften (von der Website, nicht kopiert) ---------- */

@font-face {
  font-family: "gs";
  src: url("assets/GillSans.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "gssb";
  src: url("assets/GillSans-SemiBold.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --charcoal: #3d3d3c;
  --ink: #1f1f1e;
  --text: #3d3d3c;
  --muted: #a3a3a2;      /* nur Dekor / große Schrift */
  --quiet: #6b6b6a;      /* kleine gedämpfte Schrift, AA auf Weiß */
  --line: #e2e2e0;
  --soft: #f5f5f3;
  --flash: #efeee8;
  --error: #a3001b;
  --font: "gs", Helvetica, Roboto, Arial, sans-serif;
  --font-semibold: "gssb", Helvetica, Roboto, Arial, sans-serif;
  --gutter: clamp(18px, 5vw, 64px);
  --frame: 1200px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
}

[hidden] { display: none !important; }

a { color: var(--charcoal); text-underline-offset: 3px; }
a:hover { color: #000; }
a:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 3px; }

strong, b { font-family: var(--font-semibold); font-weight: normal; }

code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .9em;
  padding: 0 3px;
  background: var(--soft);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 30;
  background: var(--charcoal); color: #fff; padding: .55rem 1rem;
}
.skip-link:focus { left: 0; outline: 2px solid var(--charcoal); outline-offset: 2px; }

.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- Kopf ---------- */

.topbar { height: 30px; background: var(--charcoal); }

.masthead-row {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 20px var(--gutter) 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 28px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
}
.wordmark-name {
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.05;
  letter-spacing: -.005em;
  color: var(--charcoal);
}
.wordmark-kicker,
.kicker,
.section-head,
label,
legend,
.ledger thead th,
.ledger tr.gruppe th {
  font-family: var(--font-semibold);
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.wordmark-kicker { color: var(--quiet); }

.masthead-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  font-size: 15px;
}
.masthead-who { color: var(--quiet); }
.masthead-link { text-decoration: underline 1px; }

/* ---------- Grundsatz ---------- */

main {
  display: block;
  max-width: var(--frame);
  margin: 0 auto;
  padding: 56px var(--gutter) 96px;
}
main:focus { outline: none; }

h1, h2 { color: var(--charcoal); font-weight: normal; margin: 0; }
h1 {
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1;
  letter-spacing: -.018em;
  margin: 0 0 18px;
}
h1:focus, h2:focus { outline: none; }
h1:focus-visible, h2:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 6px; }

p { margin: 0 0 1em; }

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--charcoal);
}
.kicker::before {
  content: "";
  flex: 0 0 32px;
  height: 1px;
  background: currentColor;
}

.lead {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.42;
  max-width: 28em;
  margin: 0 0 32px;
}

.small { font-size: 14px; color: var(--quiet); }

.note {
  max-width: 38em;
  margin: 0;
  padding: 2px 0 2px 16px;
  border-left: 1px solid var(--charcoal);
  font-size: 16px;
  line-height: 1.55;
}
.note-error { border-left: 2px solid var(--error); color: var(--charcoal); margin-top: 18px; }

/* ---------- Formulare & Knöpfe ---------- */

button,
.button-ghost {
  display: inline-block;
  font: inherit;
  font-size: 15px;
  letter-spacing: .02em;
  line-height: 1.5;
  background: var(--charcoal);
  color: #f2f2f0;
  border: 1px solid var(--charcoal);
  border-radius: 0;
  padding: 10px 22px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: none;
}
button:hover { background: #222; border-color: #222; color: #fff; }
button:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 3px; }
button[disabled] { opacity: .6; cursor: progress; }

.button-ghost { background: transparent; color: var(--charcoal); }
.button-ghost:hover { background: var(--charcoal); color: #fff; }
.button-small { padding: 4px 14px; min-height: 36px; font-size: 14px; }

/* Textknopf: unterstrichenes Wort, keine Fläche */
.button-text {
  background: transparent;
  color: var(--charcoal);
  border: 0;
  padding: 6px 0;
  min-height: 36px;
  font-size: 15px;
  letter-spacing: 0;
  text-decoration: underline 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--muted);
}
.button-text:hover { background: transparent; color: #000; text-decoration-color: currentColor; }
.button-danger { color: var(--error); text-decoration-color: currentColor; }
.button-danger:hover { color: var(--error); }

.field { margin: 0 0 18px; }

label,
legend {
  display: block;
  margin: 0 0 6px;
  color: var(--charcoal);
}

input[type="text"],
input[type="password"],
input[type="time"],
select {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  padding: 9px 10px;
  min-height: 44px;
  border: 1px solid #8f8f8d;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
input[type="time"] { font-variant-numeric: tabular-nums; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  /* kleiner Winkel aus zwei Haarlinien */
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233d3d3c' stroke-width='1.3'/%3E%3C/svg%3E") no-repeat right 12px center;
}
input:focus,
select:focus {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
  border-color: var(--charcoal);
}
input[aria-invalid="true"],
select[aria-invalid="true"] { border-color: var(--error); border-left-width: 4px; }

fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--charcoal);
  flex: none;
  cursor: pointer;
}
input[type="checkbox"]:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 3px; }
input[type="checkbox"][disabled] { cursor: progress; }

.field-error {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--error);
}
.field-error:empty { display: none; }

.field-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 16px;
}

.preis-eingabe { display: flex; align-items: center; gap: 10px; max-width: 12em; }
.preis-eingabe input { text-align: right; font-variant-numeric: tabular-nums; }
.preis-suffix { font-size: 18px; color: var(--charcoal); }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 4px; }

.form-status {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.45;
}
.form-status:empty { display: none; }
.form-status.is-ok {
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--charcoal);
}
.form-status.is-fehler {
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--error);
  color: var(--error);
}

.form-remove {
  margin: 28px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ---------- Zustand 1: Anmelden ---------- */

.sheet {
  max-width: 34em;
  padding-top: 8px;
}
.login-form {
  max-width: 360px;
  padding-top: 22px;
  border-top: 2px solid var(--charcoal);
}
.login-form .field-error { margin: -6px 0 16px; }
.proto-note { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--line); max-width: 360px; }

/* ---------- Zustand 2: interner Bereich ---------- */

/* Kurzes Verzeichnis der beiden Bereiche, zwischen zwei Linien */
.bereich-nav { margin: 0 0 56px; }
.bereich-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 40px;
  border-top: 2px solid var(--charcoal);
  border-bottom: 1px solid var(--line);
}
.bereich-index a {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 12px 0 10px;
  font-size: 18px;
  color: var(--charcoal);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.bereich-index a:hover { text-decoration: underline 1px; text-underline-offset: 5px; }
.bereich-index a[aria-current="page"] {
  font-family: var(--font-semibold);
  border-bottom-color: var(--charcoal);
}
.bereich-index a[aria-current="page"]:hover { text-decoration: none; }
.bereich-index a:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; }
.bereich-nr {
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

.page-head { margin: 0 0 40px; }
.page-meta {
  margin: 0;
  font-size: 17px;
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
}

.section-head {
  padding-top: 14px;
  border-top: 2px solid var(--charcoal);
  margin: 0 0 4px;
  color: var(--charcoal);
}
.section-sub { margin: 0 0 18px; max-width: 34em; }

/* Formular unter der Tabelle */
.entry-form { margin-top: 72px; max-width: 520px; }
.entry-form form { max-width: 520px; }

/* ---------- Tabellen ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums lining-nums;
}
.ledger thead th {
  padding: 0 16px 8px 0;
  text-align: left;
  font-size: 10.5px;
  color: var(--quiet);
  border-bottom: 1px solid var(--charcoal);
  white-space: nowrap;
}
.ledger td,
.ledger tbody th {
  padding: 11px 16px 11px 0;
  text-align: left;
  vertical-align: baseline;
  border-bottom: 1px solid var(--line);
  font-weight: normal;
}
.ledger td:last-child,
.ledger thead th:last-child { padding-right: 0; }
.ledger .num,
.ledger thead th.num { text-align: right; }

/* Kurs-Markierung: kleiner Farbstrich vor dem Namen */
.tick {
  display: block;
  width: 12px;
  height: 3px;
  background: var(--akzent, var(--charcoal));
}
.kurs-mark { display: inline-flex; align-items: center; gap: 9px; }
.kurs-mark .tick { flex: none; transform: translateY(-1px); }

/* Wochentag als Zeilenkopf */
.ledger tr.gruppe th {
  padding: 28px 0 8px;
  color: var(--charcoal);
  border-bottom: 1px solid var(--charcoal);
}
.ledger tbody:first-of-type tr.gruppe th { padding-top: 16px; }

/* Stundenplan */
.plan .col-zeit { width: 8.5em; }
.plan .zelle-zeit { white-space: nowrap; color: var(--charcoal); }
.plan .zelle-kurs { font-family: var(--font-semibold); color: var(--charcoal); font-size: 16px; }
.plan .zelle-ort { color: var(--charcoal); }
.plan .zelle-preis { white-space: nowrap; }
.plan .col-aktion,
.plan .zelle-aktion { width: 1%; white-space: nowrap; text-align: right; }
.plan .zelle-aktion { padding-top: 4px; padding-bottom: 4px; vertical-align: middle; }
.plan tr.ist-in-arbeit > * { background: var(--soft); }
.plan tr.ist-in-arbeit .zelle-kurs { text-decoration: underline 2px; text-underline-offset: 5px; }

/* Merch-Bestellungen */
.best .col-datum { width: 7.5em; }
.best .zelle-datum { white-space: nowrap; color: var(--charcoal); }
.best .zelle-name { font-family: var(--font-semibold); color: var(--charcoal); font-size: 16px; }
.best .zelle-preis { white-space: nowrap; }
.best .col-abgeholt,
.best .zelle-abgeholt { width: 1%; white-space: nowrap; }
.best .zelle-abgeholt { padding-top: 4px; padding-bottom: 4px; vertical-align: middle; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
/* Auf breiten Schirmen steht „Abgeholt“ schon im Spaltenkopf */
@media (min-width: 641px) {
  .check .check-wort {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* abgeholte Bestellungen treten zurück */
.best tr.ist-abgeholt > td,
.best tr.ist-abgeholt > th { color: var(--quiet); }
.best tr.ist-abgeholt .zelle-name { font-family: var(--font); }
.best tr[aria-busy="true"] .check { cursor: progress; }

.ledger tr.ledger-empty td {
  padding: 22px 0;
  color: var(--quiet);
  font-size: 15px;
}

/* gespeicherte Zeile kurz hinterlegen */
.ledger tr.ist-neu > * { background: var(--flash); }
.ledger tr.ist-neu.verblasst > * { background: transparent; transition: background-color 1.4s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .ledger tr.ist-neu.verblasst > * { transition: none; }
}

#best-status { margin: 0 0 18px; }

/* „Eingang notieren“: bewusst klein und nachrangig */
.nebenbei {
  margin-top: 64px;
  max-width: 420px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.nebenbei summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-size: 15px;
  color: var(--charcoal);
  text-decoration: underline 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--muted);
}
.nebenbei summary:hover { text-decoration-color: currentColor; }
.nebenbei summary:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 3px; }
.nebenbei[open] summary { margin-bottom: 6px; }

/* ---------- Fuß ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  padding: 22px 20px 26px;
  line-height: 1.65;
}
.site-footer .proto { color: var(--quiet); margin: 0; }
.footer-bar { height: 8px; background: var(--charcoal); }

/* ---------- Mobil ---------- */

@media (max-width: 640px) {
  main { padding-top: 32px; padding-bottom: 64px; }
  .masthead-row { padding-top: 16px; padding-bottom: 12px; }
  .masthead-who { display: none; }
  .page-head { margin-bottom: 28px; }
  .bereich-nav { margin-bottom: 36px; }
  .bereich-index { gap: 0 24px; }
  .bereich-index a { font-size: 17px; }
  .entry-form { margin-top: 56px; }

  /* Tabellen als gestapelte Einträge */
  .table-wrap { overflow: visible; }
  table.ledger thead { display: none; }
  table.ledger, .ledger tbody, .ledger tr, .ledger td, .ledger tbody th { display: block; width: auto; }
  .ledger tbody tr:not(.gruppe):not(.ledger-empty) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 2px;
    padding: 12px 0 12px;
    border-bottom: 1px solid var(--line);
  }
  .ledger tbody tr td,
  .ledger tbody tr:not(.gruppe) th { border: 0; padding: 0; }
  .ledger .num { text-align: left; }
  .ledger tr.gruppe th { display: block; padding: 24px 0 8px; }
  .ledger tr.ledger-empty td { padding: 18px 0; }

  .plan tbody tr:not(.gruppe):not(.ledger-empty) {
    grid-template-areas:
      "kurs   preis"
      "zeit   aktion"
      "lehr   aktion"
      "ort    aktion";
  }
  .plan .zelle-kurs { grid-area: kurs; font-size: 17px; }
  .plan .zelle-preis { grid-area: preis; text-align: right; }
  .plan .zelle-zeit { grid-area: zeit; }
  .plan .zelle-lehrkraft { grid-area: lehr; }
  .plan .zelle-ort { grid-area: ort; color: var(--quiet); font-size: 14px; }
  .plan .zelle-aktion { grid-area: aktion; width: auto; align-self: end; padding: 0; }

  .best tbody tr:not(.ledger-empty) {
    grid-template-areas:
      "name     preis"
      "artikel  groesse"
      "datum    datum"
      "abgeholt abgeholt";
  }
  .best .zelle-name { grid-area: name; font-size: 17px; }
  .best .zelle-preis { grid-area: preis; text-align: right; }
  .best .zelle-artikel { grid-area: artikel; }
  .best .zelle-groesse { grid-area: groesse; text-align: right; }
  .best .zelle-datum { grid-area: datum; font-size: 14px; color: var(--quiet); }
  .best .zelle-datum::before { content: "Bestellt am "; }
  .best .zelle-abgeholt { grid-area: abgeholt; width: auto; padding: 4px 0 0; }
  .best .zelle-groesse::before { content: "Gr. "; color: var(--quiet); }
}

/* Demo-Hinweis (Cloudflare-Pages-Demo) */
.demo-badge { display: inline-block; margin: 0 0 16px; padding: 4px 10px; border: 2px solid var(--error); color: var(--error); font-family: var(--font-semibold); letter-spacing: .04em; }
