/* FuW Heizkoerper-Erfassung -- Gestaltung, zuerst fuers Handy gedacht */

:root {
  --grund:      #f4f6f8;
  --flaeche:    #ffffff;
  --linie:      #dde3ea;
  --text:       #1c2530;
  --gedaempft:  #5c6b7a;
  --akzent:     #1d5fa8;
  --akzent-neg: #ffffff;
  --gruen:      #17724a;
  --gruen-hell: #e3f4ec;
  --rot:        #a11c23;
  --rot-hell:   #fbe6e7;
  --gelb-hell:  #fdf3dc;
  --gelb-linie: #e2c477;
  --radius:     10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---- Kopf und Navigation ---- */
.kopf {
  background: var(--akzent);
  color: #fff;
  padding: .6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}
.marke { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.nav a {
  color: #dce8f6; text-decoration: none; padding: .4rem .7rem;
  border-radius: var(--radius); font-size: .95rem;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.an { background: #fff; color: var(--akzent); font-weight: 600; }
.nutzer { display: flex; align-items: center; gap: .75rem; font-size: .85rem; color: #dce8f6; }
.nutzer a { color: #fff; text-decoration: underline; }

.inhalt { max-width: 1040px; margin: 0 auto; padding: 1rem; }
.fuss { text-align: center; color: var(--gedaempft); font-size: .8rem; padding: 1.5rem 1rem 2.5rem; }

/* ---- Karten ---- */
.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.karte.schmal { max-width: 520px; }
h1 { font-size: 1.3rem; margin: 0 0 .6rem; }
h2 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
.klein { font-size: .85rem; color: var(--gedaempft); }
.rechts { text-align: right; }
.blass { opacity: .55; }
.obenabstand { margin-top: 1rem; }
.marke-klein {
  display: inline-block; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gedaempft); font-weight: 600;
}

/* ---- Kacheln ---- */
.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.kachel {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .9rem; font-size: .85rem; color: var(--gedaempft);
}
.kachel .zahl { display: block; font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1.1; }

/* ---- Formulare ---- */
label { display: block; margin: .7rem 0; font-size: .9rem; font-weight: 600; }
label .klein { font-weight: 400; }
label.zeile { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
label.zeile input { width: auto; margin: 0; }
.zwei { display: grid; grid-template-columns: 1fr 2fr; gap: .75rem; }

input[type=text], input[type=password], input[type=email], input[type=date],
input[type=datetime-local], select, textarea {
  width: 100%; margin-top: .25rem; padding: .6rem .65rem;
  border: 1px solid var(--linie); border-radius: var(--radius);
  font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: var(--akzent); }

.knopf {
  display: inline-block; padding: .6rem 1rem; border: 1px solid var(--akzent);
  background: var(--akzent); color: var(--akzent-neg); border-radius: var(--radius);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.knopf:hover { filter: brightness(1.08); }
.knopf.gross { width: 100%; padding: .85rem 1rem; font-size: 1.05rem; margin-top: .5rem; }
.knopf.hell { background: #fff; color: var(--akzent); }
.knopf.klein-knopf { padding: .35rem .7rem; font-size: .85rem; font-weight: 600; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.alslink {
  background: none; border: 0; color: var(--akzent); text-decoration: underline;
  cursor: pointer; font: inherit; font-size: .85rem; padding: 0;
}
.inline { display: inline; }

.filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .75rem 0; }
.filter input, .filter select { width: auto; flex: 1 1 150px; margin: 0; }
.filter label { display: flex; align-items: center; gap: .35rem; margin: 0; font-weight: 400; }

/* ---- Scan-Erfassung ---- */
.sitzung { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: flex-start; }
.sitzung h1 { margin: .1rem 0; }
.scanform { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.scanform input[name=sn] {
  flex: 1 1 100%; font-size: 1.4rem; padding: .75rem; font-weight: 600; letter-spacing: .02em;
}
.scanform .knopf { flex: 1 1 auto; margin-top: 0; }
.scanform .knopf.gross { flex: 2 1 60%; }
#kamera { margin: .5rem 0 1rem; }
#kamera video { width: 100%; max-width: 420px; border-radius: var(--radius); background: #000; display: block; }
.mangelform { margin: .5rem 0; text-align: left; }
.mangelform input[type=text] { font-size: .9rem; }
details summary { cursor: pointer; }

/* ---- Tabellen ---- */
.tabelle-rahmen { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th, .tabelle td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gedaempft); }
.tabelle tbody tr:hover { background: #f8fafc; }
.tabelle a { color: var(--akzent); }

.tag {
  display: inline-block; padding: .1rem .45rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.tag.gruen { background: var(--gruen-hell); color: var(--gruen); }
.tag.rot   { background: var(--rot-hell);   color: var(--rot); }
.tag.grau  { background: #eceff3;           color: var(--gedaempft); }

/* ---- Hinweise ---- */
.hinweis {
  padding: .7rem .85rem; border-radius: var(--radius); margin-bottom: .75rem;
  border: 1px solid var(--linie); background: var(--flaeche); font-size: .92rem;
}
.hinweis.ok     { background: var(--gruen-hell); border-color: #b6ddc9; color: var(--gruen); }
.hinweis.fehler { background: var(--rot-hell);   border-color: #eab8ba; color: var(--rot); }
.hinweis.info   { background: var(--gelb-hell);  border-color: var(--gelb-linie); color: #6b4d13; }

/* ---- Einrichtung ---- */
.schritte { padding-left: 1.2rem; }
.schritte li { margin: .3rem 0; }
.schritte li.fertig { color: var(--gruen); font-weight: 600; }
.schritte li.offen  { color: var(--gedaempft); }
.code {
  background: #11202f; color: #e6edf5; padding: .8rem; border-radius: var(--radius);
  overflow-x: auto; font-size: .8rem; line-height: 1.45;
}

@media (min-width: 700px) {
  .kacheln { grid-template-columns: repeat(4, 1fr); }
  .scanform input[name=sn] { flex: 1 1 55%; }
}
