/* Cockpit – gleiches Design wie der Crosslister, mobil zuerst */
:root {
  --bg: #EEF1F4; --surface: #FFFFFF; --ink: #15171C; --muted: #5E6673;
  --line: #D8DDE3; --accent: #3043E6; --accent-ink: #FFFFFF; --tag: #FFD54A; --tag-ink: #2A2200;
  --ok: #1E6B34; --ok-bg: #E3F4E8; --warn-bg: #FFF1C7; --warn: #7A5A00; --bad-bg: #FDE7E4; --bad: #A8321F;
  --mine: #3043E6; --mine-ink: #FFFFFF;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --text: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161A; --surface: #1C1F24; --ink: #ECEEF1; --muted: #9AA2AE; --line: #2E333B;
    --accent: #7C8BFF; --accent-ink: #0E1030; --tag: #F2C53D;
    --ok: #8FD8A5; --ok-bg: #1D3325; --warn-bg: #3A3016; --warn: #F2D27A; --bad-bg: #3B1F1B; --bad: #F4A596;
    --mine: #3A48B8; --mine-ink: #FFFFFF;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--text); -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
h1, h2 { font-family: var(--display); margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 20px; }

.screen { max-width: 640px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 11px 16px; border-radius: 12px; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: none; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; }
.icon { border: 0; background: none; font-size: 24px; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; }

/* Anmelden */
.login { padding: 48px 16px; display: grid; gap: 14px; }
.login label, .sheet label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
.login input, .sheet input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 400; min-height: 44px; }
.err { color: var(--bad); margin: 0; min-height: 1em; }

/* Liste */
.top { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 8px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.top h1 { flex: 1; }
.tabs { display: flex; gap: 6px; padding: 4px 16px 8px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 64px; background: var(--bg); z-index: 2; }
.tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 13px; font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; min-height: 38px; }
.tabs button[aria-selected=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tabs b { font-weight: 600; opacity: .7; margin-left: 2px; }
.status { margin: 0 16px 6px; font-size: 13px; color: var(--muted); }
.status.bad { color: var(--bad); }
.convs { list-style: none; margin: 0; padding: 0 8px 24px; }
.conv { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 10px 8px; border-radius: 14px; cursor: pointer; }
.conv:active { background: var(--surface); }
.thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--line); }
.conv .mid { min-width: 0; display: grid; }
.conv .mid > span { display: block; min-width: 0; }
.conv .mid > .l1 { display: flex; gap: 6px; align-items: baseline; }
.conv .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .plat { font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 6px; color: #fff; flex: none; }
.plat.vinted { background: #0A9FA8; } .plat.kleinanzeigen { background: #6E9A12; } .plat.ebay { background: #3665F3; }
.conv .l2, .conv .l3 { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .l3 { color: var(--ink); }
.conv .right { display: grid; justify-items: end; gap: 4px; font-size: 12.5px; color: var(--muted); }
.pricetag { background: var(--tag); color: var(--tag-ink); font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }

/* Unterhaltung */
.chat-top { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.chat-top .thumb { width: 40px; height: 40px; border-radius: 10px; }
.who { flex: 1; min-width: 0; display: grid; }
.who b, .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 13px; color: var(--muted); }
.msgs { flex: 1; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--mine); color: var(--mine-ink); border-color: var(--mine); }
.bubble time { display: block; font-size: 11.5px; opacity: .7; margin-top: 2px; }
.bubble.offer { border: 2px solid var(--tag); white-space: normal; }
.bubble .state { display: block; font-size: 13.5px; opacity: .75; }
.bubble.me.offer { border-color: var(--tag); }
.sys { align-self: center; font-size: 12.5px; color: var(--muted); text-align: center; padding: 2px 8px; }
.cmd { align-self: flex-end; font-size: 12.5px; padding: 2px 8px; border-radius: 8px; }
.cmd.neu, .cmd.läuft { background: var(--warn-bg); color: var(--warn); }
.cmd.erledigt { background: var(--ok-bg); color: var(--ok); }
.cmd.fehler { background: var(--bad-bg); color: var(--bad); }
.offer { margin: 0 12px 8px; padding: 12px; border-radius: 16px; background: var(--surface); border: 2px solid var(--tag); display: grid; gap: 10px; }
.offer .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.offer .row .primary { grid-column: 1 / -1; }
.composer { display: flex; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); position: sticky; bottom: 0; }
.composer textarea { flex: 1; resize: none; padding: 11px 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); max-height: 140px; min-height: 44px; }
.composer .btn { border-radius: 22px; }

/* Blätter & Dialoge */
dialog { border: 0; padding: 0; background: transparent; width: min(560px, 100%); margin: auto auto 0; }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
.sheet { background: var(--surface); color: var(--ink); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.sheet .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.switch { display: grid !important; grid-template-columns: auto 1fr; gap: 12px; align-items: start; color: var(--ink) !important; font-weight: 400 !important; }
.switch input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); margin-top: 2px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; transition: .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.paste { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.paste summary { font-weight: 600; cursor: pointer; }
.paste[open] { display: grid; gap: 10px; }
.paste input { width: 100%; }

/* Navigationsleiste unten */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
.tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 20px; padding: 4px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.tabbar button span { font-size: 12px; font-weight: 600; }
.tabbar button[aria-current=page] { color: var(--accent); }
#list, #items, #ship, #stats { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.small-btn { min-height: 38px; padding: 8px 14px; }
.search { margin: 0 16px 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); min-height: 44px; }
.dots { display: flex; gap: 4px; margin-top: 3px; }
.pdot { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--line); color: var(--muted); }
.pdot.online { background: var(--ok-bg); color: var(--ok); } .pdot.draft, .pdot.filling { background: var(--warn-bg); color: var(--warn); }
.pdot.sold { background: var(--ink); color: var(--bg); } .pdot.remove { background: var(--bad-bg); color: var(--bad); }
/* Artikel-Editor */
.editor { display: grid; gap: 12px; padding: 12px 16px 24px; }
.editor label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
.editor input, .editor textarea, .editor select { width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 400; min-height: 44px; font-size: 16px; }
.editor .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--line); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph.cover::after { content: 'Titelbild'; position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: var(--ink); color: var(--bg); padding: 1px 6px; border-radius: 6px; }
.photos .rm { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; }
.addphoto { cursor: pointer; }
.saved { font-size: 13px; color: var(--muted); }
.chat-top h2 { flex: 1; font-size: 18px; }
.panel { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.panel h3 { margin: 0; font-family: var(--display); font-size: 17px; }
.prow { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.prow input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
.prow .st { font-size: 13px; color: var(--muted); }
.panel .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.thumb.none { display: grid; place-items: center; font-size: 24px; background: var(--line); }
.editor { max-width: 100%; overflow-x: hidden; }

/* Verkaufs-Meldungen */
.sales { display: grid; gap: 8px; margin: 0 12px 10px; }
.sale { background: var(--ok-bg); color: var(--ink); border-radius: 14px; padding: 12px; display: grid; gap: 8px; border: 1px solid var(--ok); }
.sale b { color: var(--ok); }
.sale .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sale .res { font-size: 13px; color: var(--muted); }

/* Zahlen */
.statsbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 4px 16px 24px; }
.kpis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.kpi { min-width: 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.kpi span { display: block; font-size: 13px; color: var(--muted); }
.kpi b { display: block; font-family: var(--display); font-size: clamp(18px, 6vw, 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi b.plus { color: var(--ok); } .kpi b.minus { color: var(--bad); }
.months { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.months h3, .stock h3 { margin: 0; font-family: var(--display); font-size: 17px; }
.mrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) max-content; gap: 10px; align-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.mbar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.mrow .note { display: block; color: var(--muted); font-size: 12px; text-align: right; }
.mrow > span:last-child { text-align: right; }
.stock { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 6px; font-size: 14px; }
.stock .li { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.stock .li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l2 .warn { color: var(--warn); font-weight: 600; }

/* nie breiter als der Bildschirm (sonst lässt sich die Seite auf dem iPhone verschieben/zoomen) */
html, body { max-width: 100%; overflow-x: hidden; }
.screen { min-width: 0; max-width: 100vw; }
.notif { display: grid; gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
.notif .switch { font-size: 15px; }

/* Anmeldung: Marken-Kopf wie der Startbildschirm, Formular als Karte darunter */
#login .hero { background: radial-gradient(120% 90% at 50% 20%, #5566FF 0%, #3043E6 45%, #18208A 100%); color: #fff; text-align: center;
  padding: calc(44px + env(safe-area-inset-top)) 16px 64px; border-radius: 0 0 32px 32px; display: grid; justify-items: center; gap: 10px; }
#login .hero .logo { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: linear-gradient(160deg, rgba(255,255,255,.24), rgba(255,255,255,.06));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 12px 30px rgba(8,12,70,.4); }
#login .hero .logo svg { width: 74%; }
#login .hero h1 { font-size: 40px; letter-spacing: -.02em; color: #fff; }
#login .hero p { margin: 0; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.75); }
#login .login { margin: -36px 16px 24px; padding: 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 30px rgba(10,20,60,.12); }
#login .login > p.muted:first-child { margin: 0 0 4px; }
.carrier { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--tag); color: var(--tag-ink); margin-right: 4px; }
.l3 .late { color: var(--bad); font-weight: 600; }
.bulk { flex-wrap: wrap; margin: 0 16px 8px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 14px; }
.bulk span { min-width: 0; }
.bulk .btn { flex: none; }
.insights { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.insights summary { font-family: var(--display); font-size: 17px; font-weight: 700; cursor: pointer; }
.insights .ins p { margin: 10px 0 0; font-size: 14.5px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px 12px 0; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.boostlist { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.brow { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; color: var(--ink) !important; }
.brow input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
.notif select { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 16px; }
.notif textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.fixbody { display: grid; gap: 14px; }
.fix { display: grid; gap: 6px; }
.fix > span { font-weight: 700; font-size: 14px; }
.chips.wrap { flex-wrap: wrap; padding: 0; overflow: visible; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
