/* Shop-Admin – gleiche Farben und Schriften wie die Bestellseite, ruhiger für Listen */
:root {
  --bg: #1d2f22; --surface: #263d2c; --ink: #efe3c4; --muted: #b8b08f; --line: #3d5843; --night: #15120c;
  --accent: #b5d34a; --accent-ink: #18230f; --mustard: #d9a441; --blue: #8ab8e8; --purple: #c4a6ef; --grey: #8d8f86;
  --warn: #e3a94c; --err: #ff9b8a; --selected: #2f4a25;
  --font-logo: "Rubik Wet Paint", Impact, "Arial Black", sans-serif;
  --font-display: "Big Shoulders Stencil Display", Impact, "Arial Narrow", sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { color: #d4ea84; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.loading { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); font-weight: 600; }
h1 { margin: 0; font-family: var(--font-display); font-size: 40px; font-weight: 800; letter-spacing: 0.02em; line-height: 1.1; }
h2 { margin: 0; font-size: 17px; }
.sub { margin: 2px 0 0; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover { background: #c5df66; color: var(--accent-ink); }
.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover { color: var(--err); background: #3a2420; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-link { border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; min-height: 40px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.icon { width: 18px; height: 18px; flex: none; }

/* Felder */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input { height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 400; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input-num { width: 110px; text-align: right; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; padding: 32px 28px; border-radius: 14px; }
.login-logo { display: block; width: min(320px, 100%); height: auto; margin: 0 auto 4px; }
.brand-sub { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: 0.04em; color: var(--mustard); }
.error { margin: 0; padding: 10px 12px; border-radius: 8px; background: #3a2420; color: var(--err); font-size: 14px; }

/* Rahmen: Menü links, auf dem Handy oben */
.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 1 1 220px; max-width: 100%; background: var(--night); padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.nav-brand { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; text-decoration: none; }
.nav-logo { display: block; width: 150px; height: auto; }
@media (max-width: 780px) { .nav-logo { width: 110px; } }
.nav-brand .brand-sub { font-size: 16px; letter-spacing: 0.06em; }
.nav-items { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-item { flex: 1 1 180px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-item:hover { background: #1f2b20; color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--accent); }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--mustard); color: var(--accent-ink); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.main { flex: 999 1 560px; min-width: 0; padding: 24px clamp(16px, 3vw, 36px) 48px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 780px) {
  .nav { padding: 14px 16px; gap: 10px; }
  .nav-item { flex: 1 1 40%; }
  .nav-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  h1 { font-size: 32px; }
}

/* Meldung */
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.toast.is-error { background: var(--err); color: #2a0f0b; }
.toast span { flex: 1; }
.toast button { width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 18px; font-weight: 700; }

/* Übersicht */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.kpi:hover { border-color: var(--muted); color: var(--ink); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-value { font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1; }
.c-neu { color: var(--mustard); } .c-bezahlt { color: var(--accent); } .c-klaerung { color: var(--blue); } .c-ink { color: var(--ink); }
.c-low { color: var(--warn); } .c-out { color: var(--err); }
.list-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.list-row:hover { background: #2b4431; color: var(--ink); }

/* Status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--bg); border: 1px solid var(--grey); color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--grey); flex: none; }
.st-neu { border-color: var(--mustard); } .st-neu .dot, .dot.st-neu { background: var(--mustard); }
.st-klaerung { border-color: var(--blue); } .st-klaerung .dot, .dot.st-klaerung { background: var(--blue); }
.st-bezahlt { border-color: var(--accent); } .st-bezahlt .dot, .dot.st-bezahlt { background: var(--accent); }
.st-versendet { border-color: var(--purple); } .st-versendet .dot, .dot.st-versendet { background: var(--purple); }
.st-storno { border-color: var(--grey); } .st-storno .dot, .dot.st-storno { background: var(--grey); }
.warn-text { margin-top: 4px; font-size: 12px; color: var(--err); }

/* Bestellungen: Reiter */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tabbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; max-width: 100%; scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; margin-bottom: -1px; border: 0; border-bottom: 3px solid transparent;
  background: transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }
.count { min-width: 24px; height: 22px; padding: 0 6px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: var(--surface); color: var(--muted); }
.tab[aria-selected="true"] .count { background: var(--accent); color: var(--accent-ink); }
.filter { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; font-size: 13px; color: var(--muted); }
.filter select { height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.search { height: 40px; width: 240px; max-width: 100%; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

/* Mehrfachauswahl */
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--accent); background: var(--surface); }
.bulkbar .hint { flex: 1 1 200px; font-size: 13px; color: var(--muted); }

/* Tabelle */
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14px; }
th { padding: 12px 8px; text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 14px; width: 28px; }
th:last-child, td:last-child { padding-right: 14px; text-align: right; }
tr.is-selected td { background: var(--selected); }
td.num { text-align: right; font-weight: 600; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.check { width: 20px; height: 20px; accent-color: var(--accent); margin: 2px 0 0; }
.code-btn { white-space: nowrap; border: 0; background: transparent; padding: 0; color: var(--accent); font-family: var(--font-mono); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.empty { margin: 0; padding: 24px; color: var(--muted); }

/* Bestelldetail */
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.detail-head h1 { font-family: var(--font-mono); font-size: 30px; font-weight: 600; letter-spacing: 0; }
.status-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.status-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-weight: 600; }
.status-btn[aria-pressed="true"] { border-width: 2px; background: var(--bg); color: var(--ink); }
.status-btn[aria-pressed="true"].st-neu { border-color: var(--mustard); }
.status-btn[aria-pressed="true"].st-klaerung { border-color: var(--blue); }
.status-btn[aria-pressed="true"].st-bezahlt { border-color: var(--accent); }
.status-btn[aria-pressed="true"].st-versendet { border-color: var(--purple); }
.line { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.line.total { border-top: 1px solid var(--line); padding-top: 10px; }
.total-value { font-family: var(--font-display); font-size: 34px; font-weight: 800; color: var(--accent); }
.note { margin: 0; padding: 10px 12px; border-radius: 8px; background: #3a3320; color: var(--warn); font-size: 14px; }
.pre { white-space: pre-line; }
.flags { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }

/* Formulare (Produkt, Versandländer, Adresse) */
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; gap: 8px; }
.fieldset legend { padding: 0 6px; }
.check-line { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 15px; font-weight: 400; color: var(--ink); }
.row > .field { flex: 1 1 160px; }
.row > .field .input-num { width: 100%; }

/* Preise: gesperrt, erst „ändern“ öffnet das Feld */
.price-lock { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price-value { font-weight: 700; white-space: nowrap; }
.btn-tiny { min-height: 32px; padding: 0 4px; font-size: 13px; }
.price-lock .input-num { width: 100px; height: 38px; }

/* Umschalter Karten / Liste */
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.viewtoggle-btn { min-height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font-weight: 600; }
.viewtoggle-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.list-table { min-width: 720px; }
.list-table td { vertical-align: middle; }
.list-table td.c-thumb { width: 56px; }
.list-table td.c-prod { min-width: 220px; }
.list-table .price-lock { flex-wrap: nowrap; }
.list-table .pthumb { width: 44px; height: 44px; }

/* Lager und Exporte */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.product { display: flex; flex-direction: column; gap: 12px; }
.product-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.product-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* Produktbild wie auf der Bestellseite; ohne Bild eine gezeichnete Platte bzw. CD */
.pthumb { width: 56px; height: 56px; flex: none; border-radius: 4px; object-fit: cover; }
.pthumb.is-big { width: 72px; height: 72px; }
.pthumb.is-cutout { object-fit: contain; border-radius: 0; }
.pthumb-disc { border-radius: 50%; background: radial-gradient(circle, #8f2f27 0 17%, #15120c 17.5% 19%, transparent 19.5%),
  repeating-radial-gradient(circle, #15120c 0 1.6px, #2c281e 1.8px 2.4px); }
.pthumb-cd { border-radius: 50%; border: 1px solid var(--line);
  background: radial-gradient(circle, var(--bg) 0 12%, #c9c6d8 12.5% 30%, transparent 30.5%), conic-gradient(from 30deg, #d7d3e8, #b8e0f0, #e8d0f0, #f2e2b8, #d7d3e8); }
.cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stock-badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #2f4a25; color: var(--accent); }
.stock-badge.is-low { background: #3a3320; color: var(--warn); }
.stock-badge.is-out { background: #4a2a26; color: var(--err); }
.big { font-family: var(--font-display); font-size: 40px; font-weight: 800; line-height: 1; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-size: 18px; }
.stepper span { min-width: 44px; text-align: center; font-weight: 700; }
.export { display: flex; flex-direction: column; gap: 10px; }
.export p { margin: 0; flex: 1; color: var(--muted); font-size: 14px; }

/* Handy: Bestellungen als Karten statt breiter Tabelle */
@media (max-width: 700px) {
  .orders-box { overflow-x: visible; }
  .orders-box table { min-width: 0; }
  .orders-box thead tr { display: flex; align-items: center; }
  .orders-box thead th:not(.c-check) { display: none; }
  .orders-box thead th.c-check { display: flex; align-items: center; gap: 10px; width: auto; padding: 12px 14px; }
  .orders-box thead th.c-check::after { content: "Alle auswählen"; text-transform: none; letter-spacing: 0; font-size: 13px; }
  .orders-box tbody tr { display: grid; grid-template-columns: 28px 1fr auto; column-gap: 10px; row-gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .orders-box tbody td { display: block; padding: 0 !important; border: 0; width: auto !important; text-align: left !important; }
  .orders-box tbody td.c-check { grid-column: 1; grid-row: 1 / span 4; }
  .orders-box tbody td.c-code { grid-column: 2; grid-row: 1; }
  .orders-box tbody td.c-sum { grid-column: 3; grid-row: 1; text-align: right !important; }
  .orders-box tbody td.c-name { grid-column: 2 / span 2; grid-row: 2; }
  .orders-box tbody td.c-items { grid-column: 2 / span 2; grid-row: 3; font-size: 13px; color: var(--muted); }
  .orders-box tbody td.c-status { grid-column: 2; grid-row: 4; align-self: center; }
  .orders-box tbody td.c-action { grid-column: 3; grid-row: 4; text-align: right !important; }
  .orders-box tbody td.c-date, .orders-box tbody td.c-ship { display: none; }
  .orders-box tr.is-selected { background: var(--selected); }
  .orders-box tr.is-selected td { background: transparent; }
}
