/* Juno · Claudia May Fashion Agency
   Farben aus dem Brand Kit „Claudia May · Fashion Agency“ (Canva) */
:root {
  --espresso: #22150A;
  --ink: #15110E;
  --dark: #25201A;
  --mokka: #493626;
  --taupe: #957C5F;
  --taupe-2: #7B664E;
  --greige: #BDB3A0;
  --creme: #F1E6DB;

  --bg: #F6EFE7;          /* helle Creme-Fläche */
  --card: #FCF8F3;        /* Karten */
  --line: #E2D6C8;        /* feine Linien */
  --muted: #6E5F50;       /* ruhiger Text (Kontrast >= 4.5:1 auf --card) */
  --bar-fest: #493626;    /* Diagramm: feste Orders */
  --bar-offen: #A08667;   /* Diagramm: offene Orders (+ Schraffur) */

  --ok: #3F6B45;
  --warn: #9A6B1F;
  --alert: #9B3B2E;

  --radius: 14px;
  --font-head: 'Tenor Sans', Georgia, serif;
  --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-weight: 400; font-size: 16px; line-height: 1.5;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; letter-spacing: .04em; margin: 0; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
a { color: var(--mokka); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.boot { padding: 40px 16px; text-align: center; color: var(--muted); }

/* Kopf: hell, Logo in der Mitte, Juno links, Einstellungen rechts */
.top { background: var(--card); color: var(--ink); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.top .cm-logo { height: 96px; width: auto; }
.brand-name { font-family: var(--font-head); font-size: 1.5rem; letter-spacing: .32em; line-height: 1; color: var(--mokka); text-decoration: none; }
.top-actions { justify-self: end; display: flex; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--line); color: var(--mokka); border-radius: 999px; padding: 6px 12px; font-size: .8rem; cursor: pointer; text-decoration: none; }
.icon-btn:hover { border-color: var(--taupe); background: var(--bg); }
.icon-btn svg { width: 16px; height: 16px; }
nav.tabs { max-width: 1100px; margin: 0 auto; display: flex; gap: 4px; padding: 6px 8px 0; overflow-x: auto; }
nav.tabs a {
  flex: 1 0 auto; text-align: center; text-decoration: none; color: var(--muted);
  padding: 10px 14px 12px; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; border-bottom: 2px solid transparent;
}
nav.tabs a.active { color: var(--ink); border-bottom-color: var(--taupe); font-weight: 500; }
@media (max-width: 520px) {
  .top-inner { gap: 8px; padding: 8px 12px 0; }
  .top .cm-logo { height: 58px; }
  .brand-name { font-size: 1.1rem; letter-spacing: .22em; }
  .icon-btn .label { display: none; }
  .icon-btn { padding: 7px; }
  nav.tabs { padding: 4px 4px 0; gap: 0; }
  nav.tabs a { padding: 10px 6px 12px; font-size: .68rem; letter-spacing: .06em; }
}
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--taupe); color: var(--creme); font-size: .7rem; letter-spacing: 0; line-height: 20px; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 80px; }
.demo-banner { background: #F3E3C7; color: #5C4313; border: 1px solid #E5CB9C; border-radius: var(--radius); padding: 10px 14px; font-size: .88rem; margin-bottom: 16px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack > * + * { margin-top: 10px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Knöpfe und Felder */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--mokka); background: var(--mokka); color: var(--creme); border-radius: 999px; padding: 10px 18px; cursor: pointer; font-weight: 500; text-decoration: none; }
.btn:hover { background: var(--espresso); }
.btn.ghost { background: transparent; color: var(--mokka); }
.btn.ghost:hover { background: var(--creme); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=date], input[type=search], input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--taupe); outline-offset: 2px; }
label.field { display: block; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { margin-top: 6px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr; } .filters.f4 { grid-template-columns: repeat(4, 1fr); } .filters.f5 { grid-template-columns: repeat(5, 1fr); } }

/* Großer Upload-Knopf */
.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  background: var(--creme); color: var(--mokka); border-radius: 20px; padding: 38px 20px; cursor: pointer; border: 1.5px dashed var(--taupe); width: 100%;
}
.upload:hover { background: #EBDDCD; }
.upload .big { font-family: var(--font-head); font-size: 1.6rem; letter-spacing: .08em; color: var(--ink); }
.upload .small { color: var(--muted); font-size: .9rem; }
.upload svg { width: 40px; height: 40px; }
.upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.progress { margin-top: 10px; font-size: .9rem; color: var(--muted); min-height: 1.5em; }

/* Listen */
.list { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-decoration: none; color: inherit; }
.row.no-thumb { grid-template-columns: 1fr auto; padding: 14px 16px; }
a.row:hover { border-color: var(--taupe); }
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--creme); }
.row-title { font-weight: 500; }
.row-sub { color: var(--muted); font-size: .86rem; }
.row-end { text-align: right; white-space: nowrap; }
.amount { font-variant-numeric: tabular-nums; font-weight: 500; }

/* Status */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 500; letter-spacing: .02em; background: var(--creme); color: var(--mokka); border: 1px solid var(--line); white-space: nowrap; }
.chip.neu { background: #F3E3C7; color: #5C4313; border-color: #E5CB9C; }
.chip.offen { background: #EFE6DA; color: var(--mokka); border-style: dashed; border-color: var(--taupe); }
.chip.ok { background: #E3EDE2; color: var(--ok); border-color: #C5D8C3; }
.chip.alert { background: #F5E1DD; color: var(--alert); border-color: #E6C2BA; }

/* Fehler / Zu klären */
.issue { border-left: 4px solid var(--alert); }
.issue.answered { border-left-color: var(--warn); }
.issue-top { display: flex; gap: 12px; }
.issue-text { font-weight: 500; }
.issue-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.answer { background: #FBF1E2; border-radius: 10px; padding: 8px 12px; font-size: .92rem; margin-top: 8px; }

/* Order-Detail */
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; font-size: .9rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.struck td { color: var(--muted); text-decoration: line-through; }
tfoot td { font-weight: 600; border-bottom: 0; }
.scan-img { border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; max-height: 520px; object-fit: contain; background: #fff; width: 100%; }

/* Zahlen */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi-label { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-family: var(--font-head); font-size: 1.9rem; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .82rem; color: var(--muted); }
.chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.chart h3 { margin-bottom: 4px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 6px 0 14px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.sw-fest { background: var(--bar-fest); }
.sw-offen, .seg.offen { background: repeating-linear-gradient(135deg, var(--bar-offen) 0 5px, #C4AF95 5px 8px); }
.bars { display: grid; gap: 12px; }
.bar-row { cursor: default; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; margin-bottom: 4px; }
.bar-label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; gap: 2px; height: 14px; }
.seg { height: 100%; }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg:only-child { border-radius: 4px; }
.seg.fest { background: var(--bar-fest); }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: .82rem; }
.toggle button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.toggle button.on { background: var(--mokka); color: var(--creme); }
.line-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--espresso); color: var(--creme); padding: 8px 10px; border-radius: 8px; font-size: .82rem; line-height: 1.4; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

/* Anmeldung */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px 16px; }
.login-box { width: 100%; max-width: 360px; text-align: center; color: var(--ink); }
.login-box img { width: 240px; margin: 0 auto 22px; }
.login-box h1 { font-size: 1.8rem; letter-spacing: .36em; color: var(--mokka); }
.login-box p { color: var(--muted); font-size: .9rem; }
.login-box form { margin-top: 24px; display: grid; gap: 12px; }
.error { color: var(--alert); font-size: .9rem; min-height: 1.4em; }

/* Tabelle der Kund:innen (wie ein Sheet) */
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: 70vh; }
.sheet table { font-size: .88rem; min-width: 980px; }
.sheet th { position: sticky; top: 0; background: #F3EBE1; z-index: 2; cursor: pointer; user-select: none; white-space: nowrap; }
.sheet th[aria-sort] { color: var(--ink); }
.sheet th .arr { opacity: .55; margin-left: 4px; }
.sheet td { white-space: nowrap; padding: 9px 8px; border-right: 1px solid #EFE6DB; }
.sheet td:first-child, .sheet th:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; font-weight: 500; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.sheet th:first-child { background: #F3EBE1; z-index: 3; }
.sheet tbody tr { cursor: pointer; }
.sheet tbody tr:hover td { background: #F6EEE4; }
.sheet .count { padding: 10px 12px; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--card); position: sticky; left: 0; }
.seg-tabs { display: inline-flex; gap: 4px; background: var(--creme); padding: 4px; border-radius: 999px; margin-bottom: 14px; }
.seg-tabs a { text-decoration: none; color: var(--mokka); padding: 8px 16px; border-radius: 999px; font-size: .9rem; }
.seg-tabs a.on { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(34,21,10,.08); }

.lightbox { position: fixed; inset: 0; background: rgba(21,17,14,.92); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; }
.empty { text-align: center; color: var(--muted); padding: 30px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
#cust-list .sheet table { min-width: 1380px; }
/* Linien bleiben auch bei fixierter erster Spalte sichtbar */
.sheet table { border-collapse: separate; border-spacing: 0; }
.sheet td:first-child, .sheet th:first-child { box-shadow: inset -1px 0 0 var(--line), 3px 0 6px -4px rgba(34,21,10,.18); }
.sheet td.na { background: #EFE8DF; }
.sheet tbody tr:hover td.na { background: #E8DFD3; }
/* Zählleiste über der Tabelle, bleibt beim Scrollen sichtbar */
.sheet-bar { position: sticky; top: var(--top-h, 0px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  background: var(--bg); padding: 10px 2px; font-size: .88rem; color: var(--muted); }
.sheet-bar select { width: auto; padding: 5px 8px; margin-left: 6px; font-size: 14px; }
.sheet-bar .pager { display: inline-flex; align-items: center; gap: 8px; }
.sheet-bar .bar-end { margin-left: auto; }
#cust-list .sheet { max-height: calc(100vh - var(--top-h, 0px) - 70px); }
/* Einstellungen: Kollektionen und Lieferanten */
.brand-table { min-width: 980px; }
.brand-table td:nth-child(1) { width: 180px; }
.brand-table td:nth-child(2) { width: 320px; }
.brand-table td:nth-child(2) input { min-width: 300px; }
.brand-table td:nth-child(3) { white-space: normal; min-width: 220px; font-size: .85rem; }
details.contact summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
details.contact summary::-webkit-details-marker { display: none; }
details.contact[open] summary { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.link-btn { background: none; border: 0; padding: 4px 0; margin-top: 6px; color: var(--alert); font-size: .8rem; cursor: pointer; text-decoration: underline; }
.sheet td input { padding: 7px 9px; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.brand-table td:nth-child(1) input { min-width: 170px; }
.brand-table td:nth-child(4) input { min-width: 200px; }
.brand-table td:first-child { max-width: none; }
/* Zählleiste direkt unter der Tabelle; die Tabelle scrollt in sich, damit die Leiste immer sichtbar bleibt */
#cust-list .sheet-bar { position: static; padding: 10px 4px; }
#cust-list .sheet { max-height: calc(100vh - var(--top-h, 0px) - 230px); min-height: 260px; }
.sheet table.brand-table { min-width: 0; width: 100%; }
.brand-table td:last-child { width: 1%; white-space: nowrap; }
.brand-table td:nth-child(2) input { min-width: 240px; }

/* Drag & Drop im Eingang */
.upload.drag { background: #E6D6C3; border-style: solid; border-color: var(--mokka); }
.pdf-thumb { display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; letter-spacing: .1em; color: var(--alert); background: #F5E9E4; border: 1px solid #E6C2BA; text-decoration: none; }
