/* =========================================================================
   RIGHINI Werkstatt: Mitarbeiter-App und Verwaltung.
   Dieselben Hausfarben wie die Website (RAL 1015 und RAL 8023), dieselben
   Schriften. Eckig, klar, auf dem Handy mit dem Daumen zu bedienen.
   ========================================================================= */
@font-face { font-family: "Darker Grotesque"; src: url("darker-grotesque-400-800-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("inter-400-700-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Fragment Mono"; src: url("fragment-mono-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ral-1015: #E6D2B5; --papier: #F7F0E4; --papier-2: #EFE4D1;
  --linie: #DCCAAC; --linie-2: #C5AE8B;
  --tinte: #261C15; --tinte-2: #554739; --tinte-3: #74645A;
  --marke: #A65E2E; --marke-text: #8A4B23; --marke-tief: #7E4420; --marke-licht: #E3A877;
  --laub-text: #3F6221; --laub-lasur: rgba(94,140,54,.14); --rot: #C0352F;
  --nacht: #2A2019; --auf-nacht: #F3EADB; --auf-nacht-2: #DCCBB3;
  --r: 6px; --r-gross: 14px;
  --schatten: 0 1px 2px rgba(38,28,21,.06), 0 10px 28px -12px rgba(38,28,21,.22);
  --rand: clamp(16px, 4vw, 40px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--papier); color: var(--tinte);
  font: 16px/1.55 "Inter", system-ui, sans-serif;
}
h1, h2, h3 { font-family: "Darker Grotesque", sans-serif; font-weight: 800; line-height: 1; margin: 0 0 .3em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
p { margin: 0 0 1em; }
.mono { font-family: "Fragment Mono", monospace; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
:focus-visible { outline: 3px solid var(--marke); outline-offset: 2px; }
.nur-lesbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Scrollleisten nach Hausfarbe (Weiche fuer Firefox, sonst webkit) */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--linie-2) transparent; } }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--linie-2); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* --- Knoepfe: drei Groessen, eine Form ---------------------------------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .8em 1.4em; border: 1px solid transparent; border-radius: var(--r);
  background: var(--marke); color: #fff; font: inherit; font-weight: 700; text-decoration: none;
  cursor: pointer; transition: background .2s, transform .2s;
}
.knopf:hover { background: var(--marke-tief); }
.knopf:active { transform: translateY(1px); }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }
.knopf--linie { background: transparent; color: var(--tinte); border-color: var(--linie-2); }
.knopf--linie:hover { background: var(--papier-2); }
.knopf--gross { min-height: 64px; font-size: 1.1rem; }
.knopf--klein { min-height: 38px; padding: .45em .9em; font-size: .9rem; }
.knopf--gefahr { background: transparent; color: var(--rot); border-color: rgba(192,53,47,.4); }
.knopf--gefahr:hover { background: rgba(192,53,47,.08); }
.knopf svg { width: 1.3em; height: 1.3em; flex: none; }

/* --- Kopfleiste --------------------------------------------------------- */
.kopf {
  position: sticky; top: 0; z-index: 20; background: rgba(247,240,228,.96);
  border-bottom: 1px solid var(--linie); backdrop-filter: blur(10px);
}
.kopf-innen { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px var(--rand); max-width: 1500px; margin: 0 auto; }
.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinte); }
.marke img { height: 34px; width: auto; }
.marke b { font-family: "Darker Grotesque", sans-serif; font-size: 1.35rem; font-weight: 800; line-height: 1; display: block; }
.marke span { display: block; font-size: .72rem; color: var(--tinte-3); }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wer { font-size: .88rem; color: var(--tinte-2); }
@media (max-width: 520px) { .wer { display: none; } }

.inhalt { max-width: 1500px; margin: 0 auto; padding: 24px var(--rand) 60px; }

/* --- Anmeldung ---------------------------------------------------------- */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--rand); background: var(--ral-1015); }
.anmelde-kasten {
  width: min(100%, 420px); background: #fff; border: 1px solid var(--linie); border-radius: var(--r-gross);
  box-shadow: var(--schatten); padding: 32px 28px 28px;
}
.anmelde-kasten .marke { margin-bottom: 22px; }
.anmelde-kasten .mono { color: var(--marke-text); }
.feld { display: grid; gap: 6px; margin-bottom: 16px; }
.feld label, .feld .titel { font-weight: 600; font-size: .92rem; }
.feld input, .feld textarea {
  width: 100%; font: inherit; color: var(--tinte); background: var(--papier);
  border: 1px solid var(--linie-2); border-radius: var(--r); padding: .8em .9em; min-height: 48px;
}
.feld textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.feld input:focus, .feld textarea:focus { outline: none; border-color: var(--marke); box-shadow: 0 0 0 3px rgba(166,94,46,.2); background: #fff; }
.melder { min-height: 1.5em; font-size: .9rem; margin: 4px 0 12px; color: var(--rot); }
.melder.gut { color: var(--laub-text); }
.anmelde-kasten .knopf { width: 100%; }

/* --- Mitarbeiter-App ---------------------------------------------------- */
.aufnahme {
  background: #fff; border: 1px solid var(--linie); border-radius: var(--r-gross); box-shadow: var(--schatten);
  padding: 22px; display: grid; gap: 16px; max-width: 640px; margin: 0 auto 28px;
}
.aufnahme-bild {
  aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--papier-2);
  display: grid; place-items: center; color: var(--tinte-3); text-align: center; padding: 12px;
  border: 1px dashed var(--linie-2);
}
.aufnahme-bild img { width: 100%; height: 100%; object-fit: cover; }
.aufnahme-bild.hat-bild { padding: 0; border-style: solid; }
.zwei { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.zwei .knopf { width: 100%; }
.fortschritt { height: 6px; background: var(--papier-2); border-radius: 3px; overflow: hidden; }
.fortschritt i { display: block; height: 100%; width: 0; background: var(--marke); transition: width .2s; }

.raster { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.kachel { background: #fff; border: 1px solid var(--linie); border-radius: var(--r-gross); overflow: hidden; display: flex; flex-direction: column; }
.kachel img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--papier-2); }
.kachel-text { padding: 12px 14px 14px; display: grid; gap: 6px; }
.kachel-text p { margin: 0; font-size: .9rem; color: var(--tinte-2); }
.stand {
  justify-self: start; font-family: "Fragment Mono", monospace; font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; padding: .3em .6em; border-radius: var(--r);
  background: rgba(166,94,46,.13); color: var(--marke-tief);
}
.stand--freigegeben { background: var(--laub-lasur); color: var(--laub-text); }
.stand--verworfen { background: rgba(116,100,90,.14); color: var(--tinte-3); }
.leer {
  border: 1px dashed var(--linie-2); border-radius: var(--r-gross); padding: 28px; text-align: center;
  color: var(--tinte-2); background: rgba(255,255,255,.5);
}
.abschnitt-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }

/* --- Verwaltung --------------------------------------------------------- */
.reiter { display: flex; gap: 6px; border-bottom: 1px solid var(--linie-2); margin-bottom: 22px; overflow-x: auto; }
.reiter button {
  border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--tinte-2);
  padding: .8em 1em; min-height: 48px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
}
.reiter button[aria-selected="true"] { color: var(--tinte); border-bottom-color: var(--marke); }
.reiter .zahl {
  display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .4em; margin-left: .4em;
  border-radius: var(--r); background: var(--marke); color: #fff; font-size: .78rem;
}
.reiter .zahl[data-null] { background: var(--papier-2); color: var(--tinte-3); }

.eingang {
  display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); background: #fff;
  border: 1px solid var(--linie); border-radius: var(--r-gross); overflow: hidden; box-shadow: var(--schatten);
  margin-bottom: 18px;
}
@media (min-width: 860px) { .eingang { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.eingang-bild { background: var(--papier-2); min-height: 240px; }
.eingang-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eingang-text { padding: 22px; display: flex; flex-direction: column; gap: 4px; }
.eingang-text .mono { color: var(--tinte-3); }
.eingang-notiz { background: var(--papier); border-radius: var(--r); padding: 10px 12px; font-size: .92rem; color: var(--tinte-2); margin: 6px 0 12px; }
.eingang-knoepfe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: auto; }
.eingang-knoepfe .knopf { width: 100%; }
.eingang .melder { margin: 0 0 8px; }

.tabelle-huelle { overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: var(--r-gross); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 640px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--linie); font-size: .93rem; vertical-align: middle; }
th { font-family: "Fragment Mono", monospace; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tinte-3); font-weight: 400; }
td.zahl, th.zahl { text-align: right; }
tr:last-child td { border-bottom: 0; }
.aktionen { display: flex; gap: 8px; justify-content: flex-end; }
.neu-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; max-width: 620px; margin-bottom: 22px; }
.neu-zeile .feld { margin: 0; }

/* Fenster fuer neue Zugaenge: eigenes Fenster statt Browserdialog */
.fenster-schleier { position: fixed; inset: 0; z-index: 50; background: rgba(20,14,10,.55); display: grid; place-items: center; padding: 20px; }
.fenster-schleier[hidden] { display: none; }
.fenster { width: min(100%, 460px); background: #fff; border-radius: var(--r-gross); box-shadow: var(--schatten); padding: 26px; }
.zugang { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--r); padding: 14px 16px; margin: 12px 0 16px; display: grid; gap: 8px; }
.zugang div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; align-items: baseline; }
.zugang b { font-family: "Fragment Mono", monospace; font-size: 1rem; letter-spacing: .02em; word-break: break-all; }
/* Feste Spaltenbreiten (die CSP erlaubt keine Inline-Stile) */
.sp-name { width: 30%; } .sp-anmelde { width: 20%; } .sp-rolle { width: 12%; } .sp-fotos { width: 10%; } .sp-aktion { width: 28%; }
