/* Bildbearbeitung – gleiche Grundlage wie der Neukölln-Navigator-Admin */

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --rot: #df1c2d;
  --schwarz: #1a1a1a;
  --grau: #6e6e6a;
  --grau-hell: #f4f4f2;
  --rand: #e2e2de;
  --weiss: #fff;
  --radius: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--schwarz);
  background: var(--grau-hell);
}

img { max-width: 100%; }

button, input, select { font: inherit; }

:focus-visible { outline: 2px solid var(--rot); outline-offset: 2px; }

[hidden] { display: none !important; }


.admin-shell { display: flex; min-height: 100vh; }

.admin-nav {
  width: 220px;
  flex: none;
  background: var(--schwarz);
  color: var(--weiss);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.admin-nav .marke {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.2rem 1.2rem 1.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 0.8rem;
}

.admin-nav .marke-pin { width: 30px; }
.admin-nav .marke-logo { width: 118px; }

.admin-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0.65rem 1.2rem;
  font-size: 0.92rem;
}

.admin-nav a:hover { color: var(--weiss); background: rgba(255, 255, 255, 0.07); }

.admin-nav a.aktiv {
  color: var(--weiss);
  background: var(--rot);
  font-weight: 600;
}

.admin-nav .spacer { flex: 1; }

.nav-hinweis {
  margin: 0;
  padding: 0.8rem 1.2rem 0.2rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  line-height: 1.45;
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.4rem 4rem;
}

.admin-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.admin-kopf h1 { font-size: 1.5rem; margin: 0; }
.admin-kopf-aktionen { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.leise { color: var(--grau); font-size: 0.84rem; line-height: 1.45; margin: 0.35rem 0 0; }
.lead { max-width: 46rem; margin-top: 0.45rem; }

label { display: block; font-weight: 600; font-size: 0.85rem; }

input[type="text"],
input[type="number"],
select {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--weiss);
  color: inherit;
}

input:focus, select:focus { outline: 2px solid var(--rot); outline-offset: -1px; border-color: var(--rot); }

.feld { margin-bottom: 0.95rem; }
.felder-zeile { display: flex; gap: 0.8rem; }
.felder-zeile .feld { flex: 1; min-width: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.3rem;
  border: none;
  border-radius: var(--radius);
  background: var(--rot);
  color: var(--weiss);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { filter: brightness(0.92); }
.btn.sekundaer { background: var(--weiss); color: var(--schwarz); border: 1px solid var(--rand); }
.btn.sekundaer:hover { filter: none; border-color: var(--schwarz); }
.btn.klein { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
.btn.gefahr { background: var(--weiss); color: #b00020; border: 1px solid #e8c4c9; }
.btn.gefahr:hover { background: #fdf0f1; filter: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.meldung {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  background: #e7f5e9;
  border: 1px solid #bfe3c4;
  color: #1d6b2a;
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.meldung.fehler { background: #fdf0f1; border-color: #e8c4c9; color: #b00020; }
.meldung.datei-warnung { display: none; }
html.als-datei .meldung.datei-warnung { display: flex; }
.meldung .hinweis-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hinweis-aktionen { display: flex; gap: 0.4rem; align-items: center; }

.ikon-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  background: var(--weiss);
  border: 1px solid var(--rand);
  border-radius: 4px;
  color: var(--schwarz);
  cursor: pointer;
}

.karte-box {
  background: var(--weiss);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
}

.karte-box h2 { font-size: 1.05rem; margin: 0 0 0.35rem; }

.arbeit {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.vorgabe-spalte {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.dropzone {
  border: 2px dashed var(--rand);
  border-radius: var(--radius);
  background: var(--weiss);
  padding: 1.3rem 1rem 1.15rem;
  text-align: center;
  margin-bottom: 1rem;
}

.dropzone stark, .dropzone strong { display: block; font-size: 1.02rem; margin-bottom: 0.25rem; }

body.datei-darueber .dropzone {
  border-color: var(--rot);
  background: #fff6f6;
}

.massstab-zeile {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  margin: 0.2rem 0 0.8rem;
}

.massstab-zeile label { flex: 1; min-width: 0; }

.feld-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.feld-kopf output,
output.wert {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--grau);
}

input[type="range"] {
  width: 100%;
  margin: 0.4rem 0 0;
  accent-color: var(--rot);
}

.wahl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.wahl button {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--weiss);
  color: var(--schwarz);
  border: 1px solid var(--rand);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  cursor: pointer;
}

.wahl button:hover { border-color: var(--schwarz); }

.wahl button.aktiv,
.wahl button.aktiv:hover {
  background: var(--rot);
  border-color: var(--rot);
  color: var(--weiss);
}

.knopf-zeile { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.8rem; }

details summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--grau);
  margin: 0.4rem 0 0.65rem;
}

.abschnitt {
  margin: 0.2rem 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--grau);
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0.7rem 0 0.2rem;
}

.check input { accent-color: var(--rot); width: auto; }

.bild {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1rem;
  align-items: start;
}

.bild.ist-eigen { border-color: var(--rot); }

.bild-buehne { min-width: 0; overflow-x: auto; }

.bild-rahmen {
  position: relative;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ecece8 25%, transparent 25%),
    linear-gradient(-45deg, #ecece8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ecece8 75%),
    linear-gradient(-45deg, transparent 75%, #ecece8 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  border-radius: 4px;
  user-select: none;
  touch-action: pan-x pan-y;
}

.bild-rahmen.beschnitten { cursor: grab; touch-action: none; }
body.zieht .bild-rahmen.beschnitten { cursor: grabbing; }

.bild-rahmen.ohne-alpha {
  background: #fff;
  background-image: none;
}

.bild-rahmen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.bild-ziehhinweis { margin-top: 0.4rem; }

.bild-meta { position: sticky; top: 1rem; align-self: start; min-width: 0; }

.name-zeile { display: flex; align-items: center; gap: 0.35rem; }
.name-zeile input { flex: 1; min-width: 0; }
.name-ext { font-weight: 700; color: var(--grau); white-space: nowrap; }

.bild-fakten, .bild-ausgabe, .name-hinweis { margin: 0.45rem 0 0; }
.bild-ausgabe { font-weight: 600; color: var(--schwarz); font-size: 0.88rem; }
.name-hinweis { color: #9a6a12; }

.bild-aktionen { margin-top: 0.8rem; }

.eigen-slot { margin-top: 0.3rem; }
.eigen-slot .kontrolle { margin-top: 0.7rem; padding-top: 0.2rem; border-top: 1px solid var(--rand); }

dialog {
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.2rem;
  width: min(440px, calc(100% - 2rem));
  color: var(--schwarz);
  background: var(--weiss);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

dialog::backdrop { background: rgba(26, 26, 26, 0.45); }
dialog h2 { font-size: 1.05rem; margin: 0 0 0.7rem; }

.balken {
  height: 8px;
  background: var(--grau-hell);
  border-radius: 100px;
  overflow: hidden;
  margin: 0.9rem 0 1rem;
}

.balken > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--rot);
}

.dialog-aktionen { display: flex; justify-content: flex-end; gap: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .balken > span { transition: none; }
}

@media (max-width: 980px) {
  .admin-shell { flex-direction: column; }
  .admin-nav {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.4rem 0 0.6rem;
  }
  .admin-nav .marke { border: 0; margin: 0; padding: 0.6rem 1rem; }
  .admin-nav .spacer, .nav-hinweis { display: none; }
  .admin-main { padding: 1.1rem; }
  .arbeit, .bild { grid-template-columns: 1fr; }
  .vorgabe-spalte, .bild-meta { position: static; max-height: none; }
  .admin-kopf { flex-direction: column; }
  .felder-zeile { flex-direction: column; gap: 0; }
}
