/* Altgoldstelle Warenwirtschaft – Oberfläche fürs iPad am Tresen (auch Handy und PC). */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../fonts/poppins-regular.1dafca45aa5f.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../fonts/poppins-medium.7ba74ba36682.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../fonts/poppins-semibold.8357ec4f64e8.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --grund: #f3ede6;
  --flaeche: #ffffff;
  --flaeche-2: #faf7f3;
  --linie: #e4dacd;
  --linie-stark: #cdbfae;
  --text: #291e27;
  --text-2: #6b5e66;
  --gold: #ee992b;
  --gold-hell: #f6c27a;
  --gold-tief: #9a5c12;
  --pflaume: #2a1f27;
  --pflaume-2: #3d2e39;
  --gut: #2f7a4b;
  --gut-grund: #e5f3ea;
  --warn: #8a5a00;
  --warn-grund: #fdf1d8;
  --fehler: #a8322d;
  --fehler-grund: #fbe6e4;
  --info-grund: #eef0f7;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(41, 30, 39, 0.06), 0 4px 16px rgba(41, 30, 39, 0.05);
  --tippziel: 48px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--grund);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-tief); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; font-weight: 600; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
small, .leise { color: var(--text-2); }
.leise { font-size: 14px; }
hr { border: 0; border-top: 1px solid var(--linie); margin: 20px 0; }
img { max-width: 100%; }
.versteckt { display: none !important; }
.rechts { margin-left: auto; }
.mitte { text-align: center; }
.abstand-oben { margin-top: 16px; }
.abstand-unten { margin-bottom: 16px; }
.nur-druck { display: none; }

/* ---------- Kopfleiste ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--pflaume); color: #f3ede6;
}
.marke { display: flex; flex-direction: column; text-decoration: none; color: var(--gold); line-height: 1.1; white-space: nowrap; }
.marke b { font-size: 19px; font-weight: 600; letter-spacing: 0.2px; }
.marke span { font-size: 11px; color: #cbbcc6; letter-spacing: 0.6px; text-transform: uppercase; }
.navigation { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.navigation::-webkit-scrollbar { display: none; }
.navigation a {
  position: relative; display: flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 12px; border-radius: 10px;
  color: #e9dfe6; text-decoration: none; font-size: 15px; white-space: nowrap;
}
.navigation a:hover { background: var(--pflaume-2); }
.navigation a.aktiv { background: #4a3945; color: #fff; }
.navigation a.haupt { background: var(--gold); color: var(--pflaume); font-weight: 600; }
.zaehler { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--pflaume); font-size: 12px; font-weight: 600; text-align: center; }
.person { display: flex; align-items: center; gap: 10px; }
.kuerzel { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--pflaume); font-weight: 600; font-size: 14px; }
.person form { margin: 0; }
.person button { min-height: 40px; padding: 6px 12px; border: 1px solid #5d4b58; border-radius: 10px; background: transparent; color: #f3ede6; font: inherit; font-size: 14px; cursor: pointer; }

.probelauf-band { padding: 6px 20px; background: #fbe3c0; color: #6b3f05; font-size: 14px; font-weight: 500; text-align: center; }

/* ---------- Seite ---------- */
.seite { max-width: 1120px; margin: 0 auto; padding: 24px 20px 80px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.seitenkopf h1 { margin: 0; }
.seitenkopf .untertitel { margin: 4px 0 0; color: var(--text-2); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.raster { display: grid; gap: 16px; }
.raster.zwei { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.raster.drei { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.seitenleiste { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .seitenleiste { grid-template-columns: 1fr; } }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 20px; }
.karte + .karte { margin-top: 16px; }
.raster > .karte + .karte, .seitenleiste > .karte { margin-top: 0; }
.karte > h2:first-child, .karte > h3:first-child { margin-top: 0; }
.karte.still { box-shadow: none; background: var(--flaeche-2); }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.karte-kopf h2, .karte-kopf h3 { margin: 0; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tippziel); padding: 10px 20px; border-radius: 12px;
  border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--text);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.knopf:hover { border-color: var(--text-2); }
.knopf:active { transform: translateY(1px); }
.knopf.haupt { background: linear-gradient(180deg, #f3ab4a, var(--gold)); border-color: #d9851c; color: var(--pflaume); font-weight: 600; }
.knopf.dunkel { background: var(--pflaume); border-color: var(--pflaume); color: #fff; }
.knopf.gefahr { border-color: #e4b4b1; color: var(--fehler); }
.knopf.gross { min-height: 60px; padding: 14px 28px; font-size: 18px; border-radius: 14px; }
.knopf.klein { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.knopf.voll { width: 100%; }
.knopf[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-knopf { background: none; border: 0; padding: 0; color: var(--gold-tief); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Formulare ---------- */
form { margin: 0; }
.formular { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.formular .breit { grid-column: 1 / -1; }
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld > label, .feldname { font-size: 14px; font-weight: 500; color: var(--text); }
.feld .pflicht::after { content: " *"; color: var(--gold-tief); }
.feld .hilfe { font-size: 13px; color: var(--text-2); }
.feld .fehlertext { font-size: 14px; color: var(--fehler); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="tel"], input:not([type]), select, textarea {
  width: 100%; min-height: var(--tippziel); padding: 10px 14px;
  border: 1px solid var(--linie-stark); border-radius: 12px; background: #fff;
  font: inherit; font-size: 17px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(238, 153, 43, 0.35); border-color: var(--gold); }
.feld.fehler input, .feld.fehler select, .feld.fehler textarea { border-color: var(--fehler); background: #fffafa; }
input.zahl { font-variant-numeric: tabular-nums; }
input.gross { font-size: 26px; letter-spacing: 4px; text-align: center; }
input[type="file"] { font: inherit; font-size: 15px; padding: 8px 0; }
.ankreuzen { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche-2); cursor: pointer; }
.ankreuzen input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--gold-tief); flex: none; }
.ankreuzen.wichtig { border-color: var(--gold); background: #fff7ec; }
.wahl { display: flex; flex-wrap: wrap; gap: 10px; }
.wahl label { position: relative; display: flex; align-items: center; gap: 10px; min-height: var(--tippziel); padding: 10px 16px; border: 1px solid var(--linie-stark); border-radius: 12px; background: #fff; cursor: pointer; }
.wahl input { width: 20px; height: 20px; accent-color: var(--gold-tief); margin: 0; }
.wahl label:has(input:checked) { border-color: var(--gold); background: #fff4e4; box-shadow: inset 0 0 0 1px var(--gold); }
.wahl ul { display: contents; list-style: none; margin: 0; padding: 0; }
.wahl li { display: contents; }
.formular-fehler { margin-bottom: 14px; }

/* ---------- Hinweise ---------- */
.hinweis { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; border: 1px solid transparent; margin-bottom: 12px; background: var(--info-grund); }
.hinweis.gut { background: var(--gut-grund); border-color: #bfe0cb; }
.hinweis.warn { background: var(--warn-grund); border-color: #f1d49b; }
.hinweis.fehler { background: var(--fehler-grund); border-color: #efc1bd; color: #6d1f1b; }
.hinweis.sperre { background: #fde2df; border: 2px solid var(--fehler); color: #5a1512; }
.hinweis b { font-weight: 600; }
.hinweis .knopf { margin-left: auto; }
.meldungen { margin-bottom: 16px; }

/* ---------- Kennzahlen (Startbildschirm) ---------- */
.kennzahl { display: flex; flex-direction: column; gap: 4px; }
.kennzahl .bezeichnung { font-size: 14px; color: var(--text-2); }
.kennzahl .wert { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.kennzahl .zusatz { font-size: 14px; color: var(--text-2); }
.startaktion { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-radius: var(--radius); background: var(--pflaume); color: #f3ede6; margin-bottom: 16px; }
.startaktion h2 { margin: 0 0 2px; color: #fff; }
.startaktion p { margin: 0; color: #cbbcc6; }

/* ---------- Tabellen ---------- */
.tabelle-huelle { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle th { text-align: left; font-size: 13px; font-weight: 500; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--linie-stark); white-space: nowrap; }
.tabelle td { padding: 11px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .betrag, .tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle tfoot td { font-weight: 600; border-top: 2px solid var(--linie-stark); border-bottom: 0; }
.tabelle tr.storniert td { color: var(--text-2); text-decoration: line-through; text-decoration-color: rgba(168, 50, 45, 0.5); }
.tabelle a.zeile { color: inherit; text-decoration: none; display: block; }
.tabelle tr.klickbar:hover td { background: var(--flaeche-2); }

/* ---------- Abzeichen ---------- */
.abzeichen { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 20px; font-size: 13px; font-weight: 500; background: #efe8df; color: var(--text); white-space: nowrap; }
.abzeichen.gut { background: var(--gut-grund); color: var(--gut); }
.abzeichen.warn { background: var(--warn-grund); color: var(--warn); }
.abzeichen.fehler { background: var(--fehler-grund); color: var(--fehler); }
.abzeichen.gold { background: #fff0d9; color: var(--gold-tief); }

/* ---------- Angaben (Schlüssel/Wert) ---------- */
dl.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.angaben dt { color: var(--text-2); font-size: 14px; }
dl.angaben dd { margin: 0; }
@media (max-width: 560px) { dl.angaben { grid-template-columns: 1fr; gap: 2px; } dl.angaben dd { margin-bottom: 8px; } }

/* ---------- Suche ---------- */
.suche { display: flex; gap: 10px; }
.suche input { font-size: 19px; min-height: 56px; }
.suche .knopf { min-height: 56px; }
.treffer { display: grid; gap: 10px; }
.treffer-zeile { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; }
.treffer-zeile .name { font-weight: 600; font-size: 17px; }
.treffer-zeile .daten { font-size: 14px; color: var(--text-2); }
.treffer-zeile .rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.treffer-zeile form { margin: 0; }

/* ---------- Ablauf-Schritte ---------- */
.schritte { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; }
.schritte .schritt { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #ebe3d9; color: var(--text-2); font-size: 15px; text-decoration: none; }
.schritte .schritt .nr { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; font-size: 13px; font-weight: 600; }
.schritte .schritt.erledigt { color: var(--text); background: #f2e6d4; }
.schritte .schritt.erledigt .nr { background: var(--gold-hell); }
.schritte .schritt.aktiv { background: var(--pflaume); color: #fff; }
.schritte .schritt.aktiv .nr { background: var(--gold); color: var(--pflaume); }
.kundenleiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; background: #fff; border: 1px solid var(--linie); }
.kundenleiste .name { font-weight: 600; font-size: 17px; }
.fussleiste { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px -20px -80px; padding: 14px 20px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: rgba(243, 237, 230, 0.94); backdrop-filter: blur(8px); border-top: 1px solid var(--linie); }
.fussleiste .summe { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fussleiste .summe small { display: block; font-size: 13px; font-weight: 400; }

/* ---------- Positionen ---------- */
.position { display: grid; grid-template-columns: 34px minmax(160px, 1.1fr) minmax(160px, 1.6fr) minmax(120px, 0.8fr) auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; margin-bottom: 10px; }
.position.firma { grid-template-columns: 34px minmax(150px, 1fr) minmax(140px, 1.4fr) 110px minmax(150px, 1fr) minmax(120px, 0.8fr) auto; }
.position .nr { align-self: center; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #f2e6d4; font-weight: 600; font-size: 14px; }
.position .feld label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.position .werkzeuge { display: flex; gap: 8px; align-items: center; }
.position .foto-knopf { position: relative; overflow: hidden; }
.position .foto-knopf input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.position .vorschau { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 1px solid var(--linie); }
.position.geloescht { display: none; }
.position .fehlertext { grid-column: 2 / -1; }
@media (max-width: 820px) {
  .position, .position.firma { grid-template-columns: 34px 1fr 1fr; }
  .position .feld-beschreibung { grid-column: 2 / -1; }
  .position .werkzeuge { grid-column: 2 / -1; justify-content: flex-end; }
}

/* ---------- Börsenkurse ---------- */
.kurse { display: grid; gap: 8px; }
.kurs { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.kurs:last-child { border-bottom: 0; }
.kurs .metall { font-weight: 500; }
.kurs .preis { font-variant-numeric: tabular-nums; font-weight: 600; }
.kurs .unze { display: block; font-size: 12px; color: var(--text-2); font-weight: 400; text-align: right; }

/* ---------- Ausweis ---------- */
.ausweisbilder { display: flex; gap: 12px; flex-wrap: wrap; }
.ausweisbilder a { display: block; }
.ausweisbilder img { width: 220px; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--linie); background: var(--flaeche-2); }
.foto-feld { display: flex; flex-direction: column; gap: 8px; }
.foto-feld .foto-ziel { position: relative; display: grid; place-items: center; min-height: 150px; border: 2px dashed var(--linie-stark); border-radius: 12px; background: var(--flaeche-2); color: var(--text-2); text-align: center; padding: 12px; overflow: hidden; }
.foto-feld .foto-ziel input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto-feld .foto-ziel img { max-height: 180px; border-radius: 8px; }

/* ---------- Unterschrift ---------- */
.texte { max-height: 360px; overflow-y: auto; padding: 4px 16px 4px 0; font-size: 14px; color: #3f343b; }
.texte h3 { font-size: 15px; margin: 14px 0 4px; }
.texte p { margin: 0 0 8px; white-space: pre-line; }
.unterschrift-feld { position: relative; border: 2px solid var(--linie-stark); border-radius: 14px; background: #fff; touch-action: none; }
.unterschrift-feld canvas { display: block; width: 100%; height: 240px; border-radius: 12px; cursor: crosshair; }
.unterschrift-feld .linie { position: absolute; left: 24px; right: 24px; bottom: 56px; border-bottom: 1px solid var(--linie-stark); pointer-events: none; }
.unterschrift-feld .platzhalter { position: absolute; left: 24px; bottom: 26px; color: var(--text-2); font-size: 14px; pointer-events: none; }

/* ---------- Sperrbildschirm ---------- */
.einfach { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 30% 10%, #3f2f3b, var(--pflaume) 60%); }
.einfach .kasten { width: min(560px, 100%); background: var(--flaeche); border-radius: 20px; padding: 32px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.einfach .marke { align-items: center; margin-bottom: 24px; }
.einfach .marke b { font-size: 26px; color: var(--gold-tief); }
.einfach .marke span { color: var(--text-2); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.kachel { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; border: 1px solid var(--linie); border-radius: 16px; background: var(--flaeche-2); color: var(--text); text-decoration: none; font-weight: 500; }
.kachel:hover { border-color: var(--gold); }
.kachel .kuerzel { width: 56px; height: 56px; font-size: 20px; }
.kuerzel-gross { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 10px; }
.pin-punkte { display: flex; justify-content: center; gap: 14px; margin: 16px 0 20px; }
.pin-punkte span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--linie-stark); }
.pin-punkte span.voll { background: var(--pflaume); border-color: var(--pflaume); }
.ziffernblock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.ziffernblock button { min-height: 68px; border: 1px solid var(--linie); border-radius: 16px; background: var(--flaeche-2); font: inherit; font-size: 26px; font-weight: 500; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ziffernblock button:active { background: #f2e6d4; }
.ziffernblock button.leise { font-size: 15px; color: var(--text-2); }
.qr { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--linie); border-radius: 12px; }
.qr svg { display: block; width: 220px; height: 220px; }

/* ---------- Kassensturz ---------- */
.stueckelung { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stueckelung .feld { flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; }
.stueckelung .feld label { flex: 0 0 64px; font-weight: 600; }
.stueckelung input { min-height: 42px; text-align: right; }

/* ---------- Handy ---------- */
@media (max-width: 700px) {
  .kopf { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .navigation { order: 3; flex-basis: 100%; }
  .person { margin-left: auto; }
  .seite { padding: 16px 16px 80px; }
  .fussleiste { margin: 20px -16px -80px; padding: 12px 16px; }
  .karte { padding: 16px; }
  h1 { font-size: 22px; }
  .kennzahl .wert { font-size: 24px; }
  .startaktion { flex-direction: column; align-items: stretch; }
}

/* ---------- Drucken (Listen) ---------- */
@media print {
  .kopf, .navigation, .knopfreihe, .fussleiste, .nicht-drucken { display: none !important; }
  .nur-druck { display: block; }
  body { background: #fff; font-size: 11px; }
  .seite { max-width: none; padding: 0; }
  .karte { border: 0; box-shadow: none; padding: 0; }
}
