/*
 * Growth Cockpit — Oberflaeche des In-App-Editors (Mini-Admin, Spec A8).
 *
 * Alle Regeln haengen an body.cockpit-edit und wirken damit ausschliesslich im
 * Editier-Modus. Am Cockpit selbst wird nichts umgestellt: der Editier-Modus schaltet
 * die vorhandene Bewertungssicht (body.view-bew) ein, sodass die Darstellung dieselbe
 * ist wie damals mit eingeblendeter Bewertung — inklusive der farbigen Baender, die
 * dadurch auch in den Eingabefeldern richtig aussehen.
 */

/* Platz fuer die Leisten oben und unten. */
body.cockpit-edit { padding-top: 28px; padding-bottom: 60px; }
/* Die Kopfzeile des Cockpits klebt oben (position:sticky, top:0) — im Editier-Modus
   rueckt sie unter die Hinweisleiste, statt von ihr verdeckt zu werden. */
body.cockpit-edit header { top: 28px; }

/* ===== Hinweisleiste oben ===== */
.ed-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9450;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F2B15A;
  color: #1A1A1A;
  font: 700 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .8px;
  text-transform: uppercase;
}

/* ===== Bearbeitbare Stellen ===== */
body.cockpit-edit .ed-t {
  cursor: text;
  border-radius: 3px;
  transition: box-shadow .12s ease, background-color .12s ease;
}
body.cockpit-edit .ed-t:hover {
  box-shadow: 0 0 0 2px rgba(32, 60, 127, .38);
  background: rgba(32, 60, 127, .06);
}
/* geaendert, noch nicht gespeichert */
body.cockpit-edit .ed-t.ed-dirty {
  box-shadow: 0 0 0 2px #E0932B;
  background: rgba(224, 147, 43, .14);
}
/* zwischenzeitlich von jemand anderem geaendert bzw. beanstandet */
body.cockpit-edit .ed-t.ed-conflict,
body.cockpit-edit .ed-t.ed-problem {
  box-shadow: 0 0 0 2px #C0392B;
  background: rgba(192, 57, 43, .10);
}

/* ===== Popover ===== */
.ed-pop {
  position: fixed;
  z-index: 9500;
  width: min(520px, calc(100vw - 24px));
  background: #fff;
  color: #1A1A1A;
  border: 1px solid #d5dae3;
  border-radius: 8px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .28);
  font: 13px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}
.ed-pop-head {
  background: #F3F5F9;
  border-bottom: 1px solid #e3e7ee;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #55607A;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ed-pop-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; }

.ed-lab {
  font-size: 11px;
  font-weight: 700;
  color: #55607A;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 6px;
}
.ed-lab-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #8A93A6;
}
.ed-field {
  border: 1px solid #c9d0dc;
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 36px;
  background: #fff;
  outline: none;
  font: inherit;
  color: #1A1A1A;
}
.ed-field:focus {
  border-color: #203C7F;
  box-shadow: 0 0 0 3px rgba(32, 60, 127, .14);
}

.ed-msg {
  margin: 0 12px 8px;
  padding: 7px 9px;
  border-radius: 5px;
  background: #FDECEA;
  color: #A93226;
  font-size: 12px;
}
.ed-problem-box {
  margin: 10px 12px 0;
  padding: 8px 10px;
  border-radius: 5px;
  background: #FDECEA;
  color: #A93226;
  font-size: 12px;
}

/* ===== Kollision: fremde Fassung zum Vergleich ===== */
.ed-conflict-box {
  margin: 10px 12px 0;
  padding: 9px 10px;
  border: 1px solid #EBC3BD;
  border-left: 3px solid #C0392B;
  border-radius: 5px;
  background: #FDF4F3;
}
.ed-conflict-head { font-size: 12px; font-weight: 600; color: #A93226; margin-bottom: 6px; }
.ed-tagname {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #8A93A6;
  margin-top: 6px;
}
.ed-ro {
  background: #fff;
  border: 1px solid #e3e7ee;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12.5px;
}
.ed-take-theirs {
  margin-top: 8px;
  border: 1px solid #C0392B;
  background: #fff;
  color: #A93226;
  border-radius: 5px;
  padding: 5px 10px;
  font: 600 12px/1 system-ui, sans-serif;
  cursor: pointer;
}
.ed-take-theirs:hover { background: #C0392B; color: #fff; }

/* ===== Knoepfe ===== */
.ed-pop-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 12px;
}
/* „Änderung verwerfen" steht links abgesetzt — es nimmt zurueck, waehrend die beiden
   rechten Knoepfe die Eingabe abschliessen. */
.ed-revert {
  margin-right: auto;
  background: #fff;
  color: #A9722A;
  border-color: #E3C79B;
}
.ed-revert:hover:not(:disabled) { background: #FDF3E4; }
.ed-revert:disabled { opacity: .4; cursor: default; }
.ed-pop-actions button,
.ed-bar button {
  border-radius: 5px;
  padding: 6px 12px;
  font: 600 12px/1.2 system-ui, sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
}
.ed-apply { background: #203C7F; color: #fff; }
.ed-apply:hover { background: #172E63; }
.ed-cancel { background: #fff; color: #55607A; border-color: #c9d0dc; }
.ed-cancel:hover { background: #F3F5F9; }

/* ===== Termin-Zellen: Datumsfeld statt DE/EN-Feldern ===== */
.ed-pop-date { width: min(460px, calc(100vw - 24px)); }
.ed-pop-date .ed-pop-actions { flex-wrap: wrap; }
.ed-date-row { position: relative; display: flex; gap: 6px; align-items: stretch; }
.ed-date-text {
  flex: 1;
  min-width: 0;
  border: 1px solid #c9d0dc;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  color: #1A1A1A;
  outline: none;
}
.ed-date-text:focus {
  border-color: #203C7F;
  box-shadow: 0 0 0 3px rgba(32, 60, 127, .14);
}
.ed-date-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  border: 1px solid #c9d0dc;
  border-radius: 6px;
  background: #fff;
  color: #203C7F;
  cursor: pointer;
}
.ed-date-pick:hover { background: #F3F5F9; }
/* Das eigentliche Datumsfeld des Browsers liefert nur den Kalender: unsichtbar unter
   dem Knopf, damit der Kalender dort aufgeht. Kann der Browser das nicht (kein
   showPicker), wird es eingeblendet und direkt bedient. */
.ed-date-native {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 38px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  pointer-events: none;
}
.ed-date-native.ed-date-native-open {
  position: static;
  width: auto;
  height: auto;
  opacity: 1;
  pointer-events: auto;
  border: 1px solid #c9d0dc;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}
.ed-date-preview { min-height: 18px; font-size: 12px; color: #8A93A6; margin-top: 4px; }
.ed-date-preview.ed-date-ok { color: #3B7D3F; }
.ed-date-preview.ed-date-bad { color: #A9722A; }
.ed-date-clear { background: #fff; color: #55607A; border-color: #c9d0dc; }
.ed-date-clear:hover { background: #F3F5F9; }

/* ===== Schalter „Erledigte Vorhaben oben | unten" ueber dem Board ===== */
.ed-setting {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 8px 0 6px;
  padding: 6px 10px;
  border: 1px dashed #c9d0dc;
  border-radius: 6px;
  background: #F7F9FC;
  font: 12px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #55607A;
}
.ed-setting-label { font-weight: 700; }
.ed-seg { display: inline-flex; border: 1px solid #c9d0dc; border-radius: 5px; overflow: hidden; }
.ed-seg button {
  border: 0;
  background: #fff;
  color: #55607A;
  padding: 4px 12px;
  font: 600 12px/1.2 system-ui, sans-serif;
  cursor: pointer;
}
.ed-seg button + button { border-left: 1px solid #c9d0dc; }
.ed-seg button.ed-on { background: #203C7F; color: #fff; }
.ed-setting-note { color: #8A93A6; }
.ed-setting.ed-dirty { border: 2px solid #E0932B; background: rgba(224, 147, 43, .10); }
.ed-setting.ed-dirty .ed-setting-note { color: #A9722A; }
.ed-setting.ed-problem { border: 2px solid #C0392B; background: rgba(192, 57, 43, .08); }
.ed-setting.ed-problem .ed-setting-note { color: #A93226; }

/* ===== Leiste am unteren Rand ===== */
.ed-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9400;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  background: #1A1A1A;
  color: #fff;
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, .22);
}
.ed-bar-info { white-space: nowrap; }
.ed-bar.ed-has-changes .ed-count { color: #F2B15A; }
.ed-bar-actions { margin-left: auto; display: flex; gap: 8px; }
.ed-discard, .ed-download {
  background: transparent;
  color: #D5DAE3;
  border-color: #4A4A4A;
}
.ed-discard:hover:not(:disabled), .ed-download:hover { background: #2C2C2C; color: #fff; }
/* Ersetzt den ganzen Datensatz — deshalb abgesetzt und nicht neben „Speichern" verwechselbar. */
.ed-reseed {
  background: transparent;
  color: #F09189;
  border-color: #6B3A36;
}
.ed-reseed:hover { background: #3A2422; color: #fff; }
.ed-save { background: #E0932B; color: #1A1A1A; }
.ed-save:hover:not(:disabled) { background: #F2B15A; }
.ed-bar button:disabled { opacity: .45; cursor: default; }

.ed-status { font-size: 12px; }
.ed-status-ok    { color: #7FD18E; }
.ed-status-warn  { color: #F2B15A; }
.ed-status-error { color: #F09189; }
.ed-status-info  { color: #A9B2C4; }

@media (max-width: 640px) {
  .ed-bar { flex-wrap: wrap; gap: 8px; }
  .ed-bar-actions { margin-left: 0; width: 100%; }
  .ed-bar button { flex: 1; }
}
