/* Vinted Manager – ruhiges, seriöses Design
 *
 * Drei Farben, sonst nichts:
 *   Navy  #1d3557  – Akzent: Hauptknöpfe, aktive Navigation, Plus-Werte, Diagramme
 *   Stein (warme Grautöne) – Flächen, Linien, Text
 *   Rot   #b42318  – ausschließlich für Minus-Beträge, Fehler und „Achtung“
 * Keine Verläufe, keine bunten Kacheln, keine Schatten auf ruhenden Flächen.
 */
:root {
  /* Flächen (Stein) */
  --bg: #efeee9;          /* Rahmen */
  --sheet: #fafaf8;       /* Blatt mit dem Inhalt */
  --panel: #ffffff;       /* Karten */
  --panel-2: #f5f4f1;     /* eine Stufe abgesetzt */
  --panel-3: #ebe9e4;     /* aktiv / Spur */
  --line: #e4e2dc;        /* Kanten */
  --rule: #efede8;        /* Zeilenlinien */
  --line-2: #d3d0c8;      /* Eingabefelder, Knöpfe */
  /* Schrift */
  --text: #15171b;
  --muted: #5b5e65;
  --faint: #6b6e74;       /* hellstes Grau mit ≥ 4.5:1 auf dem Blatt */
  /* Akzent: Navy */
  --accent: #1d3557;
  --accent-2: #142740;
  --accent-ink: #ffffff;
  --accent-soft: #e9edf2;
  --primary: #1d3557;
  /* Alte Farbnamen zeigen auf die drei Farben (Grün = Navy, Gelb = Stein) */
  --green: #1d3557;  --green-soft: #e9edf2;  --green-ink: #142740;
  --red: #b42318;    --red-soft: #fbeceb;    --red-ink: #7a1a12;
  --amber: #4a4d53;  --amber-soft: #f3f2ee;  --amber-line: #dedbd3;
  --violet: var(--accent); --violet-soft: var(--accent-soft);
  /* Form */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-sheet: 16px;
  --shadow: 0 12px 32px rgba(20, 24, 32, .14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 16px; }
h3 { font-size: 14.5px; }
p { margin: 0 0 8px; }
.icon { flex: none; }
.num, .kpi-value, td.r, .tabular, .rank-val { font-variant-numeric: tabular-nums; }
::selection { background: #d5dce6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ Rahmen & Blatt */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 16px 12px;
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 2px 8px 6px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
}
.brand strong { display: block; font-size: 14.5px; }
.brand small { display: block; color: var(--faint); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 12px; font-weight: 500; color: var(--faint); padding: 16px 10px 4px; }
.nav-group:first-child { padding-top: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm); color: var(--muted); font-weight: 400;
}
.nav-ico { display: grid; place-items: center; color: var(--faint); }
.nav a:hover { background: rgba(21, 23, 26, .04); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.nav a.active .nav-ico { color: var(--accent); }
em.neu { font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 99px; margin-left: auto; }
.tile em.neu { margin-left: 6px; vertical-align: 1px; }
.sidebar-foot { margin-top: auto; padding: 0 2px; }

.main {
  min-width: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-sheet);
  margin: 8px 8px 8px 0; min-height: calc(100vh - 16px);
}
.view { max-width: 1240px; margin: 0 auto; padding: 24px 28px 56px; transition: opacity .15s; }
.view.loading { opacity: .6; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-eyebrow { font-size: 13px; color: var(--faint); margin-bottom: 2px; }  /* Brotkrume, keine Großbuchstaben */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section { margin-top: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title h2 { font-size: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- Karten */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; }
.card-body { padding: 16px 20px; }
.grid { display: grid; gap: 16px; }
.grid > *, .g-main > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* Kennzahlen: Zahl statt Kachel-Deko – Beschriftung oben, Wert groß in Schwarz */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { color: var(--faint); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.kpi.hero .kpi-value { font-size: 30px; }
.kpi.pos .kpi-value { color: var(--text); }
.kpi.neg .kpi-value { color: var(--red); }

/* --------------------------------------------------------------- Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: var(--accent-2); }
.btn-danger { background: var(--panel); border-color: #ecc9c5; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }

/* -------------------------------------------- Status (blasse Farbpaare) */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; flex: none;
  font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--panel-3); color: #44474d;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.muted::before { display: none; }
.st-entwurf { background: var(--panel-3); color: var(--muted); }
.st-bereit { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.st-online { background: var(--accent-soft); color: var(--accent-2); }
.st-reserviert { background: var(--panel-3); color: var(--text); }
.st-verkauft { background: var(--accent); color: #fff; }
.badge.warn { background: var(--amber-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--amber-line); }
.badge.warn::before { background: var(--red); opacity: 1; }
.badge.ok { background: var(--accent-soft); color: var(--accent-2); }
.badge.bad { background: var(--red-soft); color: var(--red-ink); }
.chip-missing { display: inline-block; font-size: 12px; color: var(--red-ink); }

/* --------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 400; color: var(--faint);
  padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--panel-2); }
.tbl .r { text-align: right; }
.tbl .name { font-weight: 500; }
.tbl .sub { color: var(--faint); font-size: 12.5px; }

.thumb { border-radius: 6px; object-fit: cover; background: var(--panel-3); display: block; flex: none; }
.thumb-empty { display: grid; place-items: center; color: var(--faint); background: transparent; border: 1px dashed var(--line-2); }
.item-cell { display: flex; gap: 12px; align-items: center; min-width: 220px; }

/* ------------------------------------------------------------- Formulare */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.f { display: flex; flex-direction: column; gap: 8px; grid-column: span 4; min-width: 0; }
.f.s3 { grid-column: span 3; } .f.s9 { grid-column: span 9; } .f.s6 { grid-column: span 6; } .f.s8 { grid-column: span 8; } .f.s12 { grid-column: span 12; } .f.s2 { grid-column: span 2; }
.f label, .lbl { font-size: 13px; color: var(--text); font-weight: 500; }
.f .hint { font-size: 12.5px; color: var(--faint); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 8px 11px; min-height: 36px; transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: #b9bec6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; min-height: 0; accent-color: var(--primary); margin: 0; }
input[type="date"] { color-scheme: light; }
.money { position: relative; }
.money input { padding-right: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.money::after { content: "€"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 36px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 2px; }

/* ----------------------------------------------------------- Filterleiste */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select { width: auto; }
.seg { display: inline-flex; background: var(--panel-3); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 500; font-size: 13px;
  padding: 5px 11px; border-radius: 6px; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.seg .count { color: var(--faint); margin-left: 5px; font-weight: 400; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--text); }
.tabs .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-left: 6px; vertical-align: middle; }

/* ------------------------------------------------------------ Listen */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--rule); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--panel-2); text-decoration: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .detail { color: var(--faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prio { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prio-1 { background: var(--red); } .prio-2 { background: var(--accent); } .prio-3 { background: var(--line-2); }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-title { color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 10px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--accent); color: var(--text); font-size: 13.5px;
}
.notice .icon { margin-top: 1px; color: var(--accent); }
.notice.warn { box-shadow: inset 3px 0 0 var(--red); }
.notice.warn .icon { color: var(--red); }
.notice.ok { box-shadow: inset 3px 0 0 var(--accent); }
.notice.ok .icon { color: var(--accent); }

/* ------------------------------------------------------------------ Fotos */
.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 32px 20px; text-align: center; cursor: pointer;
  background: var(--panel-2); color: var(--muted); transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.drop .icon { color: var(--muted); margin-bottom: 8px; }
.drop strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.drop.big { padding: 56px 20px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); aspect-ratio: 3 / 4; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo .tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.photo:hover .tools, .photo:focus-within .tools { opacity: 1; }
.photo .tools button { background: var(--panel); border: 1px solid var(--line-2); color: var(--text); width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.photo .tools button:hover { background: var(--panel-2); }
.photo .cover-tag { position: absolute; left: 6px; top: 6px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.lightbox { position: fixed; inset: 0; background: rgba(17, 20, 24, .9); display: grid; place-items: center; z-index: 60; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; }

/* --------------------------------------------------------------- Anzeige */
.ad-field { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
.ad-field header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ad-field header .lbl { margin: 0; }
.ad-field textarea, .ad-field input { border: 0; background: transparent; border-radius: 0 0 var(--radius) var(--radius); }
.ad-field textarea:focus, .ad-field input:focus { box-shadow: none; }
.conf { font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.conf-hoch { background: var(--green-soft); color: var(--green-ink); }
.conf-mittel { background: var(--amber-soft); color: var(--amber); }
.conf-niedrig { background: var(--red-soft); color: var(--red-ink); }
.conf-unbekannt { background: var(--panel-3); color: var(--muted); }
.gen-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gen-option { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.gen-option h3 { font-size: 14.5px; }
.gen-option p { color: var(--muted); font-size: 13px; flex: 1; }
.price-tag { font-weight: 500; font-size: 13px; }
.free { color: var(--green); } .paid { color: var(--amber); }
pre.prompt { white-space: pre-wrap; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; max-height: 220px; overflow: auto; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ Lager */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--panel-2); border-radius: var(--radius); min-width: 0; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
.col-head h3 { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.col-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.mini { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.mini:hover { border-color: var(--line-2); text-decoration: none; }
.mini .grow { flex: 1; min-width: 0; }
.mini .title { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .detail { font-size: 12.5px; color: var(--faint); }
.mini select { min-height: 30px; height: 30px; padding: 2px 6px; font-size: 12.5px; margin-top: 6px; }
.age-warn { color: var(--amber); }
.age-bad { color: var(--red); }

/* ------------------------------------------------------------- Diagramme */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--faint); font-size: 11.5px; font-family: inherit; }
.chart .grid-line { stroke: #ecebe6; stroke-width: 1; }
.chart .axis { stroke: var(--line-2); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------------------------------------------------------- Tagesroutine */
.progress { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.step { display: flex; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.step:last-child { border-bottom: 0; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--panel); color: var(--muted); font-weight: 600; font-size: 13px; border: 1px solid var(--line-2);
}
.step.done .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.step.done .step-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.step-title { font-weight: 600; }
.step .grow { flex: 1; min-width: 0; }
.step .info { color: var(--accent); font-size: 13px; font-weight: 500; }
.summary-box { white-space: pre-wrap; font-size: 13.5px; background: var(--panel-2); border-radius: var(--radius); padding: 14px 16px; line-height: 1.7; }

.delta { font-size: 12.5px; font-weight: 500; }
.breakdown { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; font-size: 14px; }
.breakdown .total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 600; }

/* ------------------------------------------------- Dialog & Hinweise (schweben → Schatten erlaubt) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .35); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
.modal { width: min(520px, 100%); max-height: 90vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); animation: pop .14s ease-out; }
.modal-wide { width: min(820px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 70; max-width: min(440px, calc(100vw - 32px)); }
.toast { padding: 11px 15px; border-radius: 8px; background: var(--primary); color: #fff; box-shadow: var(--shadow); font-weight: 500; animation: pop .15s ease-out; transition: opacity .3s, transform .3s; }
.toast-error { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------ Ranglisten & Analyse */
.rank { display: flex; flex-direction: column; gap: 12px; }
.rank-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.rank-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { color: var(--text); white-space: nowrap; }
.rank-bar { height: 6px; background: var(--panel-3); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.rank-bar > div { height: 100%; border-radius: 99px; }
.rank-sub { font-size: 12.5px; color: var(--faint); margin-top: 4px; }

.insight { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--panel); }
.insight h3 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; margin-bottom: 10px; }
.insight ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text); }
.dot-i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--line-2); }
.insight.good .dot-i { background: var(--green); } .insight.bad .dot-i { background: var(--red); }
.insight.info .dot-i { background: var(--accent); } .insight.warn .dot-i { background: var(--muted); }

.statement { font-size: 15px; line-height: 1.7; color: var(--text); }
.statement p { margin: 0 0 8px; }
.calc { display: grid; grid-template-columns: 1fr auto; gap: 9px 24px; font-size: 14px; }
.calc .num, .calc span:nth-child(even) { font-variant-numeric: tabular-nums; text-align: right; }
.calc .neg-line { color: var(--muted); }
.calc .sum { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 600; font-size: 15px; }
.calc .note { grid-column: 1 / -1; font-size: 12.5px; color: var(--faint); text-align: left; }

.rec { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.rec h3 { font-size: 15px; }
.rec .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rec .nums div { background: var(--panel-2); border-radius: 6px; padding: 8px 10px; }
.rec .nums small { display: block; color: var(--faint); font-size: 12px; }
.rec .nums strong { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.estimate { font-size: 12px; color: var(--muted); font-weight: 500; font-style: italic; }

.ai-report { font-size: 14px; line-height: 1.65; color: var(--text); }
.ai-report h4 { font-size: 15px; margin: 14px 0 6px; }
.ai-report .li { padding-left: 14px; position: relative; margin: 3px 0; }
.ai-report .li::before { content: "•"; position: absolute; left: 2px; color: var(--faint); }
.ai-report p { margin: 0 0 6px; }

.mini-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini-kpi { background: var(--panel-2); border-radius: var(--radius); padding: 10px 12px; }
.mini-kpi small { display: block; color: var(--faint); font-size: 12.5px; }
.mini-kpi strong { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ Bereiche (Kacheln) */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 104px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: border-color .12s, background .12s;
}
.tile:hover { text-decoration: none; border-color: var(--line-2); background: var(--panel-2); }
.tile-ico { color: var(--muted); display: block; }
.tile-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.tile-text strong { font-size: 14.5px; font-weight: 600; }
.tile-text small { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tiles-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ------------------------------------------------------------ Mittlere Breite */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ------------------------------------------------ Handy: Leiste unten + „Mehr“ */
.tabbar, .sheet { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .sidebar .nav, .brand small, .sidebar-foot { display: none; }
  .brand { padding: 0; }
  .main { margin: 0; border: 0; border-radius: 0; min-height: 0; }
  .view { padding: 20px 16px 110px; }
  .g2, .g3, .gen-options, .board { grid-template-columns: 1fr; }
  .f, .f.s3, .f.s2, .f.s6, .f.s8, .f.s9 { grid-column: span 12; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 0; padding: 14px; }
  .mini-kpis { grid-template-columns: repeat(2, 1fr); }
  .rec .nums { grid-template-columns: 1fr; }
  .btn { height: auto; min-height: 36px; padding-top: 7px; padding-bottom: 7px; white-space: normal; text-align: center; line-height: 1.3; }
  .btn-sm { min-height: 30px; padding-top: 5px; padding-bottom: 5px; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--panel); border-top: 1px solid var(--line); padding: 4px 10px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; padding: 6px 2px; border: 0; background: none;
    color: var(--faint); font: inherit; font-size: 11px; font-weight: 500; cursor: pointer; text-decoration: none;
  }
  .tabbar .active { color: var(--text); font-weight: 600; }
  .toasts { bottom: 84px; }
  .sheet.open { display: flex; position: fixed; inset: 0; z-index: 60; background: rgba(17, 24, 39, .35); align-items: flex-end; }
  .sheet-panel { width: 100%; max-height: 86vh; overflow-y: auto; background: var(--panel); border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
    padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); animation: sheet-up .18s ease-out; }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
  .sheet-group { font-size: 12.5px; font-weight: 500; color: var(--faint); margin: 16px 0 8px; }
}
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }

/* Lange Pfade/Links dürfen umbrechen (sonst zu breit auf dem Handy) */
code, .small a, pre { overflow-wrap: anywhere; word-break: break-word; }

/* ------------------------------------------------------------- Drucken */
@media print {
  body, .main { background: #fff; }
  .sidebar, .tabbar, .head-actions, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .main { border: 0; margin: 0; }
  .view { padding: 0; max-width: none; }
  .card, .kpi { break-inside: avoid; }
}

/* ------------------------------------------------ Kacheln (ruhig, ohne Farbe) */
.tile { background: var(--panel); border-color: var(--line); }
.tile:hover { background: var(--panel); border-color: var(--accent); }
.tile-ico { color: var(--accent); }

/* ------------------------------------------------ Intro „MASSAKA“ (schwarz, animiert) */
html.intro-on, html.intro-on body { overflow: hidden; }
#intro {
  position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; overflow: hidden;
  font-family: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.intro-word {
  display: flex; font-weight: 800; font-size: clamp(54px, 15vw, 200px); line-height: .9; letter-spacing: -.03em;
  animation: intro-shake .4s steps(2, end) .78s both, intro-spread 1.3s cubic-bezier(.2, .8, .2, 1) 1.3s both;
}
#intro::after { content: ""; position: absolute; inset: 0; background: #e3001b; opacity: 0; pointer-events: none; animation: intro-flash .45s ease-out .74s both; }
/* Nur unten abschneiden (Buchstaben kommen von unten), oben/seitlich darf das Leuchten frei strahlen */
.intro-l { display: inline-block; padding: .04em .005em; clip-path: inset(-1em -.6em -.12em -.6em); }
.intro-l > span {
  display: inline-block; transform: translateY(110%) rotate(8deg);
  animation: intro-up .75s cubic-bezier(.2, .9, .2, 1) calc(var(--i) * 70ms + .1s) forwards,
             intro-tint .35s steps(1, end) calc(var(--i) * 60ms + .8s) both;
}
.intro-line {
  height: 12px; width: min(620px, 78vw); background: #0a3cff; border-radius: 0;
  transform: scaleX(0); transform-origin: left; animation: intro-line .9s cubic-bezier(.7, 0, .2, 1) .7s forwards;
}
.intro-sub { font-size: clamp(12px, 1.6vw, 16px); font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: #ffffff; opacity: 0; animation: intro-fade .6s ease 1.15s forwards; }
.intro-skip { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); font-size: 12px; color: #6f7782; opacity: 0; animation: intro-fade .4s ease 1.6s forwards; }
#intro.out { animation: intro-out .75s cubic-bezier(.7, 0, .2, 1) forwards; }
@keyframes intro-up { to { transform: none; } }
@keyframes intro-tint { 0% { color: #fff; } 100% { color: var(--c); } }
@keyframes intro-flash { 0% { opacity: 0; } 15% { opacity: .55; } 100% { opacity: 0; } }
@keyframes intro-shake { 0% { transform: translate(0, 0); } 25% { transform: translate(-6px, 3px) rotate(-1deg); } 50% { transform: translate(5px, -3px) rotate(1deg); } 75% { transform: translate(-3px, 2px); } 100% { transform: none; } }
@keyframes intro-spread { to { letter-spacing: .05em; } }
@keyframes intro-line { to { transform: scaleX(1); } }
@keyframes intro-fade { to { opacity: 1; } }
@keyframes intro-out { to { clip-path: inset(0 0 100% 0); } }
@media (prefers-reduced-motion: reduce) {
  .intro-l > span, .intro-line { transform: none; }
  .intro-sub, .intro-skip { opacity: 1; }
  .intro-l > span { color: var(--c); }
  #intro::after { display: none; }
  #intro.out { opacity: 0; }
}
@media print { #intro { display: none !important; } }

/* ------------------------------------------------ Neue Bausteine */
/* Handy-Leiste: mittlerer Knopf „Erfassen“ hervorgehoben */
.tabbar .tab-plus .plus-dot { width: 42px; height: 30px; border-radius: 99px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.tabbar .tab-plus { color: var(--text); }

/* Monatsziele: Fortschritt + Prognose-Marke */
.goal { display: flex; flex-direction: column; gap: 6px; }
.goal + .goal { margin-top: 16px; }
.goal-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.goal-top strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.goal-bar { position: relative; height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.goal-bar > i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 99px; }
.goal-bar > b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .45; }
.goal-sub { font-size: 12.5px; color: var(--faint); }

/* Auswahl-Chips (Schnell-Erfassung) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cap-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.cap-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.cap-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; border: 1.5px dashed var(--line-2);
  border-radius: var(--radius); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; width: 100%; }
.cap-btn:hover { border-color: var(--accent); }
.cap-btn .icon { color: var(--accent); }

/* Versand */
.deadline { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deadline.late { color: var(--red); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist li::before { content: ""; width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 4px; flex: none; margin-top: 2px; }

/* Schlüssel/Wert-Liste */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* Foto-Helfer */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.editor canvas { width: 100%; height: auto; max-height: 60vh; object-fit: contain; border-radius: 8px; background: var(--panel-3); display: block; }
.editor input[type="range"] { padding: 0; min-height: 0; border: 0; accent-color: var(--accent); }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }

/* Textbausteine */
.snip { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.snip p { margin: 0; white-space: pre-wrap; font-size: 13.5px; color: var(--muted); }
.snip-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Etiketten (A4, 3 × 8 Stück à 70 × 37 mm) */
.labels { display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; gap: 0; background: #fff; }
.label { border: 1px dashed var(--line-2); padding: 4mm 5mm; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #000; }
.label .l-sku { font-size: 20pt; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.label .l-name { font-size: 9pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .l-foot { display: flex; justify-content: space-between; font-size: 9pt; font-weight: 600; }
@media print {
  @page { size: A4; margin: 10mm 0 0 0; }
  .labels { margin: 0 auto; width: 210mm; grid-template-columns: repeat(3, 70mm); }
  .label { border: 0; }
  .print-hide, .page-head, .toolbar, .notice { display: none !important; }
}

/* Autopilot */
.level { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.level label { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.level label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.level label.off { opacity: .55; cursor: not-allowed; }
.level small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 860px) { .level { grid-template-columns: 1fr 1fr; } }

/* Nummerierte Schritte (Anleitungen) */
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
/* Touch-Geräte: Foto-Werkzeuge immer sichtbar (kein Hover) */
@media (hover: none) { .photo .tools { opacity: 1; } }
.labels-wrap { overflow-x: auto; }
@media print { .labels-wrap { overflow: visible; } }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 860px) { .cap-btn { min-height: 96px; } }
