/* Keramik-Decal-Konverter — Porzellan & Kobalt.
   Kobaltblau ist die Keramik-Unterglasurfarbe und zugleich die Farbe der
   Flussmaske in der Vorschau; alle Maschinenwerte stehen in Monospace. */

:root {
  --porzellan: #faf9f7;
  --porzellan-tief: #f1efeb;
  --scherbe: #e3e0da;
  --tusche: #1a1817;
  --grau: #6f6b66;
  --kobalt: #1f4bc7;
  --kobalt-tief: #16337f;
  --amber: #b4690e;
  --amber-grund: #fdf3e4;
  --gruen: #2e7d43;
  --rot: #b3261e;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--porzellan);
  color: var(--tusche);
  font: 15px/1.5 var(--sans);
}
.mono { font-family: var(--mono); font-size: 0.93em; }

/* ---- Kopf ---- */
.kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--scherbe);
  background: var(--porzellan);
}
.marke { display: flex; align-items: center; gap: 0.65rem; }
.marke-punkt {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3f6fe8, var(--kobalt-tief));
  box-shadow: 0 1px 3px rgb(22 51 127 / 0.4);
}
.kopf h1 { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: 0.01em; }

/* Kanalbelegungs-Leiste: die verdrehte Tonerbelegung des Druckers */
.kanalleiste { display: flex; gap: 2px; font-family: var(--mono); font-size: 0.78rem; }
.kanal {
  padding: 0.28rem 0.6rem; color: #fff; letter-spacing: 0.02em;
  display: inline-flex; gap: 0.4rem; align-items: baseline;
}
.kanal b { font-weight: 700; }
.kanal-c { background: var(--kobalt); border-radius: 6px 0 0 6px; }
.kanal-m { background: var(--tusche); }
.kanal-y {
  background: repeating-linear-gradient(135deg, #efece6 0 6px, #e0dcd4 6px 12px);
  color: var(--grau); text-decoration: line-through;
}
.kanal-k { background: var(--kobalt-tief); border-radius: 0 6px 6px 0; }

/* ---- Werkbank-Layout ---- */
.werkbank {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.5rem; padding: 1.5rem; max-width: 1280px; margin: 0 auto;
}
@media (max-width: 900px) { .werkbank { grid-template-columns: 1fr; } }

/* ---- Laufkarte (linke Spalte) ---- */
.laufkarte {
  background: #fff; border: 1px solid var(--scherbe); border-radius: 10px;
  padding: 1.1rem; align-self: start;
  display: flex; flex-direction: column; gap: 1.1rem;
}

.dropzone {
  border: 1.5px dashed #b9b4ac; border-radius: 8px;
  padding: 1.2rem 1rem; text-align: center; cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--kobalt); outline: none; }
.dropzone.aktiv { border-color: var(--kobalt); background: #f2f5fd; }
.dropzone p { margin: 0.2rem 0; }
.dz-haupt { font-weight: 600; }
.dz-neben, .dz-formate { color: var(--grau); font-size: 0.85rem; }
.dz-formate { letter-spacing: 0.04em; }
.dz-datei { color: var(--kobalt-tief); font-weight: 600; word-break: break-all; }
.linkknopf {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--kobalt); text-decoration: underline; cursor: pointer;
}

.parameter { display: flex; flex-direction: column; gap: 0.9rem; }
.feld label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.feld abbr { color: var(--rot); text-decoration: none; }
.einheit { display: flex; align-items: center; gap: 0.5rem; }
.einheit input[type="number"], .einheit select {
  width: 7.5rem; padding: 0.4rem 0.5rem;
  border: 1px solid #c9c4bc; border-radius: 6px;
  font-family: var(--mono); font-size: 0.9rem; background: var(--porzellan);
}
.einheit input:focus-visible, .einheit select:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--kobalt); outline-offset: 1px;
}
.hinweis { margin: 0.3rem 0 0; font-size: 0.8rem; color: var(--grau); }
.ampel { margin: 0.4rem 0 0; display: flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; }
.ampel-punkt { width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--grau); }
.ampel-punkt.gruen { background: var(--gruen); }
.ampel-punkt.gelb { background: var(--amber); }
.ampel-punkt.rot { background: var(--rot); }
.hinweis-inline { font-weight: 400; font-size: 0.8rem; color: var(--grau); }
.schalter { display: flex; align-items: baseline; gap: 0.45rem; font-weight: 500 !important; font-size: 0.88rem !important; }
.schalter input { accent-color: var(--kobalt); }
.schalter.aus { color: var(--grau); }
.optionen { display: flex; flex-direction: column; gap: 0.45rem; }
input[type="range"] { width: 100%; accent-color: var(--kobalt); }

.aktionen { display: flex; gap: 0.6rem; margin-top: 0.2rem; }
.knopf {
  padding: 0.55rem 1rem; border-radius: 7px; border: 1px solid #c9c4bc;
  background: #fff; font: 600 0.9rem var(--sans); cursor: pointer;
  transition: background 120ms, border-color 120ms;
  text-decoration: none; color: inherit; text-align: center;
}
.knopf:hover:not(:disabled) { border-color: var(--kobalt); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; }
.knopf.primaer {
  background: var(--kobalt); border-color: var(--kobalt); color: #fff;
}
.knopf.primaer:hover:not(:disabled) { background: var(--kobalt-tief); }
.knopf:focus-visible { outline: 2px solid var(--kobalt-tief); outline-offset: 2px; }

/* ---- Jobstatus ---- */
.jobstatus { border-top: 1px solid var(--scherbe); padding-top: 0.9rem;
  display: flex; flex-direction: column; gap: 0.6rem; }
.status-zeile { margin: 0; display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.status-lampe { width: 10px; height: 10px; border-radius: 50%; background: var(--grau); }
.status-lampe.laeuft { background: var(--amber); animation: puls 1.2s ease-in-out infinite; }
.status-lampe.fertig { background: var(--gruen); }
.status-lampe.fehler { background: var(--rot); }
@keyframes puls { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .status-lampe.laeuft { animation: none; } }

.kanalcheck {
  font-family: var(--mono); font-size: 0.82rem; padding: 0.5rem 0.7rem;
  border-radius: 6px; border: 1px solid;
}
.kanalcheck.ok { color: var(--gruen); border-color: #bcd9c4; background: #eef7f0; }
.kanalcheck.kaputt { color: var(--rot); border-color: #e4b6b3; background: #fbeeed; }
.meldungen { margin: 0; padding-left: 1.1rem; font-size: 0.82rem; color: var(--grau); }
.meldungen:empty { display: none; }

/* ---- Vorschau (rechte Spalte) ---- */
.vorschau { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.warnungen {
  background: var(--amber-grund); border: 1px solid #ecd3ae; border-left: 4px solid var(--amber);
  border-radius: 6px; padding: 0.6rem 0.9rem; font-size: 0.87rem;
}
.warnungen p { margin: 0.15rem 0; }

.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--scherbe); }
.tabs [role="tab"] {
  border: none; background: none; padding: 0.5rem 0.9rem;
  font: 600 0.88rem var(--sans); color: var(--grau); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--kobalt-tief); border-bottom-color: var(--kobalt); }
.tabs [role="tab"]:focus-visible { outline: 2px solid var(--kobalt); outline-offset: -2px; }

.buehne {
  background: var(--porzellan-tief);
  border: 1px solid var(--scherbe); border-radius: 10px;
  min-height: 340px; display: grid; place-items: center; padding: 1rem;
}
.buehne img { max-width: 100%; max-height: 62vh; box-shadow: 0 2px 12px rgb(26 24 23 / 0.12); background: #fff; }
.buehne .nutzenbild { max-height: 70vh; }
.leer { color: var(--grau); font-size: 0.9rem; text-align: center; padding: 1rem; }
.nutzen-info { margin: -0.4rem 0 0; color: var(--grau); font-size: 0.82rem; }

/* ---- Druckhinweise ---- */
.druckhinweise {
  border: 1px solid var(--scherbe); border-radius: 8px; background: #fff;
}
.druckhinweise summary {
  padding: 0.7rem 1rem; font-weight: 600; cursor: pointer; color: var(--kobalt-tief);
}
.druckhinweise ul { margin: 0; padding: 0 1.2rem 0.9rem 2.2rem; font-size: 0.88rem; }
.druckhinweise li { margin-bottom: 0.35rem; }

/* ---- Historie ---- */
.historie h2 { font-size: 0.95rem; margin: 0 0 0.5rem; }
.historie table { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: #fff;
  border: 1px solid var(--scherbe); border-radius: 8px; overflow: hidden; }
.historie th, .historie td { text-align: left; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--porzellan-tief); }
.historie th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grau); background: var(--porzellan); }
.historie td.mono, .historie .zahl { font-family: var(--mono); }
.historie a { color: var(--kobalt); }
.check-ok { color: var(--gruen); font-weight: 600; }
.check-kaputt { color: var(--rot); font-weight: 600; }
#historie_tabelle:has(tbody:empty) { display: none; }
#historie_tabelle:not(:has(tbody:empty)) + .leer { display: none; }

/* ---- Login ---- */
.login-buehne {
  min-height: 100vh; display: grid; place-items: center; padding: 1rem;
}
.login-karte {
  background: #fff; border: 1px solid var(--scherbe); border-radius: 12px;
  padding: 2rem; width: min(360px, 100%); text-align: center;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.login-karte h1 { margin: 0; font-size: 1.15rem; }
.login-karte input[type="password"] {
  padding: 0.55rem 0.7rem; border: 1px solid #c9c4bc; border-radius: 7px;
  font-family: var(--mono); text-align: center;
}
.fehler { color: var(--rot); margin: 0; font-size: 0.88rem; }
