/* ============================================================
   Amaseo Amazon Tools - gemeinsames Stylesheet
   Eine Datei fuer alle Seiten. Klassennamen sind deutsch.
   Akzentfarbe Orange ist bewusst knapp: nur fuer Live-Aktionen.
   ============================================================ */

/* --- Grundlagen ------------------------------------------- */

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  margin: 0;
  color: #222;
  background: #fafafa;
}

/* --- Kopfleiste ------------------------------------------- */

header.kopf {
  background: #1f2933;
  color: #fff;
  padding: 8px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

header.kopf .marke {
  font-weight: 600;
  color: #fff;
  margin-right: 6px;
  letter-spacing: 0.02em;
}

header.kopf nav.bereiche {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

header.kopf .bereich {
  display: flex;
  gap: 4px;
  align-items: center;
}

header.kopf .bereich-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #9aa5b1;
  margin-right: 4px;
}

header.kopf a {
  color: #cfd8dc;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 3px;
}

header.kopf a.aktiv,
header.kopf a:hover {
  background: #3e4c59;
  color: #fff;
}

header.kopf .bereich-inaktiv .bereich-name { color: #6b7683; }

header.kopf .bald {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #3e4c59;
  color: #9aa5b1;
}

header.kopf .rechts {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

header.kopf .benutzer {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #616e7c;
  color: #fff;
}

header.kopf .abmelden {
  font: inherit;
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid #616e7c;
  background: transparent;
  color: #cfd8dc;
  border-radius: 3px;
  cursor: pointer;
}

header.kopf .abmelden:hover { background: #3e4c59; color: #fff; }

/* --- Layout ----------------------------------------------- */

main { padding: 18px; max-width: 1150px; }
main.breit { max-width: 1400px; }

.karte {
  background: #fff;
  border: 1px solid #dde1e6;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.karte > h2:first-child,
.karte > h3:first-child { margin-top: 0; }

.zeile { display: flex; gap: 22px; flex-wrap: wrap; }
.zeile > div { flex: 1 1 320px; }

.zurueck {
  display: inline-block;
  margin-bottom: 12px;
  color: #3e4c59;
  text-decoration: none;
}
.zurueck:hover { text-decoration: underline; }

/* --- Text ------------------------------------------------- */

h1 { font-size: 20px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 22px 0 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; }

p.lead { color: #52606d; margin: 0 0 18px; max-width: 78ch; }
.klein { font-size: 12px; color: #626f7d; }
.gedaempft { color: #52606d; }

code {
  background: #eef1f4;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 12px;
}

ul.erklaerung { max-width: 78ch; color: #3e4c59; padding-left: 20px; }
ul.erklaerung li { margin-bottom: 6px; }

/* --- Tabellen --------------------------------------------- */

table {
  border-collapse: collapse;
  background: #fff;
  width: 100%;
  margin-bottom: 8px;
}

th, td {
  border: 1px solid #ddd;
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
}

th { background: #f0f2f4; font-weight: 600; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }

/* Schmale Beschriftungsspalte fuer Metadaten */
table.angaben th {
  width: 200px;
  background: #f7f8f9;
  color: #3e4c59;
  font-weight: 600;
}
table.angaben td { word-break: break-word; }

/* --- Meldungen -------------------------------------------- */

.meldung { padding: 9px 12px; margin: 0 0 12px; border-radius: 3px; }
.meldung.ok { background: #e6f4ea; border: 1px solid #a5d6b1; }
.meldung.fehler { background: #fdecea; border: 1px solid #f5a19a; }
.meldung.hinweis { background: #fff8e1; border: 1px solid #f0d58c; }

.ok { color: #1a7f37; }
.fehlt { color: #b42318; }
.warn { color: #b7791f; }

/* --- Knoepfe ---------------------------------------------- */

button, .knopf {
  font: inherit;
  padding: 6px 14px;
  border: 1px solid #888;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  color: #222;
  display: inline-block;
}

button:hover, .knopf:hover { background: #f0f2f4; }

button.haupt, .knopf.haupt {
  background: #1f2933;
  color: #fff;
  border-color: #1f2933;
}
button.haupt:hover, .knopf.haupt:hover { background: #3e4c59; }

/* Orange nur hier: echte Aenderungen bei Amazon */
button.live, .knopf.live {
  background: #d95d00;
  color: #fff;
  border-color: #d95d00;
  font-weight: 600;
}
button.live:hover, .knopf.live:hover { background: #b84e00; }

button.gefahr, .knopf.gefahr { border-color: #b42318; color: #b42318; }
button.gefahr:hover, .knopf.gefahr:hover { background: #fdecea; }

button.mini {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}

button:disabled, .knopf.aus {
  opacity: 0.5;
  cursor: not-allowed;
}

.knopfzeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* --- Formulare -------------------------------------------- */

label.feld { display: block; margin: 10px 0 4px; font-weight: 600; }

input[type=text], input[type=password], input[type=number],
input[type=file], input[type=date], select, textarea {
  font: inherit;
  padding: 5px 7px;
  border: 1px solid #c3cad2;
  border-radius: 3px;
  background: #fff;
  color: #222;
  max-width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3e4c59;
  box-shadow: 0 0 0 2px rgba(62, 76, 89, 0.12);
}

fieldset {
  border: 1px solid #dde1e6;
  border-radius: 4px;
  padding: 10px 14px;
  margin: 0 0 14px;
}

legend { font-weight: 600; padding: 0 6px; }

.feldhinweis { font-size: 12px; color: #626f7d; margin: 3px 0 0; }

/* Mehrere schmale Felder nebeneinander */
.raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 4px 18px;
}

.raster > div { min-width: 0; }
.raster label.feld { margin-top: 8px; }
.raster select,
.raster input[type=text],
.raster input[type=number] { width: 100%; }

.ankreuzzeile { display: flex; gap: 7px; align-items: center; margin-top: 6px; }
.ankreuzzeile label { font-weight: 600; margin: 0; }

/* --- Abzeichen / Status ----------------------------------- */

.abzeichen {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.abzeichen.aktiv { background: #e6f4ea; color: #1a7f37; }
.abzeichen.spaeter { background: #eef1f4; color: #626f7d; }
.abzeichen.live { background: #fff1e5; color: #b84e00; }
.abzeichen.probe { background: #eef1f4; color: #3e4c59; }

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status.finished { background: #e6f4ea; color: #1a7f37; }
.status.failed { background: #fdecea; color: #b42318; }
.status.running, .status.starting { background: #fff8e1; color: #b7791f; }
.status.cancelled { background: #eef1f4; color: #626f7d; }
.status.unknown { background: #eef1f4; color: #626f7d; }

/* --- Modulkacheln (Startseite) ---------------------------- */

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.kachel {
  display: block;
  background: #fff;
  border: 1px solid #dde1e6;
  border-radius: 4px;
  padding: 12px 14px;
  text-decoration: none;
  color: #222;
}

.kachel:hover { border-color: #3e4c59; background: #fcfdfe; }

.kachel .kopfzeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.kachel .titel { font-weight: 600; font-size: 15px; }
.kachel .beschreibung { color: #52606d; margin: 0; line-height: 1.5; }

.kachel.gesperrt {
  background: #f6f7f8;
  border-style: dashed;
  color: #626f7d;
}
.kachel.gesperrt:hover { border-color: #c3cad2; background: #f6f7f8; }
.kachel.gesperrt .titel { color: #3e4c59; }

/* --- Runs-Liste ------------------------------------------- */

.runs { display: grid; gap: 8px; }

.run {
  border: 1px solid #dde1e6;
  border-radius: 4px;
  padding: 9px 11px;
  background: #fff;
}

.run .obenzeile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.run a { color: #1f2933; font-weight: 600; text-decoration: none; }
.run a:hover { text-decoration: underline; }
.run .angaben { color: #626f7d; font-size: 12px; margin-top: 2px; }
.run .unten { margin-top: 6px; }

/* Zeigt rund fuenf Runs, der Rest ist scrollbar */
.runs-rollbereich {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

/* --- Ergebnis / Download ---------------------------------- */

.ergebnis {
  background: #fff;
  border: 1px solid #dde1e6;
  border-left: 3px solid #1a7f37;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.ergebnis.wartet { border-left-color: #c3cad2; }

.ergebnis h2 { margin: 0 0 8px; }

a.download {
  display: inline-block;
  padding: 7px 15px;
  background: #1a7f37;
  border: 1px solid #1a7f37;
  border-radius: 3px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

a.download:hover { background: #15682d; }

a.download.aus {
  background: #eef1f4;
  border-color: #c3cad2;
  color: #8896a5;
  cursor: not-allowed;
  pointer-events: none;
}

.dateiliste { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Report-Zusammenfassung ------------------------------- */

.kennzahlen {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0 18px;
}

.kennzahlen div {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
  font-variant-numeric: tabular-nums;
}

.planblock { margin-top: 14px; }
.planblock h3 { margin-bottom: 4px; }
.planblock ul { margin: 0; padding-left: 20px; color: #3e4c59; }
.planblock li { margin-bottom: 3px; }

/* --- Log / Report ----------------------------------------- */

pre.protokoll {
  background: #1f2933;
  color: #e4e9ee;
  padding: 12px 14px;
  border-radius: 4px;
  overflow: auto;
  max-height: 460px;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

pre.bericht {
  background: #fff;
  color: #222;
  border: 1px solid #dde1e6;
  padding: 12px 14px;
  border-radius: 4px;
  overflow: auto;
  max-height: 520px;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Anmeldung -------------------------------------------- */

main.anmeldung {
  max-width: 380px;
  margin: 0 auto;
  padding-top: 70px;
}

main.anmeldung .karte { padding: 20px 22px; }
main.anmeldung h1 { margin-bottom: 4px; }
main.anmeldung p.lead { margin-bottom: 14px; }
main.anmeldung input { width: 100%; padding: 7px 9px; }
main.anmeldung button { width: 100%; margin-top: 16px; padding: 8px 14px; }

/* --- Hilfsklassen ----------------------------------------- */

.rechtsbuendig { text-align: right; }
.abstand-oben { margin-top: 16px; }
.kein-abstand { margin: 0; }
.breit-voll { width: 100%; }

@media (max-width: 720px) {
  main { padding: 14px; }
  header.kopf { gap: 10px; }
  header.kopf .rechts { margin-left: 0; width: 100%; }
}
