* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1c1e21;
  background: #f4f5f7;
}
#app { display: flex; height: 100vh; }

#sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #1e2733;
  color: #e8ecf1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
}
#sidebar h1 {
  font-size: 16px;
  margin: 0 0 12px;
  line-height: 1.3;
}
#sidebar h1 span { font-weight: 400; font-size: 12px; color: #9aa7b8; }
#mode-toggle { display: flex; gap: 4px; margin-bottom: 12px; }
.mode-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: 6px;
  border: 1px solid #364152;
  background: #262f3d;
  color: #9aa7b8;
  cursor: pointer;
  font-size: 12px;
}
.mode-btn.active { background: #375a8c; color: white; border-color: #375a8c; }

#training-nav { display: flex; align-items: center; gap: 10px; }
#training-nav button {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #d0d5dd;
  background: white;
  cursor: pointer;
  font-size: 13px;
}
#training-nav button:disabled { opacity: 0.4; cursor: default; }
#nav-counter { font-size: 12px; color: #667085; }

body.mode-training #mockup-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px;
}
body.mode-training #dialog-header { justify-content: flex-start; gap: 32px; }

#search {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #364152;
  background: #262f3d;
  color: #e8ecf1;
  margin-bottom: 12px;
}
#dialog-list { flex: 1; overflow-y: auto; }
.dialog-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 4px;
  font-size: 13px;
}
.dialog-item:hover { background: #2b3646; }
.dialog-item.active { background: #375a8c; }
.dialog-item .name { display: block; margin-bottom: 4px; }
.coverage-bar {
  height: 4px;
  border-radius: 2px;
  background: #364152;
  overflow: hidden;
  display: flex;
}
.coverage-bar .fill {
  height: 100%;
  background: #4caf7d;
}
.dialog-item .pct { font-size: 10px; color: #9aa7b8; }

#main { flex: 1; overflow-y: auto; padding: 24px; }
#empty-state { color: #8a94a3; font-size: 14px; margin-top: 40px; text-align: center; }
.hidden { display: none !important; }

#dialog-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-bottom: 16px; }
#dialog-title { margin: 0; font-size: 20px; }
#locale-tabs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex: 1 1 360px; }
.locale-tab {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d0d5dd;
  background: white;
  cursor: pointer;
  font-size: 12px;
}
.locale-tab.active { background: #375a8c; color: white; border-color: #375a8c; }
.locale-tab.missing { border-style: dashed; color: #b64a4a; }

#mockup-wrap {
  background: repeating-conic-gradient(#e9ebee 0% 25%, #f4f5f7 0% 50%) 50% / 16px 16px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 24px;
  overflow: auto;
  margin-bottom: 24px;
}
#mockup {
  position: relative;
  background: #ece9d8;
  border: 1px solid #7a8a99;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform-origin: top left;
}
.ctrl {
  position: absolute;
  overflow: hidden;
  /* WinForms-Standard Tahoma 8.25pt ≈ 11px bei 96 dpi */
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  display: flex;
  align-items: center;
  padding: 1px 4px;
  white-space: pre-wrap;
  line-height: 1.15;
}
.ctrl-label { background: transparent; }
.ctrl-button {
  background: linear-gradient(#fdfdfd, #e4e4e4);
  border: 1px solid #8f8f8f;
  border-radius: 2px;
  justify-content: center;
  text-align: center;
}
.ctrl-textbox, .ctrl-numericupdowneditingcontrol, .ctrl-checklist {
  background: white;
  border: 1px inset #8f8f8f;
}
.ctrl-checkbox::before { content: "☐ "; }
.ctrl-groupbox {
  background: transparent;
  border: 1px solid #a9a9a9;
  align-items: flex-start;
}
.ctrl.missing-text { outline: 2px solid #e04b4b; outline-offset: -2px; }
.ctrl-image { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }

#strings-panel { background: white; border: 1px solid #d0d5dd; border-radius: 8px; padding: 16px; }
#strings-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
#save-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: #375a8c;
  color: white;
  cursor: pointer;
}
#save-btn:disabled { background: #b7c2d0; cursor: default; }
#save-status { font-size: 12px; color: #4caf7d; }

table#strings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#strings-table th { text-align: left; border-bottom: 2px solid #e4e7ec; padding: 6px 8px; }
#strings-table td { border-bottom: 1px solid #eef0f3; padding: 6px 8px; vertical-align: top; }
#strings-table .key-cell { font-family: ui-monospace, monospace; font-size: 11px; color: #667085; width: 220px; }
#strings-table .neutral-cell { width: 30%; white-space: pre-wrap; color: #344054; }
.edit-input {
  width: 100%;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.edit-input.is-missing { border-color: #e04b4b; background: #fff5f5; }
.edit-input.is-dirty { border-color: #f0a63a; background: #fffaf0; }
tr.row-missing-only-hidden { display: none; }

/* ---------------------------------------------------------------- Anmeldung, Kopf, Prüfmodus */
.anmeldeseite { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; padding: 48px 16px; }
.anmelde-rahmen { width: 100%; max-width: 420px; }
.anmelde-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.anmelde-kopf h1 { font-size: 20px; margin: 0; }
.anmelde-karte { background: white; border: 1px solid #d0d5dd; border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.anmelde-karte h2 { font-size: 15px; margin: 0 0 8px; }
.anmelde-karte label, .feld { display: block; font-size: 12px; color: #475467; margin-bottom: 10px; }
.anmelde-karte input, .feld input, .feld textarea, .feld select {
  display: block; width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid #d0d5dd;
  border-radius: 6px; font: inherit; font-size: 14px; color: #1c1e21;
}
.anmelde-karte button, .knopf-primaer {
  padding: 7px 16px; border-radius: 6px; border: none; background: #375a8c; color: white; cursor: pointer; font-size: 13px;
}
.knopf-primaer:disabled { background: #b7c2d0; cursor: default; }
.hinweis { font-size: 12px; color: #667085; margin: 0 0 10px; }
.meldung { color: #c03535; font-size: 13px; min-height: 1em; margin: 8px 0 0; }

.sprachwahl { display: inline-flex; gap: 2px; }
.seitensprache { padding: 2px 7px; font-size: 11px; border: 1px solid #98a2b3; background: transparent; color: inherit; border-radius: 4px; cursor: pointer; }
.seitensprache.aktiv { background: #375a8c; border-color: #375a8c; color: white; }

.wer { font-size: 13px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #364152; }
.wer-klein { font-size: 11px; color: #9aa7b8; margin-top: 2px; }
.wer-zeile { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: 12px; }
.wer-zeile a { color: #9ec1f0; text-decoration: none; }
.wer-zeile .sprachwahl { margin-left: auto; }
.dialog-item.leer { opacity: 0.45; }

#pruef-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  background: white; border: 1px solid #d0d5dd; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
#pruef-fortschritt { flex: 1; display: grid; gap: 6px; }
.fortschritt-zeile { display: grid; grid-template-columns: minmax(260px, auto) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.coverage-bar.hell { background: #e4e7ec; height: 6px; }
.pruef-knoepfe { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.pruef-knoepfe a { color: #375a8c; }

#pruef-panel { background: white; border: 1px solid #d0d5dd; border-radius: 8px; padding: 16px; }
#pruef-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; font-size: 13px; }
#pruef-toolbar button { padding: 5px 12px; border-radius: 6px; border: 1px solid #d0d5dd; background: white; cursor: pointer; }
#pruef-status { color: #667085; }
.gesperrt-hinweis { background: #ecfdf3; border: 1px solid #a6f4c5; color: #05603a; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; font-size: 13px; }
table#pruef-tabelle { width: 100%; border-collapse: collapse; font-size: 13px; }
#pruef-tabelle th { text-align: left; border-bottom: 2px solid #e4e7ec; padding: 6px 8px; }
#pruef-tabelle td { border-bottom: 1px solid #eef0f3; padding: 6px 8px; vertical-align: top; }
#pruef-tabelle .key-cell { font-family: ui-monospace, monospace; font-size: 11px; color: #667085; width: 190px; word-break: break-all; }
#pruef-tabelle .neutral-cell, #pruef-tabelle .uebersetzung-cell { width: 28%; white-space: pre-wrap; }
#pruef-tabelle .uebersetzung-cell { font-weight: 500; }
#pruef-tabelle .uebersetzung-cell.leer { color: #b64a4a; font-style: italic; font-weight: 400; }
#pruef-tabelle tr.zeile-ok td { background: #f3fbf6; }
#pruef-tabelle tr.zeile-anmerkung td { background: #fff8eb; }
#pruef-tabelle tr.blinken td { background: #dbe8fb; transition: background 0.3s; }
.geaendert { color: #b54708; font-size: 11px; font-weight: 400; margin-top: 4px; }
.bewertung-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.bewertung-knoepfe button { padding: 4px 10px; border-radius: 6px; border: 1px solid #d0d5dd; background: white; cursor: pointer; font-size: 12px; }
.bewertung-knoepfe button:disabled { opacity: 0.5; cursor: default; }
.bew-ok.gewaehlt { background: #1f9d55; border-color: #1f9d55; color: white; }
.bew-anmerkung.gewaehlt { background: #f0a63a; border-color: #f0a63a; color: white; }
.anmerkung-info { flex-basis: 100%; white-space: pre-wrap; font-size: 12px; color: #93370d; }
.link-knopf { border: none !important; background: none !important; color: #667085; text-decoration: underline; padding: 0 !important; }
.anmerkung-form label { display: block; font-size: 11px; color: #475467; margin-bottom: 6px; }
.anmerkung-form textarea { display: block; width: 100%; margin-top: 2px; padding: 4px 6px; border: 1px solid #d0d5dd; border-radius: 4px; font: inherit; font-size: 13px; }
.knopfzeile { display: flex; gap: 6px; }
.knopfzeile button { padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.knopfzeile .abbrechen { border: 1px solid #d0d5dd; background: white; }
.ctrl.bewertet-ok { outline: 2px solid #1f9d55; outline-offset: -2px; }
.ctrl.bewertet-anmerkung { outline: 2px solid #f0a63a; outline-offset: -2px; }

dialog#freigabe-dialog { border: none; border-radius: 10px; padding: 22px 24px; width: min(560px, 94vw); box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
dialog#freigabe-dialog h2 { margin: 0 0 12px; font-size: 17px; }
dialog fieldset { border: 1px solid #e4e7ec; border-radius: 6px; margin: 0 0 12px; padding: 8px 12px; font-size: 13px; }
dialog fieldset label { display: block; margin: 3px 0; }
.erklaerung { font-size: 13px; background: #f9fafb; padding: 8px 10px; border-radius: 6px; margin: 4px 0 8px; }
.dialog-knoepfe { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-knoepfe button { padding: 7px 14px; border-radius: 6px; cursor: pointer; }
.dialog-knoepfe button:not(.knopf-primaer) { border: 1px solid #d0d5dd; background: white; }

/* ---------------------------------------------------------------- Verwaltung */
.verwaltung { max-width: 1200px; margin: 0 auto; padding: 24px; }
.verwaltung h1 { font-size: 20px; margin: 0; }
.verwaltung-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.verwaltung-kopf a { color: #375a8c; font-size: 13px; margin-left: 14px; }
.karte { background: white; border: 1px solid #d0d5dd; border-radius: 8px; padding: 16px 18px; margin-bottom: 18px; }
.karte h2 { font-size: 15px; margin: 0 0 10px; }
.karte table { width: 100%; border-collapse: collapse; font-size: 13px; }
.karte th { text-align: left; border-bottom: 2px solid #e4e7ec; padding: 6px; font-size: 12px; color: #475467; }
.karte td { border-bottom: 1px solid #eef0f3; padding: 6px; vertical-align: top; }
.karte td.mono, .mono { font-family: ui-monospace, monospace; font-size: 11px; word-break: break-all; }
.formzeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.formzeile .feld { margin: 0; }
.sprachkaestchen { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin-bottom: 10px; }
.klein-knopf { padding: 3px 9px; border-radius: 5px; border: 1px solid #d0d5dd; background: white; cursor: pointer; font-size: 12px; margin: 0 4px 4px 0; }
.klein-knopf.gefahr { color: #b42318; border-color: #fda29b; }
.ok-text { color: #1f9d55; font-weight: 600; } .bad-text { color: #d64545; font-weight: 600; }
.muted { color: #667085; }
.pre { white-space: pre-wrap; }

/* WinForms-Nachbildung: AutoSize-Labels wachsen einzeilig mit, Text oben links */
.ctrl.ctrl-autosize { white-space: pre; overflow: visible; width: max-content; }
.ctrl.oben { align-items: flex-start; }
.ctrl.ueberlauf { outline: 2px dashed #d64545; outline-offset: 1px; }
#mockup { overflow: visible; }
