/* luca Design System (wie Sparrechner): GT Walsheim, Flieder nur für EINE Hauptaktion je Abschnitt, keine Verläufe. Handy zuerst. */
:root {
  --primary: #C873EB; --lilac: #E1A8FA; --pale: #F5EBF5; --link: #743498;
  --ink: #0A080A; --grey: #726E72; --bg: #F3F0F0; --surface: #FFFFFF; --line: #E4DFE0;
  --gut: #1F7A4D; --gut-bg: #E6F2EB; --warn: #8A5A00; --warn-bg: #FBF0DC; --schlecht: #A33A2A; --schlecht-bg: #F8E6E2;
  --r: 16px; --r-s: 10px;
  font-family: "GT Walsheim", "GT Walsheim Pro", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; padding-bottom: 76px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(24px, 4vw, 34px); letter-spacing: -0.02em; }
h2 { font-size: 19px; letter-spacing: -0.01em; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--link); }
.muted { color: var(--grey); }
.klein { font-size: 14px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
.tabular, .eur input, td.num { font-variant-numeric: tabular-nums; }

/* Kopf */
.kopf { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.kopf-in { display: flex; align-items: center; gap: 10px; height: 56px; }
.logo { font-weight: 800; font-size: 24px; letter-spacing: -0.04em; }
.titel { color: var(--grey); font-size: 15px; padding-left: 10px; border-left: 1px solid var(--line); white-space: nowrap; }
.pilot { font-size: 12px; font-weight: 600; background: var(--pale); color: var(--link); padding: 2px 8px; border-radius: 99px; }
.kopf-rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.kopf select { max-width: 180px; }
.betriebname { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }

/* Navigation: unten am Handy, oben am Computer */
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: space-around; z-index: 5; padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; text-align: center; padding: 10px 4px 12px; font-size: 13px; font-weight: 600; color: var(--grey); text-decoration: none; }
.nav a svg { display: block; margin: 0 auto 2px; }
.nav a[aria-current=page] { color: var(--ink); }
.nav a[aria-current=page] svg { color: var(--link); }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav { position: static; border: 0; justify-content: flex-start; gap: 4px; background: transparent; padding: 0; }
  .nav a { flex: none; padding: 6px 12px; border-radius: 99px; font-size: 14px; }
  .nav a svg { display: none; }
  .nav a[aria-current=page] { background: var(--pale); color: var(--link); }
}

/* Knöpfe */
button, .ghost, .btn { font: inherit; cursor: pointer; border-radius: 99px; border: 1px solid transparent; padding: 10px 18px; font-weight: 600; transition: background-color .15s, border-color .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
button.primary { background: var(--primary); color: var(--ink); }
button.primary:hover { background: #B95FE0; }
button.dark { background: var(--ink); color: #fff; }
.ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.ghost:hover { background: var(--pale); }
.ghost.klein, button.klein { padding: 6px 12px; font-size: 14px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.linkbtn, button.x { background: transparent; border: 0; padding: 4px 0; color: var(--link); font-weight: 600; font-size: 14px; border-radius: 4px; }
button.x { color: var(--grey); }
button.x:hover { color: var(--schlecht); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--lilac); outline-offset: 2px; }

/* Felder */
label { display: grid; gap: 4px; font-size: 14px; color: var(--grey); }
input:not([type=checkbox]):not([type=radio]), select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 11px; width: 100%; min-width: 0; }
textarea { min-height: 72px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #CFC6C9; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.eur { position: relative; display: block; }
.eur input:not([type=checkbox]):not([type=radio]) { padding-right: 30px; text-align: right; }
.eur::after { content: "€"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--grey); pointer-events: none; }
.check { display: flex; flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; cursor: pointer; }
.felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: contents; }
.fehler { color: var(--schlecht); font-size: 14px; }
.fehler:empty { display: none; }

/* Karten und Abschnitte */
.seite { padding: 20px 0 32px; display: grid; gap: 16px; }
.karte { background: var(--surface); border-radius: var(--r); padding: 18px; display: grid; gap: 14px; align-content: start; }
.karte.ruhig { background: transparent; padding: 4px 2px; }
.kopfzeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kopfzeile .grow, .grow { flex: 1; }
.schritt { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.schritt:first-of-type { border-top: 0; padding-top: 0; }
.schritt-kopf { display: flex; align-items: center; gap: 10px; }
.haken { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--grey); font-size: 14px; font-weight: 700; }
.haken.ja { background: var(--gut-bg); color: var(--gut); }
.hilfe { color: var(--grey); font-size: 14px; }
.zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.liste { display: grid; gap: 8px; }
.listen-zeile { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; align-items: center; }

/* Datum */
.datum { display: flex; align-items: center; gap: 8px; }
.datum input { width: auto; }
.status { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--bg); color: var(--grey); white-space: nowrap; }
.status.zu { background: var(--gut-bg); color: var(--gut); }

/* Fortschritt */
.fortschritt { display: flex; flex-wrap: wrap; gap: 6px; }
.fortschritt span { font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--bg); color: var(--grey); }
.fortschritt span.ja { background: var(--gut-bg); color: var(--gut); }

/* Hinweise */
.hinweise { display: grid; gap: 8px; }
.hinweis { background: var(--pale); color: var(--ink); border-radius: var(--r-s); padding: 10px 12px; font-size: 15px; }
.hinweis.w { background: var(--warn-bg); }
.hinweis.ok { background: var(--gut-bg); color: var(--gut); }

/* Zählen */
.zaehlen { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.zaehlen label { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; font-size: 14px; }
.zaehlen input { text-align: right; padding: 7px 8px; }
.summe-gross { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Fotos */
.fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.fotos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.foto-knopf { position: relative; overflow: hidden; }
.foto-knopf input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.laedt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-s); background: var(--pale); font-size: 15px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--lilac); border-top-color: var(--link); animation: dreh .8s linear infinite; flex: none; }
@keyframes dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Kennzahlen */
.zahlen { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.zahl { background: var(--bg); border-radius: var(--r-s); padding: 10px 12px; display: grid; gap: 2px; }
.zahl b { font-size: 19px; font-variant-numeric: tabular-nums; }
.zahl span { font-size: 13px; color: var(--grey); }
.zahl.rot b { color: var(--schlecht); }
.zahl.gruen b { color: var(--gut); }

/* Tabellen */
.tabelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--grey); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.klick { cursor: pointer; }
tr.klick:hover td { background: var(--pale); }
.rot { color: var(--schlecht); }
.gruen { color: var(--gut); }

/* Trinkgeld */
.tip-zeile { display: grid; grid-template-columns: 1fr 76px 110px auto; gap: 8px; align-items: center; }
.tip-zeile.ohne-std { grid-template-columns: 1fr 110px auto; }
.sig-mini { height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.segment { display: inline-flex; background: var(--bg); border-radius: 99px; padding: 4px; flex-wrap: wrap; }
.segment button { background: transparent; padding: 6px 14px; font-weight: 600; font-size: 14px; }
.segment button[aria-checked=true] { background: var(--ink); color: #fff; }

/* Dialoge */
dialog { border: 0; border-radius: var(--r); padding: 20px; max-width: min(720px, calc(100vw - 24px)); width: 100%; }
dialog::backdrop { background: rgba(10, 8, 10, .6); }
dialog .inhalt { display: grid; gap: 14px; }
.sig { width: 100%; height: 200px; border: 1.5px dashed #CFC6C9; border-radius: var(--r-s); touch-action: none; background: #fff; display: block; }
.crop { position: relative; overflow: hidden; border-radius: 12px; touch-action: none; user-select: none; -webkit-user-select: none; width: fit-content; max-width: 100%; margin: 0 auto; }
.crop img { display: block; max-width: 100%; max-height: 60vh; width: auto; height: auto; pointer-events: none; }
.crop .box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); }
.crop .h { position: absolute; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); touch-action: none; cursor: grab; }
.crop .h.tl { left: -16px; top: -16px; } .crop .h.tr { right: -16px; top: -16px; } .crop .h.bl { left: -16px; bottom: -16px; } .crop .h.br { right: -16px; bottom: -16px; }
.gross-foto { max-width: 100%; max-height: 80vh; display: block; margin: 0 auto; border-radius: 8px; }
.link-box { display: flex; gap: 8px; }
.link-box input { font-size: 14px; }

/* Anmeldung */
.mitte { max-width: 440px; margin: 40px auto; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-s); font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); z-index: 20; }
.toast.an { opacity: 1; transform: translate(-50%, 0); }
.speicher { font-size: 13px; color: var(--grey); min-width: 70px; text-align: right; }

@media (max-width: 560px) {
  .titel { display: none; }
  .karte { padding: 14px; }
  .listen-zeile { grid-template-columns: 1fr 104px auto; }
  .tip-zeile { grid-template-columns: 1fr 60px 96px; }
  .tip-zeile.ohne-std { grid-template-columns: 1fr 96px; }
  .tip-zeile > :last-child { grid-column: 1 / -1; justify-self: start; }
  .zwei { grid-template-columns: 1fr; }
}

/* Druckansicht des Tages */
.druck { background: #fff; padding: 24px; border-radius: var(--r); display: grid; gap: 14px; }
.druck table { font-size: 13px; }
.druck .sig-gross { height: 70px; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; padding: 0; }
  .kopf, .nav, .toast, .nur-bildschirm { display: none !important; }
  .druck { padding: 0; }
  .seite { padding: 0; }
}
.lade { padding: 24px 0; }
.abstand { margin-top: 10px; }
input.schmal { max-width: 200px; }
.mittel { max-width: 320px; }
