/* Clipping Studio — schlichtes Admin-Layout. App-Farben heißen --ui-…; die Variablen --color-…
   und --type-… gehören den Looks (build/<brand>/<look>.css) und wirken nur in der Look-Vorschau. */
:root {
  --ui-bg: #f5f5f3;
  --ui-panel: #ffffff;
  --ui-text: #1d1d1f;
  --ui-muted: #67676c;
  --ui-border: #e1e1dc;
  --ui-accent: #2f5d9e;
  --ui-accent-weich: #e9eff8;
  --ui-danger: #b3261e;
  --ui-danger-weich: #fcebea;
  --ui-ok: #256b29;
  --ui-ok-weich: #e8f4e9;
  --ui-warn: #7a5000;
  --ui-warn-weich: #fff3d6;
  --ui-radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ui-bg); color: var(--ui-text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--ui-accent); }
code { font-size: .9em; background: #ebebe6; padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

/* Kopf und Navigation */
.kopf { background: var(--ui-panel); border-bottom: 1px solid var(--ui-border); }
.kopf-innen {
  max-width: 1120px; margin: 0 auto; padding: 8px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
}
.logo { font-weight: 700; color: var(--ui-text); text-decoration: none; white-space: nowrap; padding: 6px 0; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 auto; }
.nav a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 10px;
  border-radius: 8px; color: var(--ui-text); text-decoration: none;
}
.nav a:hover { background: var(--ui-bg); }
.nav a.aktiv { background: var(--ui-accent-weich); color: var(--ui-accent); font-weight: 600; }
.wer { display: flex; align-items: center; gap: 8px; color: var(--ui-muted); font-size: .9em; min-width: 0; }
.wer form { margin: 0; }
/* Handy: höchstens 2 Zeilen — Logo + Nutzer/Abmelden oben, Navigation als eine Zeile darunter */
@media (max-width: 520px) {
  .kopf-innen { padding: 6px 12px; gap: 0 10px; }
  .logo { order: 1; padding: 4px 0; min-height: 32px; display: inline-flex; align-items: center; }
  .wer { order: 2; margin-left: auto; gap: 6px; }
  .wer span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wer .knopf.leise { min-height: 32px; padding: 4px 10px; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; gap: 0; }
  .nav a { flex: none; padding: 6px 8px; }
}

main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 1.45rem; margin: 0 0 4px; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
.unter { color: var(--ui-muted); margin: 0 0 20px; }
.titelzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 4px; }
.titelzeile h1 { margin: 0; }
.leise { color: var(--ui-muted); }
.klein { font-size: .85em; }
.zurueck { margin: 0; }

/* Bausteine */
.karte {
  background: var(--ui-panel); border: 1px solid var(--ui-border); border-radius: var(--ui-radius);
  padding: 16px; margin-bottom: 16px; min-width: 0;
}
.karte > :last-child { margin-bottom: 0; }
.raster { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  margin-bottom: 16px; }
.raster > .karte { margin-bottom: 0; }
.raster.breit { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.zahlen { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); margin-bottom: 16px; }
.zahl { background: var(--ui-panel); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); padding: 12px 14px; }
.zahl b { display: block; font-size: 1.6rem; line-height: 1.2; }
.zahl span { color: var(--ui-muted); font-size: .9em; }
.felder { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; align-items: baseline; }
.felder dt { color: var(--ui-muted); }
.felder dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .felder { gap: 6px 12px; } }
@media (max-width: 360px) {                       /* erst sehr schmal einspaltig */
  .felder { grid-template-columns: 1fr; gap: 2px; }
  .felder dd { margin-bottom: 8px; }
}
ul.liste { margin: 0; padding-left: 20px; }
ul.liste li { margin-bottom: 4px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; line-height: 1.5;
  background: #ececea; color: #45454a; white-space: nowrap; vertical-align: middle;
}
.badge.warn { background: var(--ui-warn-weich); color: var(--ui-warn); }
.badge.ok { background: var(--ui-ok-weich); color: var(--ui-ok); }
.badge.fehler { background: var(--ui-danger-weich); color: var(--ui-danger); }
.badge.info { background: var(--ui-accent-weich); color: var(--ui-accent); }
.punkt { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: -1px; }

.hinweis, .fehlerbox, .okbox { padding: 10px 12px; border-radius: 8px; margin: 0 0 14px; }
.hinweis { background: var(--ui-warn-weich); color: var(--ui-warn); }
.fehlerbox { background: var(--ui-danger-weich); color: var(--ui-danger); }
.okbox { background: var(--ui-ok-weich); color: var(--ui-ok); }

.tap { display: inline-flex; align-items: center; min-height: 32px; }
.tabelle-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ui-border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-muted); font-weight: 600; white-space: nowrap; }
td.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; }
td.nowrap { white-space: nowrap; }
/* Handy: Tabellen ohne Wischen. .stapel = je Zelle Label (data-label) + Wert untereinander;
   .stapel.fluss = Zellen fließen nebeneinander ohne Label, td.ganz in eigener Zeile. */
@media (max-width: 520px) {
  table.stapel thead { display: none; }
  table.stapel, table.stapel tbody, table.stapel tr { display: block; }
  table.stapel tr { padding: 8px 0; border-bottom: 1px solid var(--ui-border); }
  table.stapel tr:first-child { padding-top: 0; }
  table.stapel tr:last-child { border-bottom: 0; padding-bottom: 0; }
  table.stapel td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 8px; align-items: baseline;
    border: 0; padding: 2px 0; overflow-wrap: anywhere; }
  table.stapel td::before { content: attr(data-label); font-size: .72rem; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--ui-muted); }
  table.stapel .badge { white-space: normal; justify-self: start; }
  table.stapel.fluss tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
  table.stapel.fluss td { display: block; padding: 0; }
  table.stapel.fluss td::before { content: none; }
  table.stapel.fluss td.ganz { flex-basis: 100%; }
  table.stapel.fluss td.leer { display: none; }
}

/* Seitenliste */
.seiten-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.seiten-liste a {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--ui-border); border-radius: 8px; color: var(--ui-text); text-decoration: none; min-width: 0;
}
.seiten-liste a:hover { border-color: var(--ui-accent); }
.seiten-liste .nr { color: var(--ui-muted); width: 1.6em; text-align: right; flex: none; }
.seiten-liste .titel { flex: 1; min-width: 0; overflow-wrap: break-word; hyphens: auto; }   /* umbrechen, nie kürzen */
.seiten-liste .badge { flex: none; }
.konten { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Formulare */
form .feld { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92em; }
input[type=text], input[type=password] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--ui-border); border-radius: 8px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ui-text);
}
input:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 3px var(--ui-accent-weich); }
.knopf {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 18px;
  border-radius: 8px; border: 1px solid var(--ui-accent); background: var(--ui-accent); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
}
.knopf:hover { filter: brightness(1.08); }
.knopf.leise { background: transparent; color: var(--ui-text); border-color: var(--ui-border); min-height: 36px; padding: 6px 12px; font-weight: 500; }
.formular-2 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.login-rahmen { max-width: 380px; margin: 8vh auto 0; }
.login-rahmen h1 { margin-bottom: 16px; }
.login-rahmen .knopf { width: 100%; }

/* Custom-Select (Konvention content-studio: .sel-wrap + .sel-trigger, Panel .sel-panel .sel-opt).
   Der native <select> bleibt unsichtbar im DOM und ist die Wahrheitsquelle (Wert, required). */
.sel-wrap { position: relative; display: block; width: 100%; }
.sel-wrap > select {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  border: 0; opacity: 0; pointer-events: none;
}
.sel-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 44px;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--ui-border); background: #fff;
  color: var(--ui-text); font: inherit; font-size: 16px; cursor: pointer; user-select: none;
}
.sel-trigger:hover, .sel-trigger:focus, .sel-wrap.sel-open > .sel-trigger { outline: none; border-color: var(--ui-accent); }
.sel-wrap.sel-invalid > .sel-trigger { border-color: var(--ui-danger); }
.sel-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sel-label.sel-placeholder { color: var(--ui-muted); }
.sel-caret { flex: none; color: var(--ui-muted); font-size: .65em; }
.sel-panel {
  position: fixed; z-index: 1000; margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1px solid var(--ui-border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.14);
}
.sel-opt { padding: 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.sel-opt.sel-active { background: var(--ui-bg); }
.sel-opt.sel-selected { color: var(--ui-accent); font-weight: 600; }
.sel-opt.sel-empty { color: var(--ui-muted); }

/* Look-Vorschau: Werte aus build/<brand>/<look>.css über den data-look-Container */
.look-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.look-kopf h3 { margin: 0; flex: 1 1 auto; min-width: 0; }
.look-probe {
  position: relative; background: var(--color-bg-base); color: var(--color-text-strong);
  border: 1px solid rgba(0,0,0,.07); border-radius: 8px; padding: 18px 18px 20px; overflow: hidden;
}
.probe-eyebrow {
  margin: 0; font-family: var(--type-eyebrow-family); font-weight: var(--type-eyebrow-weight);
  font-size: calc(var(--type-eyebrow-size) * .4); text-transform: var(--type-eyebrow-transform);
  letter-spacing: var(--type-eyebrow-tracking, normal); color: var(--color-text-muted);
}
.probe-headline {
  margin: 6px 0 10px; font-family: var(--type-cover-headline-family); font-weight: var(--type-cover-headline-weight);
  font-size: calc(var(--type-cover-headline-size) * .28); line-height: var(--type-cover-headline-line-height);
  overflow-wrap: anywhere;
}
.akzent-kursiv .probe-akzent { font-style: italic; font-weight: 400; }
.akzent-farbe .probe-akzent, .akzent-keiner .probe-akzent { color: var(--color-accent-primary); }
.probe-body {
  margin: 0; font-family: var(--type-body-family); font-weight: var(--type-body-weight);
  font-size: calc(var(--type-body-size) * .38); line-height: var(--type-body-line-height); color: var(--color-text-body);
}
.probe-closing {
  margin: 12px 0 0; font-family: var(--type-closing-headline-family); font-style: var(--type-closing-headline-style);
  font-weight: var(--type-closing-headline-weight); font-size: calc(var(--type-closing-headline-size) * .24);
  color: var(--color-accent-primary);
}
.probe-signatur { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; }
.farben { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.farbe { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ui-muted); min-width: 0; }
.farbe i { width: 20px; height: 20px; border-radius: 5px; border: 1px solid rgba(0,0,0,.15); flex: none; }
.farbe.geerbt span { font-style: italic; }
