/* ============================================================
   HEROware — App Styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 224px;
  --sidebar-bg: #111112;
  --sidebar-text: #f2f2f2;
  --sidebar-muted: #777;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active: rgba(255,255,255,.13);

  --bg: #f5f5f7;
  --card: #fff;
  --text: #111;
  --text-2: #3a3a3a;
  --text-muted: #6b7280;
  --border: #e5e7eb;

  /* HERO-Gelb aus der Brand Language. */
  --brand-yellow: #FFE600;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;

  --green: #16a34a;
  --green-bg: #dcfce7;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --blau: #2563eb;
  --blau-bg: #eff6ff;
  --slate: #475569;
  --red: #b23029;
  --slate-bg: #f1f5f9;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --surface-2: #f8f8fa;          /* Flaeche hinter Geraetebildern */
  /* Schrift auf umgekehrter Flaeche: --text als Hintergrund ist hell, sobald
     die dunkle Fassung greift – weisse Schrift waere dann unlesbar. */
  --on-inverse: #fff;
  --on-accent: #fff;
  --shimmer-a: #f1f1f4;
  --shimmer-b: #e7e7ee;
  --love-bg: #fff1f1;

  /* Helligkeit der Hersteller-Platzhalter – im Dunkeln andere Werte */
  --ph-l1: 96%;
  --ph-l2: 90%;
  --ph-l3: 84%;
  --ph-text-l: 33%;
  --ph-text-o: .58;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 2px 8px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.03);
  --shadow-hover: 0 8px 24px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
}

a { color: inherit; text-decoration: none; }

/* ── SIDEBAR ─────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 22px 20px 18px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-hero {
  color: var(--sidebar-text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.logo-ware {
  background: var(--sidebar-text);
  color: var(--sidebar-bg);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: 6px;
}

.sidebar-nav {
  padding: 4px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s;
  cursor: pointer;
}
.nav-item:hover  { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); font-weight: 600; }
.nav-item svg    { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  line-height: 18px;
}
.nav-badge--outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.3);
  color: var(--sidebar-text);
}
/* Die Wunschliste hat etwas zu melden – gefallener Preis oder Geraet weg.
   Steht neben der Anzahl, deshalb kein zweites margin-left:auto. */
.nav-badge--alert {
  background: #ef4444;
  color: #fff;
  min-width: 18px;
  padding: 1px 6px;
}
.nav-badge + .nav-badge { margin-left: 4px; }

.sidebar-section {
  padding: 12px 10px 4px;
}
.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--sidebar-muted);
  padding: 0 12px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.cat-item {
  display: block;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  transition: background .15s;
  opacity: .85;
}
.cat-item:hover  { background: var(--sidebar-hover); opacity: 1; }
.cat-item.active { background: var(--sidebar-active); opacity: 1; font-weight: 600; }

.sidebar-promo {
  margin: 12px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r);
  padding: 14px;
}
.promo-icon  { font-size: 20px; margin-bottom: 6px; }
.promo-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.promo-text  { font-size: 11.5px; color: var(--sidebar-muted); line-height: 1.55; }

.sidebar-spacer { flex: 1; min-height: 16px; }

.sidebar-user {
  padding: 14px 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .3px;
}
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dept { font-size: 11px; color: var(--sidebar-muted); }

/* ── MAIN LAYOUT ─────────────────────────────────────────── */

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-w));
}

/* ── TOPBAR ──────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 32px;
  /* Dieselbe Flaeche wie die Seitenleiste – die beiden gehoeren zusammen. */
  background: var(--sidebar-bg);
  border-bottom: 2px solid var(--brand-yellow);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Alles in der Leiste sitzt jetzt auf Dunkel. */
.topbar .search-input {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
  color: var(--sidebar-text);
}
.topbar .search-input::placeholder { color: var(--sidebar-muted); }
.topbar .search-input:focus {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px rgba(255,230,0,.18);
}
.topbar .search-icon { color: var(--sidebar-muted); }

.topbar-cart-btn { color: var(--sidebar-text); }
.topbar-cart-btn:hover { background: var(--sidebar-hover); }

.topbar .lang-switch {
  background: transparent;
  border-color: rgba(255,255,255,.16);
}
.topbar .lang-option { color: var(--sidebar-muted); }
.topbar .lang-option:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.topbar .lang-option.active { background: var(--brand-yellow); color: #111112; }

.topbar .presence-dot { border-color: var(--sidebar-bg); }
.topbar .presence-more { color: var(--sidebar-muted); }

.topbar .menu-btn { color: var(--sidebar-text); }
.topbar .menu-btn:hover { background: var(--sidebar-hover); }

/* Das Aufklappmenue der Suche haengt an der Leiste, bleibt aber Inhalt. */
.topbar .search-results { color: var(--text); }

.search-form { flex: 1; max-width: 420px; }
.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border-radius: 22px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-input::placeholder { color: var(--text-muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.topbar-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: background .15s;
}
.topbar-cart-btn:hover { background: var(--border); }
.topbar-cart-btn svg { width: 20px; height: 20px; }
.topbar-cart-count {
  position: absolute;
  top: 3px; right: 3px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 9px;
  font-weight: 800;
  width: 15px; height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-avatar { cursor: default; }

/* ── PAGE CONTENT ────────────────────────────────────────── */

.page-content {
  padding: 32px;
  flex: 1;
}

.page-footer {
  padding: 20px 32px;
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.page-footer a { color: var(--text-muted); transition: color .15s; }
.page-footer a:hover { color: var(--text); }

/* ── BREADCRUMB ──────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-muted); transition: color .15s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb span { color: var(--text); font-weight: 500; }

/* ── SHOP ────────────────────────────────────────────────── */

.shop-header { margin-bottom: 24px; }
.shop-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.shop-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 4px; }
.shop-header p  { font-size: 13.5px; color: var(--text-muted); max-width: 540px; line-height: 1.55; }
.shop-header-count { text-align: right; flex-shrink: 0; }
.count-number { display: block; font-size: 28px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.count-label  { font-size: 11.5px; color: var(--text-muted); }

.shop-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 0;
}
.cat-tabs { display: flex; gap: 0; }
.cat-tab {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.cat-tab:hover { color: var(--text); }
.cat-tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }

/* Standort-Filter: kleine Pillen neben den Kategorien. Anders als die
   Kategorie-Reiter mit Stueckzahl – die meisten Geraete haben keinen
   Standort, und wer "Hannover" waehlt, soll sehen, wie viel das ist. */
.standort-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 8px;
}
.standort-filter-titel { font-size: 13px; }
.standort-chip {
  padding: 4px 11px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.standort-chip:hover { color: var(--text); border-color: var(--text-muted); }
.standort-chip--an { background: var(--text); color: var(--on-inverse); border-color: var(--text); }
.standort-chip small { font-weight: 500; opacity: .75; margin-left: 2px; }

.sort-wrap { padding-bottom: 8px; }
.sort-select {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--card);
  cursor: pointer;
  outline: none;
}

/* ── DEVICE GRID ─────────────────────────────────────────── */

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 18px;
}

.device-card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .18s;
}
.device-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card-image-link { display: block; }
.card-image {
  height: 168px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card-image img {
  max-height: 130px;
  max-width: calc(100% - 32px);
  object-fit: contain;
}


.discount-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--text);
  color: var(--on-inverse);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: -.1px;
  white-space: nowrap;
}
.neu-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--amber);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.discount-badge--lg {
  top: 14px; left: 14px;
  font-size: 12px;
  padding: 5px 12px;
}
.badge-label {
  opacity: .75;
  font-weight: 500;
  margin-left: 3px;
}

.wishlist-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: transform .15s, background .15s;
  color: var(--text-muted);
}
.wishlist-btn svg { width: 14px; height: 14px; }
.wishlist-btn:hover  { transform: scale(1.1); color: #ef4444; }
.wishlist-btn.active { color: #ef4444; background: var(--love-bg); }

/* ── Was sich seit dem Merken getan hat ───────────────────────────────────
 *
 * Nur auf der Wunschliste. Der gefallene Preis darf auffallen, die uebrigen
 * Hinweise sollen die Karte nicht uebertoenen.
 */
.wish-hint {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.wish-hint--drop {
  color: #15803d;
}
.wish-hint--weg {
  color: var(--text-muted);
  font-weight: 500;
}
/* Ausgegraut, aber nicht weg: erst der Klick auf das Herz raeumt auf. */
.device-card--weg { box-shadow: none; border: 1px dashed var(--border); }
.device-card--weg:hover { box-shadow: none; transform: none; }
.device-card--weg .card-placeholder { filter: grayscale(1); opacity: .5; }
.device-card--weg .card-name { color: var(--text-muted); }

.card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-link { text-decoration: none; color: inherit; flex: 1; display: block; }
.card-mfr  { font-size: 9.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
.card-name  { font-size: 14.5px; font-weight: 650; line-height: 1.3; margin-bottom: 4px; }
/* Die Beschreibungen kommen aus Snipe-IT und sind mal ein Halbsatz, mal
   fuenfzehn Zeilen mit einer nackten Adresse darin. Drei Zeilen halten das
   Raster ruhig; der volle Text steht auf der Detailseite und im title. */
.card-specs {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;          /* lange Adressen sprengen sonst die Karte */
}

.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.card-pricing { display: flex; flex-direction: column; gap: 1px; }
.price-hero { font-size: 19px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.price-orig { font-size: 11.5px; color: var(--text-muted); text-decoration: line-through; }

/* ── CONDITION BADGES ────────────────────────────────────── */

.cond-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.cond-very-good { background: var(--green-bg);  color: var(--green); }
.cond-good       { background: var(--amber-bg);  color: var(--amber); }
.cond-used       { background: var(--slate-bg);  color: var(--slate); }

.info-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--slate-bg);
  color: var(--slate);
}

/* ── BUTTONS ─────────────────────────────────────────────── */

.btn-buy {
  background: var(--text);
  color: var(--on-inverse);
  border: none;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn-buy:hover         { background: #2a2a2a; }
.btn-buy--added        { background: var(--accent); cursor: default; }
.btn-buy:disabled      { opacity: .65; }

.btn-primary {
  display: inline-block;
  background: var(--text);
  color: var(--on-inverse);
  border: none;
  padding: 12px 24px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
}
.btn-primary:hover { background: #2a2a2a; }

.btn-secondary {
  display: inline-block;
  background: var(--border);
  color: var(--text-2);
  border: none;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
}
.btn-secondary:hover { background: #d9d9de; }

.btn-secondary-outline {
  display: inline-block;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 11px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.btn-secondary-outline:hover { border-color: var(--text-muted); background: var(--bg); }

.btn-checkout {
  display: block;
  background: var(--text);
  color: var(--on-inverse);
  border: none;
  padding: 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
  margin-top: 16px;
}
.btn-checkout:hover { background: #2a2a2a; }

/* ── DEVICE DETAIL ───────────────────────────────────────── */

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  max-width: 960px;
}
@media (max-width: 760px) {
  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
}

.detail-image-panel {}
.detail-image {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.detail-image img {
  max-height: 260px;
  max-width: calc(100% - 48px);
  object-fit: contain;
}


.gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.gallery-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 2px solid transparent;
  padding: 2px;
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color .15s;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}
.gallery-thumb--active {
  border-color: var(--accent, #111);
}
.gallery-thumb:hover:not(.gallery-thumb--active) {
  border-color: #ccc;
}

.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; }

.detail-mfr  { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.detail-name { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; margin-bottom: 24px; }

.detail-pricing {
  background: var(--bg);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.detail-orig-row  { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.detail-label     { font-size: 12px; color: var(--text-muted); }
.detail-orig-price { font-size: 14px; color: var(--text-muted); text-decoration: line-through; }
.detail-hero-row  { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.detail-hero-price { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.detail-tax       { font-size: 12px; color: var(--text-muted); }
.detail-savings   { font-size: 12px; color: var(--green); font-weight: 600; }

.detail-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.wishlist-btn-lg {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color .15s, background .15s, border-color .15s;
  flex-shrink: 0;
}
.wishlist-btn-lg svg     { width: 18px; height: 18px; }
.wishlist-btn-lg:hover   { color: #ef4444; border-color: #ef4444; }
.wishlist-btn-lg.active  { color: #ef4444; background: var(--love-bg); border-color: #fca5a5; }

.detail-stock {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.detail-table th, .detail-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.detail-table th { color: var(--text-muted); font-weight: 500; width: 40%; }
.detail-mono { font-family: "SF Mono", "Fira Code", "Consolas", monospace; font-size: 12.5px; color: var(--text-2); }

.detail-notes {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-muted);
}

/* ── CART ────────────────────────────────────────────────── */

.cart-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 28px; }
.cart-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.cart-meta { font-size: 13px; color: var(--text-muted); }

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 860px) {
  .cart-layout { grid-template-columns: 1fr; }
}

.cart-items { display: flex; flex-direction: column; gap: 2px; }

.cart-item {
  background: var(--card);
  border-radius: var(--r);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.cart-item:hover { box-shadow: var(--shadow); }

.cart-item-img {
  position: relative;                 /* traegt den Platzhalter */
  width: 72px; height: 72px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 30px;
  overflow: hidden;
}
.cart-item-img img { max-width: 60px; max-height: 60px; object-fit: contain; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-mfr  { font-size: 9.5px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.cart-item-name { font-size: 14px; font-weight: 650; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-specs {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cart-item-price { font-size: 17px; font-weight: 800; }
.cart-item-orig  { font-size: 11.5px; color: var(--text-muted); text-decoration: line-through; }
.cart-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
  margin-top: 4px;
}
.cart-remove-btn svg { width: 16px; height: 16px; }
.cart-remove-btn:hover { color: #ef4444; background: var(--love-bg); }

.cart-continue { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; font-size: 13px; color: var(--text-muted); transition: color .15s; }
.cart-continue:hover { color: var(--text); }

.cart-summary {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}
.cart-summary h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }

.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13.5px; }
.summary-row--discount { color: var(--green); font-weight: 600; }
.summary-row--total    { font-size: 16px; font-weight: 800; padding-top: 10px; }
.summary-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.summary-vat { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; margin-bottom: 16px; }
.free-badge { background: var(--green-bg); color: var(--green); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.pickup-badge { background: var(--slate-bg); color: var(--slate); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }

/* ── CHECKOUT ────────────────────────────────────────────── */

.checkout-title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 4px; }
.checkout-sub   { font-size: 13.5px; color: var(--text-muted); margin-bottom: 32px; }

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 820px) {
  .checkout-layout { grid-template-columns: 1fr; }
}

.checkout-section {
  display: flex;
  gap: 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.checkout-section-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: var(--on-inverse);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.checkout-section-body { flex: 1; }
.checkout-section-body h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

.checkout-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkout-field label { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.field-readonly {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  background: var(--bg);
  color: var(--text-2);
}

.delivery-options { display: flex; flex-direction: column; gap: 10px; }
.delivery-option { cursor: pointer; }
.delivery-option input[type="radio"] { display: none; }
.delivery-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  transition: border-color .15s, background .15s;
}
.delivery-option input:checked + .delivery-card {
  border-color: var(--text);
  background: var(--bg);
}
.delivery-option:hover .delivery-card { border-color: var(--text-muted); }
.delivery-icon { font-size: 22px; }
.delivery-info { flex: 1; }
.delivery-info strong { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 1px; }
.delivery-info span { font-size: 12px; color: var(--text-muted); }
.delivery-free { font-size: 11.5px; font-weight: 600; color: var(--green); white-space: nowrap; }

.payment-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--r);
}
.payment-icon { font-size: 22px; }
.payment-info strong { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 3px; }
.payment-info p { font-size: 12.5px; color: var(--text-muted); }

.btn-checkout-submit {
  width: 100%;
  background: var(--text);
  color: var(--on-inverse);
  border: none;
  padding: 15px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  margin-top: 8px;
}
.btn-checkout-submit:hover { background: #2a2a2a; }
.checkout-legal { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; }
.checkout-legal a { color: var(--accent); }

.checkout-summary {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}
.checkout-summary h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.checkout-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.checkout-item-icon {
  position: relative;
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.checkout-item-icon img { max-width: 30px; max-height: 30px; object-fit: contain; }
.checkout-item-name { flex: 1; font-size: 13px; font-weight: 500; line-height: 1.4; }
.checkout-item-price { font-size: 13.5px; font-weight: 700; white-space: nowrap; }

/* ── CONFIRMATION ────────────────────────────────────────── */

.confirmation-wrap {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding-top: 24px;
}
.confirm-check {
  width: 72px; height: 72px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 30px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.confirmation-wrap h1 { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.confirm-sub { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 28px; }

.confirm-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  text-align: left;
}
.confirm-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.confirm-order-num { font-size: 14px; font-weight: 700; }
.confirm-invoice-badge {
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.confirm-item { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.confirm-item:last-of-type { border-bottom: none; }
.confirm-item-name { font-weight: 500; }
.confirm-item-price { font-weight: 700; }
.confirm-delivery { margin-top: 14px; font-size: 13px; color: var(--text-muted); }

/* ── ORDERS ──────────────────────────────────────────────── */

.page-title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 24px; }

.order-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.order-num  { font-size: 14px; font-weight: 700; margin-right: 10px; }
.order-date { font-size: 12px; color: var(--text-muted); }
.order-status { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.order-status--confirmed { background: var(--green-bg); color: var(--green); }
.order-status--pending   { background: var(--amber-bg); color: var(--amber); }
.order-item { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.order-item:last-child { border-bottom: none; }
.order-item-name  { font-weight: 500; }
.order-item-price { font-weight: 700; }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.order-total { color: var(--text); }

/* ── EMPTY STATE ─────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .6; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; margin-bottom: 20px; }

/* ── LOGIN PAGE ──────────────────────────────────────────── */

.login-body {
  display: block;
  background: var(--bg);
}

.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
@media (max-width: 720px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-left   { display: none; }
}

.login-left {
  background: #111112;
  color: #f2f2f2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.login-left-inner { position: relative; z-index: 1; }
.login-hero-logo {
  margin-bottom: 40px;
}
.hero-logo-img {
  height: 40px;
  width: auto;
  /* Die Datei ist bereits die weisse Wortmarke (…-WHITE.png). Ein invert(1)
     drehte sie auf der dunklen Flaeche wieder ins Schwarze. */
}

.login-badge {
  display: inline-block;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.75);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
  border: 1px solid rgba(255,255,255,.12);
}
.login-headline {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 20px;
}
.login-sub {
  font-size: 14.5px;
  color: rgba(255,255,255,.6);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 380px;
}
.login-features { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255,255,255,.75);
  line-height: 1.4;
}
.login-features svg {
  width: 16px; height: 16px;
  color: #4ade80;
  flex-shrink: 0;
  margin-top: 1px;
}
.login-logo-bg {
  position: absolute;
  bottom: -30px; right: -20px;
  font-size: 120px;
  font-weight: 900;
  color: rgba(255,255,255,.03);
  letter-spacing: -4px;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--bg);
}
.login-card {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-hover);
  width: 100%;
  max-width: 380px;
}
.login-card-logo {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 28px;
}
.login-card-logo .logo-hero { font-size: 17px; font-weight: 800; color: var(--text); }
.login-card-logo .logo-ware { background: var(--text); color: var(--on-inverse); font-size: 14px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }

.login-card-title { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 6px; }
.login-card-sub { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin-bottom: 28px; }

.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: background .15s, border-color .15s;
  margin-bottom: 10px;
}
.sso-btn:hover { background: var(--bg); border-color: var(--text-muted); }
.sso-btn svg   { width: 18px; height: 18px; flex-shrink: 0; }

.sso-btn--dev {
  background: var(--text);
  color: var(--on-inverse);
  border-color: var(--text);
  margin-top: 4px;
}
.sso-btn--dev:hover { background: #2a2a2a; border-color: #2a2a2a; }

.sso-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 11.5px;
  color: var(--text-muted);
}
.sso-divider::before, .sso-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.dev-form { display: flex; flex-direction: column; gap: 8px; }
.dev-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.dev-input:focus { border-color: var(--accent); background: var(--card); }
.dev-input::placeholder { color: var(--text-muted); }

.config-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--amber-bg);
  border: 1.5px solid #fde68a;
  border-radius: var(--r-sm);
  padding: 14px;
  font-size: 12.5px;
  margin-bottom: 10px;
  color: var(--amber);
}
.config-notice strong { display: block; margin-bottom: 3px; color: var(--amber); }
.config-notice p { color: #92400e; line-height: 1.5; }
.config-notice code { background: #fef3c7; padding: 1px 5px; border-radius: 4px; font-size: 11px; }

.login-note {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 18px;
}
.login-help {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}
.login-help a { color: var(--accent); }


/* ── ADMIN ─────────────────────────────────────────────────────────────── */

.admin-flash {
  background: var(--slate-bg);
  color: var(--text-2);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 20px;
}
.admin-flash--ok { background: var(--green-bg); color: var(--green); }

/* ── ADMIN: KACHELN ──────────────────────────────────────── */
/* Vorher stand alles in einer Spalte untereinander, ohne erkennbare
   Ordnung. Jetzt ein Raster: schmale Kacheln nebeneinander, die
   Bestellungen ueber die volle Breite. */
.kachel-raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
  max-width: 1320px;
}
/* Doppelter Klassenname mit Absicht: Die Breitenangaben der alten Karten
   (.admin-card 640px, .admin-orders 900px) haetten sonst dieselbe Staerke
   und wuerden je nach Reihenfolge gewinnen. */
.kachel--breit { grid-column: 1 / -1; }
.admin-kachel.admin-kachel { max-width: none; }

/* Die Abstaende und Breiten der frueheren Einzelkarten (margin-top,
   max-width) liessen die Kacheln im Raster versetzt stehen – im Raster
   macht die Luecke das Raster, nicht die Kachel. */
.admin-kachel {
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
/* Nicht dehnen: Eine zugeklappte Kachel neben einer offenen wuerde sonst
   zur leeren Flaeche. Gleich hohe Koepfe reichen – dann stehen alle
   zugeklappten Kacheln exakt auf einer Linie. */
.kachel-raster { align-items: start; }

.kachel-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  box-sizing: border-box;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.kachel-kopf::-webkit-details-marker { display: none; }
.kachel-kopf:hover { background: var(--surface-2); }
.kachel-titel { font-size: 15px; font-weight: 700; color: var(--text); }
.kachel-unter {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Der Pfeil dreht sich beim Aufklappen – das einzige Signal, das die
   Kachel im zugeklappten Zustand ueber sich gibt. */
.kachel-kopf::after {
  content: "›";
  flex: none;
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted);
  transform: rotate(90deg);
  transition: transform .15s ease;
}
.admin-kachel[open] > .kachel-kopf::after { transform: rotate(-90deg); }
.admin-kachel[open] > .kachel-kopf { border-bottom: 1px solid var(--border); }
.kachel-inhalt { padding: 20px 24px 24px; }
/* In einer 370-px-Kachel ist alles zu breit, was fuer eine ganze Seite
   gebaut wurde: Statuszeilen brechen jetzt um, Eingabefelder bleiben in
   der Kachel, und der Rest bekommt zur Not einen Balken zum Schieben. */
.kachel-inhalt { overflow-x: auto; }
.kachel-inhalt .field-input,
.kachel-inhalt select,
.kachel-inhalt input[type="text"],
.kachel-inhalt input[type="email"],
.kachel-inhalt input[type="number"],
.kachel-inhalt textarea { max-width: 100%; box-sizing: border-box; }
/* Nur die Werte duerfen umbrechen. Die Beschriftung nicht: Sonst stand
   "Snipe-IT" als Buchstabensaeule da. */
/* Flex-Kinder schrumpfen von sich aus nicht unter ihren Inhalt – ohne
   min-width bleibt das Auswahlfeld breiter als die Kachel. */
.kachel-inhalt .abhol-form > *,
.kachel-inhalt .people-add > * { min-width: 0; }
/* Knopfreihen, die fuer eine ganze Seitenbreite gedacht waren, brechen in
   der Kachel um, statt rechts hinauszulaufen. */
.kachel-inhalt .check-actions,
.kachel-inhalt .people-add,
.kachel-inhalt .abhol-form { flex-wrap: wrap; }
.kachel-inhalt table { width: 100%; }
/* Die Statuszeilen bestehen aus drei Zellen: Name, Punkt, Text. Nur der
   Text darf notfalls mitten im Wort brechen – lange Pfade und URLs sprengen
   die Kachel sonst. Der Name nie: Mit "anywhere" stand dort "Snipe-IT" als
   Buchstabensaeule. */
.kachel-inhalt .status-table .status-name {
  white-space: nowrap;
  overflow-wrap: normal;
}
.kachel-inhalt .status-table .status-detail {
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Die Datenpflege-Liste ist keine Statuszeile: Der Name ist lang ("TV Wall
   Mount HERO02182"), und mit nowrap nahm er die ganze Breite – die beiden
   anderen Zellen standen als Buchstabensaeulen daneben. Jede Zeile ist ein
   Raster: links Name und Luecken untereinander, rechts der Sprung nach
   Snipe-IT. Das traegt bei jeder Kachelbreite. */
.kachel-inhalt .datenpflege-tabelle,
.kachel-inhalt .datenpflege-tabelle tbody { display: block; }
.kachel-inhalt .datenpflege-tabelle tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.kachel-inhalt .datenpflege-tabelle tr:last-child { border-bottom: none; }
.kachel-inhalt .datenpflege-tabelle td { display: block; padding: 0; border: 0; width: auto; }
.kachel-inhalt .datenpflege-tabelle .status-name {
  grid-column: 1;
  white-space: normal;
  overflow-wrap: normal;
}
.kachel-inhalt .datenpflege-tabelle .status-detail { grid-column: 1; overflow-wrap: normal; }
.kachel-inhalt .datenpflege-tabelle td:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  white-space: nowrap;
}

.adress-titel { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 2px; }
.adress-hinweis { margin: 0 0 10px; font-size: 12.5px; color: var(--text-muted); }
.kachel-leiste { display: flex; gap: 10px; margin: 0 0 14px; }

/* Der alte Karten-Kopf steckt noch in der Kachel (die Ueberschrift steht
   jetzt im summary) – "display: flex" aus der Klasse schlaegt das
   hidden-Attribut, deshalb hier ausdruecklich. */
.admin-kachel .admin-card-head[hidden] { display: none; }

@media (max-width: 720px) {
  .kachel-raster { grid-template-columns: 1fr; }
}

.admin-card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 640px;
}
.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.admin-card-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.admin-card-sub   { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.admin-card-text  { font-size: 13.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }

.admin-pill {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: .2px;
}
.admin-pill--on  { background: var(--green-bg); color: var(--green); }
.admin-pill--off { background: var(--amber-bg); color: var(--amber); }

.admin-meta { margin-top: 24px; }
.admin-meta th { color: var(--text-muted); font-weight: 500; width: 40%; }
.admin-meta code {
  background: var(--slate-bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.admin-note {
  max-width: 640px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.admin-error { color: var(--amber); }


.cart-notice {
  background: var(--slate-bg);
  color: var(--text-2);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.cart-notice--warn {
  background: var(--amber-bg);
  color: var(--amber);
  border-left-color: var(--amber);
}


.delivery-option--off { opacity: .55; cursor: not-allowed; }
.delivery-option--off .delivery-card { background: var(--bg); }

.delivery-hint {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.delivery-hint--warn {
  background: var(--amber-bg);
  color: var(--amber);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.detail-stock--pickup { color: var(--amber); font-weight: 500; }


.card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.ship-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 19px;
  padding: 0 5px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}
.ship-badge--yes { background: var(--green-bg); }
/* Wo es liegt – neben dem Versandzeichen, im selben ruhigen Ton. */
.ort-badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 12px;
  background: var(--slate-bg);
  color: var(--slate);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.detail-unbekannt { color: var(--text-muted); font-style: italic; }
.ship-badge--no  { background: var(--slate-bg); }

/* ── SCHMALE BILDSCHIRME ─────────────────────────────────── */
/* Die Seitenleiste ist fest positioniert und 224px breit; darunter bleibt
   auf einem Telefon nichts übrig. Sie wird deshalb zur Schublade. */

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.menu-btn:hover { background: var(--border); }
.menu-btn svg { width: 20px; height: 20px; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,.45);
}

body.no-scroll { overflow: hidden; }

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .sidebar-backdrop:not([hidden]) { display: block; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  .sidebar--open { transform: none; }

  .main {
    margin-left: 0;
    width: 100%;
  }

  .topbar { padding: 10px 16px; gap: 10px; }
  .page-content { padding: 20px 16px 32px; }
  .page-footer { padding-left: 16px; padding-right: 16px; }

  .shop-header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .shop-header-count { text-align: left; }

  /* Kategorien und Sortierung nebeneinander lassen, aber schiebbar */
  .shop-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .cat-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { white-space: nowrap; }

  .device-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
}

/* ── Admin auf dem Telefon ───────────────────────────────────────────────
 *
 * Die Bestelltabelle ist 640px breit und scrollte seitlich – "Bereit" und
 * "Abgeholt" lagen ausserhalb des Bildes, wer am Lager mit dem Telefon
 * drueckt, musste erst schieben. Unter 720px wird jede Bestellung eine
 * gestapelte Karte: Kopfzeile weg, Zellen untereinander, Knoepfe darunter
 * und linksbuendig. Die Rahmen der Bloecke bleiben, nur eben als Karte.
 */
@media (max-width: 720px) {
  .admin-orders .scroll-x { overflow-x: visible; }
  /* Mit Vorfahren, damit die Regel die Basis (min-width: 640px) sicher
     schlaegt – gleiche Spezifitaet haette nur die Reihenfolge entschieden. */
  .admin-orders .orders-table { min-width: 0; border-spacing: 0; display: block; width: 100%; }
  .orders-table thead { display: none; }
  .orders-table tbody, .orders-table tr, .orders-table td { display: block; }
  .orders-table tr {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-bottom: 10px;
    padding: 6px 0;
    background: var(--card);
  }
  .orders-table td, .orders-table td:first-child, .orders-table td:last-child {
    border: none;
    border-radius: 0;
    padding: 6px 12px;
    background: transparent;
  }
  .orders-table td.num { text-align: left; }
  .orders-table td.num::before { content: attr(data-label) " "; color: var(--text-muted); font-size: 11.5px; }
  .orders-table tbody tr:hover td { background: transparent; }
  .orders-table tr.order-row--aktiv { border-color: var(--brand-yellow); }
  .orders-table tr.order-row--aktiv td { border-color: transparent; }
  .order-actions { padding-top: 10px; border-top: 1px solid var(--border) !important; margin-top: 4px; }
  .aktions-stapel, .zahlung-zeile { justify-content: flex-start; }
  .aktions-stapel > .label-nachtrag { text-align: left; }
  /* Die Vorschau rechts braucht das ganze Telefon. */
  .vorschau { width: 100vw; border-left: none; }
  .vorschau-offen .page-content { padding-right: 16px; }
}

@media (max-width: 520px) {
  .device-grid { grid-template-columns: 1fr; }
  .topbar { padding: 10px 12px; }
  .page-content { padding: 16px 12px 28px; }
  h1 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}


/* ── ADMIN: BESTELLUNGEN ─────────────────────────────────── */

.admin-orders {
  max-width: 900px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}
.scroll-x { overflow-x: auto; }

/* Jeder Kauf ist ein eigener Block mit Rahmen und Luft dazwischen. Als
   Zeilen mit einer Linie darunter liefen sie ineinander – zumal eine
   Bestellung im Status gut zehn Zeilen hoch werden kann. */
.orders-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-size: 13px;
  margin-top: 4px;
  min-width: 640px;
}
.orders-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1.5px solid var(--border);
}
/* Der Rahmen entsteht aus den Zellen – ein <tr> traegt in Tabellen keinen
   eigenen. Wichtig ist, dass die Aktionsspalte eine Tabellenzelle bleibt:
   Stand dort display:flex, fiel sie aus der Zeile heraus und ihre Linie lag
   hoeher als die der uebrigen Spalten. */
.orders-table td {
  padding: 14px 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.orders-table td:first-child {
  border-left: 1px solid var(--border);
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.orders-table td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.orders-table tbody tr:hover td { background: var(--bg); }
.orders-table th.num, .orders-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.order-meta { font-size: 11.5px; color: var(--text-muted); }
.order-row--cancelled td { opacity: .6; }

.order-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--green-bg);
  color: var(--green);
  white-space: nowrap;
}
.order-status--cancelled { background: var(--slate-bg); color: var(--slate); }

.btn-cancel-order {
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-cancel-order:hover { border-color: var(--amber); color: var(--amber); }

.admin-note-inline {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}


/* ── ADMIN: ANBINDUNGEN ──────────────────────────────────── */



.status-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.status-table td {
  padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.status-table tr:last-child td { border-bottom: none; }
.status-name { font-weight: 600; white-space: nowrap; width: 1%; }
.status-detail { color: var(--text-muted); }

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--ok   { background: var(--green); }
.status-dot--warn { background: var(--amber); }
.status-dot--off  { background: var(--border-firm, #c3ccd8); }


.order-status--handed_over { background: var(--slate-bg); color: var(--slate); }
/* Bereit heisst: es wartet jemand – deshalb Gelb statt dem ruhigen Gruen. */
.order-status--ready { background: var(--amber-bg); color: var(--amber); }
/* Die Zelle bleibt eine Tabellenzelle – geordnet wird erst darin. Die
   Knoepfe stehen nebeneinander, solange sie nebeneinander passen, und
   brechen sonst um. Zahlungsstand und Adressfeld bekommen eine eigene
   Zeile, weil sie keine Knoepfe sind. */
.order-actions { padding-left: 12px; }
.aktions-stapel {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.aktions-stapel > form { margin: 0; }
.aktions-stapel > .zahlung-zeile,
.aktions-stapel > .label-nachtrag { flex: 0 0 100%; }
/* Das aufklappbare Adressfeld steht wie die Knoepfe rechts – auf der
   Detailseite, wo alles linksbuendig laeuft, wieder links. */
.aktions-stapel > .label-nachtrag { text-align: right; }
.order-actions--detail .label-nachtrag { text-align: left; }
.zahlung-zeile {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 8px;
}

/* Jede Aktion hat ihre eigene Farbe: Vorbereiten (amber), Erledigen
   (dunkel), Reparieren (blau), Zuruecknehmen (rot), Versandpapier (grau).
   Wer die Liste taeglich sieht, erkennt sie am Ton statt am Lesen. */
.btn-aktion {
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-aktion--bereit { border-color: var(--amber); color: var(--amber); }
.btn-aktion--bereit:hover { background: var(--amber-bg); }
.btn-aktion--reparieren { border-color: var(--blau, #2563eb); color: var(--blau, #2563eb); }
.btn-aktion--reparieren:hover { background: var(--blau-bg, #eff6ff); }
/* Rot schon im Ruhezustand – sonst verspricht die Legende eine Farbe,
   die am Knopf erst beim Ueberfahren erscheint. */
/* Die Zahlungsfreigabe ist die erste Handlung an einer Bestellung und
   gehoert Finance – gruen, weil sie alles Weitere aufschliesst. */
.btn-aktion--zahlung { border-color: var(--green); color: var(--green); }
.btn-aktion--zahlung:hover { background: var(--green-bg); }
.zahlung-frei { font-size: 11.5px; color: var(--green); font-weight: 600; white-space: nowrap; }
.btn-zahlung-weg {
  border: none; background: none; padding: 0;
  font-size: 11px; color: var(--text-muted);
  text-decoration: underline; cursor: pointer;
}
.btn-aktion--lieferart { border-color: var(--muted, #6b7280); color: var(--text); }
.btn-aktion--lieferart:hover { background: color-mix(in srgb, var(--muted, #6b7280) 12%, transparent); }
.btn-aktion--storno { border-color: var(--red); color: var(--red); }
.btn-aktion--storno:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }

/* Legende unter der Tabelle – dieselben Farben, damit die Zuordnung
   ohne Erklaerung funktioniert. */
.aktions-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.legende-eintrag { display: flex; gap: 8px; align-items: baseline; max-width: 420px; }
.legende-punkt {
  flex: none;
  width: 10px; height: 10px;
  border-radius: 3px;
  border: 1.5px solid currentColor;
  transform: translateY(1px);
}
.legende-punkt--zahlung { color: var(--green); }
.legende-punkt--bereit { color: var(--amber); }
.legende-punkt--erledigt { color: var(--text); background: var(--text); }
.legende-punkt--reparieren { color: var(--blau, #2563eb); }
.legende-punkt--label { color: var(--text-muted); }
.legende-punkt--storno { color: var(--red); }
.legende-name { font-weight: 600; color: var(--text-2); }

.btn-handover {
  border: 1.5px solid var(--text);
  background: var(--text);
  color: var(--on-inverse);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-handover:hover { background: #2a2a2a; }


/* ── ADMIN: KENNZAHLEN ───────────────────────────────────── */



.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 4px;
}
.stat {
  background: var(--card);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.6px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-row--durchlauf { margin-top: 10px; }
.stat-label { font-size: 12.5px; font-weight: 600; }
.stat-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.stat--attention .stat-value { color: var(--amber); }

/* ── Kennzahlen als Grafik ────────────────────────────────────────────────
 *
 * Die Zahlen darueber sind Momentaufnahmen; hier steht, wohin sie laufen.
 * Gezeichnet wird serverseitig als SVG – kein Skript, kein Nachladen, und
 * im Ausdruck steht es genauso da.
 */
/* Monat oder Woche – zwei Links, die wie ein Schalter aussehen. Kein
   Formular: Der Zustand steht in der Adresse, damit er sich verschicken
   und mit dem Ruecken-Knopf zuruecknehmen laesst. */
.takt-wahl {
  display: inline-flex;
  gap: 2px;
  margin-top: 18px;
  padding: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.takt-knopf {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.takt-knopf:hover { color: var(--text); }
.takt-knopf--an {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

.kennzahl-grafiken {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 14px;
}
.kennzahl-grafik { margin: 0; }
.kennzahl-grafik figcaption {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.grafik-balken {
  width: 100%;
  height: 104px;
  display: block;
  /* Die Balken duerfen sich in der Breite dehnen, ihre Ecken sollen dabei
     rund bleiben – deshalb nur die Hoehe aus dem viewBox-Verhaeltnis. */
  overflow: visible;
}
.balken { transition: opacity .15s ease; }
.balken:hover { opacity: .75; }
.balken--geraete { fill: var(--accent); }
.balken--erloes { fill: var(--green); }
.grafik-achse {
  display: flex;
  justify-content: space-around;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.grafik-achse span { flex: 1; text-align: center; }
.grafik-grund { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.grafik-fuss { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

.grafik-streifen {
  display: flex;
  height: 34px;
  border-radius: var(--r-sm);
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 700;
}
.grafik-streifen > span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  min-width: 24px;
}
.streifen--offen  { background: var(--amber); }
.streifen--fertig { background: var(--slate); }
.streifen--weg    { background: var(--border); color: var(--text-muted) !important; }
.grafik-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.grafik-legende span { display: flex; align-items: center; gap: 6px; }
.grafik-legende i {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
}


.check-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-plain {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 11px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-plain:hover { color: var(--text); }
.check-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.check-results { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 6px; }
.check-ms { color: var(--text-muted); font-size: 11px; margin-left: 8px; }
.status-dot--error { background: var(--red); }


/* ── ADMIN: ZUGRIFF ──────────────────────────────────────── */



.people-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.people-table td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.people-table tr:last-child td { border-bottom: none; }
.people-mail { font-weight: 600; }
.people-source { color: var(--text-muted); }
.people-action { text-align: right; width: 1%; }

.btn-remove-admin {
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  border-radius: var(--r-sm);
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-remove-admin:hover { border-color: var(--amber); color: var(--amber); }

.people-add {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.people-add .field-input { flex: 1; min-width: 240px; }


/* ── HINWEIS FÜR ALLE ────────────────────────────────────── */

.shop-banner {
  margin: 16px 32px 0;
  padding: 11px 16px;
  background: var(--amber-bg);
  color: var(--amber);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}
@media (max-width: 900px) { .shop-banner { margin: 12px 16px 0; } }

.notice-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 4px; }
.notice-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.notice-field { display: flex; gap: 8px; align-items: flex-start; }
.notice-lang {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding-top: 10px;
  width: 22px;
  flex-shrink: 0;
}
.notice-form textarea { flex: 1; resize: vertical; font-family: inherit; }


.order-filter {
  display: flex;
  gap: 8px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}
.order-filter .field-input { flex: 1; min-width: 220px; }
.admin-orders .admin-card-head { align-items: center; }


/* ── SPRACHUMSCHALTER ────────────────────────────────────── */

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.lang-option {
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.lang-option:hover { background: var(--bg); color: var(--text); }
.lang-option.active { background: var(--text); color: var(--on-inverse); }


/* ── WER IST GERADE DA ───────────────────────────────────── */

.presence {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-right: 4px;
}
.presence-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--slate-bg);
  color: var(--slate);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  margin-left: -7px;
  cursor: default;
}
.presence-dot:first-child { margin-left: 0; }
.presence-dot--self { background: var(--accent); color: var(--on-accent); }
.presence-more {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}
@media (max-width: 520px) { .presence { display: none; } }

/* ── Weg in den Warenkorb ─────────────────────────────────────────────── */

/* Abbild der Karte waehrend des Flugs. Liegt ueber allem, faengt keine Klicks. */
.fly-clone {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  will-change: transform, opacity;
}
.fly-clone img { width: 100%; height: 100%; object-fit: contain; }
.fly-clone .discount-badge,
.fly-clone .wishlist-btn { display: none; }

.topbar-cart-btn { position: relative; }
.cart-bump { animation: cart-bump .45s cubic-bezier(.3,1.4,.5,1); }
@keyframes cart-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.28); }
  60%  { transform: scale(.94); }
  100% { transform: scale(1); }
}

/* Kurze Rueckmeldung – die Karte ist gerade verschwunden. */
.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  padding: 11px 14px;
  border-radius: var(--r);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  font-size: 13px;
  box-shadow: var(--shadow-hover);
  pointer-events: auto;
  animation: toast-in .28s cubic-bezier(.2,.9,.3,1);
}
.toast-text { flex: 1; min-width: 0; }
.toast-link {
  flex-shrink: 0;
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.toast--out { animation: toast-out .3s ease-in forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(6px)  scale(.98); } }

@media (max-width: 640px) {
  .toast-host { right: 12px; left: 12px; bottom: 12px; }
  .toast { max-width: none; }
}

/* Wer weniger Bewegung eingestellt hat, bekommt die Zustaende ohne Weg dorthin. */
@media (prefers-reduced-motion: reduce) {
  .cart-bump { animation: none; }
  .toast { animation: none; }
  .toast--out { animation: none; opacity: 0; }
}

/* ── Platzhalter fuer Geraete ohne Foto ───────────────────────────────────
 *
 * Zwei von drei Geraeten haben in Snipe-IT kein Bild. Ein grauer Kasten sieht
 * nach Fehler aus; der Herstellername auf getoenter Flaeche sieht nach Absicht
 * aus und macht die Karten zugleich unterscheidbar. Der Farbton kommt vom
 * Hersteller, ist also fuer alle Lenovo-Geraete derselbe.
 */
.card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  user-select: none;
  background:
    radial-gradient(115% 90% at 50% 0%,
      hsl(var(--brand-hue, 220), 58%, var(--ph-l1)) 0%,
      hsl(var(--brand-hue, 220), 42%, var(--ph-l2)) 55%,
      hsl(var(--brand-hue, 220), 32%, var(--ph-l3)) 100%);
}
.ph-word {
  max-width: 100%;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.25;
  color: hsl(var(--brand-hue, 220), 34%, var(--ph-text-l));
  opacity: var(--ph-text-o);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-icon { font-size: 21px; opacity: .3; }

.detail-placeholder .ph-word { font-size: 22px; letter-spacing: .24em; }
.detail-placeholder .ph-icon { font-size: 44px; }

/* ── Detailseite ──────────────────────────────────────────────────────────
 *
 * Die Angaben zum Geraet stehen rechts und bleiben beim Blaettern stehen,
 * solange links Platz ist. Bei einer Spalte waere das eher hinderlich.
 */
@media (min-width: 900px) {
  .detail-info {
    position: sticky;
    top: 24px;
  }
}

.detail-section-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.detail-notes-block { margin-top: 24px; }
.detail-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Karten treffen gestaffelt ein ────────────────────────────────────────
 *
 * 40 ms Versatz je Karte, ab der dreizehnten alle gleichzeitig – sonst
 * wartet man bei 59 Geraeten zweieinhalb Sekunden auf die letzte Reihe.
 */
@media (prefers-reduced-motion: no-preference) {
  .device-grid .device-card {
    animation: card-in .42s cubic-bezier(.22,.7,.3,1) backwards;
    animation-delay: calc(var(--i, 0) * 40ms);
  }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ── Weitere Geraete aus derselben Kategorie ──────────────────────────────
 *
 * Fuellt den Raum unter den Angaben – bei Geraeten ohne Foto und ohne
 * Beschreibung endete die Seite sonst nach einem Drittel.
 */
.related { margin-top: 56px; max-width: 960px; }
.related-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.related-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .18s;
}
.related-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.related-image {
  position: relative;
  height: 112px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.related-image img { max-height: 88px; max-width: calc(100% - 24px); object-fit: contain; }
.related-image .ph-word { font-size: 12px; letter-spacing: .16em; }
.related-image .ph-icon { font-size: 17px; }
.related-body { padding: 10px 12px 12px; }
.related-mfr {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.related-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.related-price { display: flex; align-items: baseline; gap: 6px; }
.related-price .price-hero { font-size: 15px; }

/* ── Seitenwechsel ────────────────────────────────────────────────────────
 *
 * Der Browser blendet die Seiten ineinander und laesst das Geraetebild von
 * der Kachel an seinen Platz auf der Detailseite wandern. Browser ohne
 * View-Transitions wechseln wie bisher – es geht nichts verloren.
 */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

.vt-device-image { view-transition-name: device-image; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .22s;
}
::view-transition-group(device-image) {
  animation-duration: .34s;
  animation-timing-function: cubic-bezier(.3,.8,.3,1);
}

/* ── Bilder im Aufbau ─────────────────────────────────────────────────────
 *
 * Solange das Foto ueber den Bild-Proxy laedt, steht an seiner Stelle ein
 * ruhiger Schimmer statt einer leeren Flaeche, in die es hineinspringt.
 */
.card-image.is-loading::after,
.related-image.is-loading::after,
.detail-image.is-loading::after,
.vorschau-bild.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    var(--shimmer-a) 28%, var(--shimmer-b) 45%, var(--shimmer-a) 62%);
  background-size: 320% 100%;
  animation: shimmer 1.25s linear infinite;
}
@keyframes shimmer {
  from { background-position: 140% 0; }
  to   { background-position: -40% 0; }
}

/* Sichtbar ist die Vorgabe: Bleibt das Skript aus, sieht man trotzdem alles.
 * Erst das Skript blendet ein noch ladendes Bild aus. */
.card-image img,
.related-image img,
.detail-image img,
.vorschau-bild img {
  transition: opacity .3s ease;
}
.card-image img.img-pending,
.related-image img.img-pending,
.detail-image img.img-pending,
.vorschau-bild img.img-pending {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .card-image.is-loading::after,
  .related-image.is-loading::after,
  .detail-image.is-loading::after { animation: none; }
  .card-image img,
  .related-image img,
  .detail-image img { transition: none; }
  .card-image img.img-pending,
  .related-image img.img-pending,
  .detail-image img.img-pending { opacity: 1; }
}

/* Der Platzhalter sitzt auch in den kleinen Miniaturen von Warenkorb und
   Kasse – dort bleibt nur die Wortmarke, fuer ein Symbol ist kein Platz. */
.cart-item-img .ph-word { font-size: 9px; letter-spacing: .1em; padding: 0 4px; }
.checkout-item-icon .ph-word { font-size: 8px; letter-spacing: .06em; padding: 0 2px; }

/* ── Meine Kaeufe ─────────────────────────────────────────────────────────
 *
 * Die Seite war eine flache Liste. Hier landet man nach jedem Kauf – sie
 * soll sagen, woran man ist, nicht nur was es gekostet hat.
 */
.order-steps {
  display: flex;
  list-style: none;
  margin: 4px 0 12px;
  padding: 0;
}
.order-step {
  position: relative;
  flex: 1;
  padding: 0 0 0 22px;
  font-size: 12px;
  color: var(--text-muted);
}
/* Linie zum naechsten Punkt – am letzten Schritt nicht. */
.order-step::before {
  content: "";
  position: absolute;
  left: 6px; top: 5px;
  width: 100%;
  height: 2px;
  background: var(--border);
}
.order-step:last-child::before { display: none; }
.order-step--done::before { background: var(--green); }

.order-step-dot {
  position: absolute;
  left: 0; top: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border);
  box-sizing: border-box;
}
.order-step--done .order-step-dot { background: var(--green); border-color: var(--green); }
.order-step--current .order-step-dot {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}
.order-step--done .order-step-label,
.order-step--current .order-step-label { color: var(--text-2); font-weight: 600; }
.order-step-label { display: block; }
.order-step-when { display: block; font-size: 11px; opacity: .8; }

.order-explain {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.order-explain--cancelled { color: var(--red); }
.order-quittung { display: flex; gap: 10px; align-items: center; }
.admin-flash--lesen { background: var(--amber-bg); color: var(--amber); }
.rolle-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px;
               background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.rolle-badge--finance { background: var(--green-bg); color: var(--green); }
.rolle-wahl { font-size: 12px; padding: 3px 6px; }
.people-rolle { font-size: 12.5px; color: var(--text-muted); }
.rolle-form { display: inline; }
.label-formate { display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.order-termin { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.termin-label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-muted); }
.abhol-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.abhol-tage { display: flex; gap: 8px; }
.abhol-tag { display: flex; gap: 4px; align-items: center; font-size: 12.5px; }
.abhol-feld { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-muted); }
.preis-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.preis-label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-muted); }
.preis-feld { width: 90px; }
.preis-vermerk { font-size: 11.5px; color: var(--text-muted); }
.order-storno { margin-left: auto; margin-right: 14px; }
.check-auto { font-weight: 600; }
.check-auto--rot { color: var(--red); }
.order-tracking { font-family: var(--mono, ui-monospace, monospace); font-weight: 600; }
.order-explain--wartet { color: var(--amber, #b45309); font-weight: 600; }
.order-card--cancelled { opacity: .75; }

.order-items { border-top: 1px solid var(--border); }
.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.order-item:last-child { border-bottom: none; }
.order-item-img {
  position: relative;
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-2);
}
.order-item-img .ph-word { font-size: 8px; letter-spacing: .06em; padding: 0 2px; }
.order-item-info { flex: 1; min-width: 0; }
.order-item-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.order-item-ids {
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-item-sep { margin: 0 6px; }
.order-item-price { font-size: 13.5px; font-weight: 700; white-space: nowrap; }

@media (max-width: 640px) {
  .order-steps { flex-direction: column; gap: 10px; }
  .order-step::before { display: none; }
}

/* ── Sofortsuche ──────────────────────────────────────────────────────────
 *
 * Die Treffer haengen unter dem Suchfeld. Das Formular bleibt daneben
 * bestehen: Enter ohne Auswahl fuehrt weiterhin auf die Ergebnisseite.
 */
.search-wrap { position: relative; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow-hover);
}
.search-results[hidden] { display: none; }

.search-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
}
.search-hit:hover,
.search-hit--active { background: var(--bg); }

.search-hit-img {
  position: relative;
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-hit-img img { max-width: 32px; max-height: 32px; object-fit: contain; }
.search-hit-img .ph-word { font-size: 7.5px; letter-spacing: .05em; padding: 0 2px; }

.search-hit-text { flex: 1; min-width: 0; }
.search-hit-mfr {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.search-hit-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-hit-price { font-size: 13px; font-weight: 700; white-space: nowrap; }

.search-empty,
.search-all {
  display: block;
  padding: 10px 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}
.search-all {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  font-weight: 600;
  color: var(--accent);
}
.search-all:hover { background: var(--bg); border-radius: var(--r-sm); }

/* ── Dunkle Fassung ───────────────────────────────────────────────────────
 *
 * Folgt der Einstellung des Systems. Die Seitenleiste war immer schon dunkel,
 * sie bleibt unveraendert – umgestellt wird alles, was um sie herum liegt.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --card: #1f1f24;
    --surface-2: #26262c;
    --text: #f2f2f4;
    --text-2: #d3d3d8;
    --text-muted: #9a9aa4;
    --border: #32323a;

    --accent: #7aa2ff;
    --accent-hover: #93b4ff;

    --green: #6ee7a8;
    --green-bg: #10331f;
    --amber: #fbbf5a;
    --amber-bg: #382709;
    --blau: #7aa2ff;
    --blau-bg: #1b2740;
    --slate: #a8b4c4;
    --slate-bg: #262c34;
    --red: #f0857c;

    --on-inverse: #17171a;
    --on-accent: #10121a;

    --shimmer-a: #24242a;
    --shimmer-b: #2e2e36;
    --love-bg: #3a1d1d;

    /* Die Herstellerfarben muessen im Dunkeln dunkel sein, sonst leuchtet
       die Uebersicht wie eine Lichterkette. */
    --ph-l1: 22%;
    --ph-l2: 17%;
    --ph-l3: 13%;
    --ph-text-l: 72%;
    --ph-text-o: .5;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow: 0 2px 8px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04);
    --shadow-hover: 0 8px 24px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.07);
  }

  .toast { background: #33333c; }

  /* Fotos aus Snipe-IT sind fast alle vor weissem Hintergrund aufgenommen.
     Ungedaempft stechen sie aus der dunklen Seite heraus. */
  .card-image img, .related-image img, .detail-image img,
  .cart-item-img img, .checkout-item-icon img, .search-hit-img img {
    filter: brightness(.92);
  }
}

/* Erklaerung neben der Zustandsstufe – "Good" allein sagt niemandem etwas. */
.cond-note {
  margin-left: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}
@media (max-width: 480px) {
  .cond-note { display: block; margin: 4px 0 0; }
}

/* Bestellungen, bei denen eine Anbindung nicht geantwortet hat. */
.order-missing {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
}
.stat--warn .stat-value { color: var(--amber); }

/* Die Geraeteliste ist aelter als gewohnt – kein Fehler, aber sagenswert. */
.stale-hint {
  margin: 0 0 16px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 12.5px;
}

/* Foto stammt von einem baugleichen Geraet, nicht von diesem Exemplar. */
.stand-in-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(17,17,18,.72);
  color: #fff;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.stand-in-hint {
  margin: -6px 0 14px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Welche Geraete noch fotografiert werden muessen. */

/* Urheber und Lizenz des Beispielbilds – bei CC-Bildern Pflicht. */
.bild-nachweis {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--text-muted);
  opacity: .85;
}

/* ── Vorschau rechts ──────────────────────────────────────────────────────
 *
 * Klick auf eine Karte oeffnet das Wesentliche hier, statt die Seite zu
 * wechseln. Die Uebersicht bleibt stehen und ordnet sich links neu.
 */
.vorschau {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(50vw, 560px);
  z-index: 200;
  overflow-y: auto;
  padding: 22px 26px 40px;
  background: var(--card);
  border-left: 2px solid var(--brand-yellow);
  box-shadow: -12px 0 40px rgba(0,0,0,.16);
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.32,.72,.28,1);
}
.vorschau--da { transform: none; }
.vorschau[hidden] { display: none; }

.vorschau-schatten {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0,0,0,.18);
  opacity: 0;
  transition: opacity .26s ease;
}
.vorschau-schatten--da { opacity: 1; }
.vorschau-schatten[hidden] { display: none; }

/* Der Inhalt rueckt zusammen – dadurch rechnet das Gitter seine Spalten neu.
   Genau das ist die Umordnung; das Skript animiert nur die Differenz. */
.vorschau-offen .page-content { padding-right: calc(min(50vw, 560px) + 32px); }
.vorschau-offen .device-grid > *,
.vorschau-offen .shop-header,
.vorschau-offen .shop-controls {
  opacity: .42;
  filter: saturate(.55);
  transition: opacity .26s ease, filter .26s ease;
}
/* Die angeklickte Karte bleibt klar – sie ist der Bezug zur Vorschau. */
.vorschau-offen .device-card--aktiv {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 2px var(--brand-yellow), var(--shadow-hover);
}

/* Die aufgerufene Bestellung bleibt in der Liste erkennbar, solange die
   Vorschau offen steht – sonst weiss man nach dem Scrollen nicht mehr,
   wovon die Leiste rechts handelt. */
.orders-table tr.order-row--aktiv td {
  border-top-color: var(--brand-yellow);
  border-bottom-color: var(--brand-yellow);
  /* Aus dem Kartenton gemischt – so traegt es auch im dunklen Modus. */
  background: color-mix(in srgb, var(--brand-yellow) 10%, var(--card));
}
.orders-table tr.order-row--aktiv td:first-child { border-left-color: var(--brand-yellow); }
.orders-table tr.order-row--aktiv td:last-child { border-right-color: var(--brand-yellow); }

/* In der schmalen Leiste sitzen die Abschnitte enger: kein Schatten, kein
   Raster, und die Geraetetabelle darf schmaler werden als in der Uebersicht. */
.vorschau .admin-order-card {
  padding: 16px;
  box-shadow: none;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.vorschau .admin-order-card .orders-table { min-width: 0; font-size: 12px; }
/* Seriennummern sind ein Wort ohne Trennstelle – in der schmalen Leiste
   duerfen sie umbrechen, sonst schiebt die Tabelle waagerecht. */
.vorschau .admin-order-card .orders-table td,
.vorschau .admin-order-card .orders-table th { padding: 7px 6px; overflow-wrap: anywhere; }
.vorschau .verlauf-table { font-size: 11.5px; }
.vorschau .order-actions--detail { margin-top: 0; }

.vorschau-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.vorschau-name {
  margin: 2px 0 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.vorschau-zu {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.vorschau-zu:hover { background: var(--border); color: var(--text); }
.vorschau-zu svg { width: 18px; height: 18px; }

.vorschau-bild {
  position: relative;
  height: 240px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
}
.vorschau-bild img { max-height: 210px; max-width: calc(100% - 32px); object-fit: contain; }

.vorschau-preis {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.vorschau-marken {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.vorschau-marken .cond-note { margin-left: 0; }

.vorschau-aktionen {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.vorschau-aktionen .btn-primary { flex: 1; }

.vorschau-tabelle { margin-top: 6px; }
.vorschau-notiz {
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.vorschau-ganz {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Schmale Bildschirme: die Vorschau nimmt alles ein, Umordnen entfaellt. */
@media (max-width: 860px) {
  .vorschau { width: 100%; border-left: none; border-top: 2px solid var(--brand-yellow); }
  .vorschau-offen .page-content { padding-right: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .vorschau { transition: none; }
  .vorschau-schatten { transition: none; }
  .vorschau-offen .device-grid,
  .vorschau-offen .shop-header,
  .vorschau-offen .shop-controls { transition: none; }
}

/* ── Zustand je Geraet im Admin-Bereich ───────────────────────────────── */
.zustand-legende {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 11.5px;
  color: var(--text-muted);
}
.zustand-erklaerung strong { color: var(--text-2); margin-right: 6px; }

.zustand-modell { margin-bottom: 14px; }
.zustand-modell-kopf {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0 4px;
  font-size: 12.5px;
  font-weight: 650;
  border-bottom: 1px solid var(--border);
}
.zustand-anzahl { font-size: 11px; font-weight: 500; color: var(--text-muted); }

.zustand-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.zustand-zeile:last-child { border-bottom: none; }
.zustand-tag {
  width: 132px;
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.zustand-wahl { width: 168px; flex-shrink: 0; font-size: 12.5px; padding: 5px 8px; }
.zustand-preis {
  margin-left: auto;
  font-size: 13px;
  white-space: nowrap;
}
.zustand-grund {
  margin-right: 7px;
  color: var(--text-muted);
  text-decoration: line-through;
}
/* Ohne JavaScript setzt dieser Knopf, mit JavaScript reicht die Auswahl. */
.zustand-setzen { flex-shrink: 0; font-size: 11.5px; }

@media (max-width: 640px) {
  .zustand-zeile { flex-wrap: wrap; }
  .zustand-tag { width: 100%; }
  .zustand-preis { margin-left: 0; }
}

/* Wie viele baugleiche Geraete hinter einem Eintrag stehen. */
.stueckzahl {
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--slate-bg);
  color: var(--slate);
  font-size: 10px;
  font-weight: 700;
}
.gruppen-hinweis {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 12px;
  color: var(--text-muted);
}

/* Die Zustandsstufen tragen jetzt eigene Namen. */
.cond-sehr_gut { background: var(--green-bg); color: var(--green); }
.cond-gut      { background: var(--amber-bg); color: var(--amber); }
.cond-schlecht { background: var(--slate-bg); color: var(--slate); }

/* Zustandsauswahl direkt am Geraet – nur fuer Admins sichtbar. */
.zustand-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.zustand-inline .zustand-wahl { width: auto; min-width: 168px; }
.vorschau .zustand-inline { margin: 0 0 16px; }

/* Zustand je Exemplar – nur fuer Admins, wenn eine Karte mehrere vertritt. */
.exemplare { margin-top: 28px; }
.exemplar-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.exemplar-zeile:last-child { border-bottom: none; }
.exemplar-tag {
  width: 132px;
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.exemplar-preis { margin-left: auto; font-size: 13px; white-space: nowrap; }

@media (max-width: 640px) {
  .exemplar-zeile { flex-wrap: wrap; }
  .exemplar-tag { width: 100%; }
  .exemplar-preis { margin-left: 0; }
}

/* Umschalter zwischen einzeln und gebuendelt – nur fuer Admins. */
.ansicht-schalter {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
  margin-right: 12px;
}
.ansicht-option {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.ansicht-option:hover { background: var(--bg); color: var(--text); }
.ansicht-option.active { background: var(--text); color: var(--on-inverse); }

/* Zustandsauswahl auf der Karte. */
.karte-zustand { margin: 8px 0 0; }
.karte-zustand select { width: 100%; font-size: 11.5px; padding: 4px 7px; }
.karte-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

/* Zahlungsstand der Rechnung – bezahlt beruhigt, offen faellt auf. */
.order-paid {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}
.order-unpaid {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
}

/* Der Grund, warum Rechnung oder Ticket fehlen. */
.order-grund {
  display: inline-block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-muted);
  max-width: 320px;
}

/* Nachtraegliches DHL-Label – klein, weil selten gebraucht. */
.label-nachtrag { margin-top: 6px; font-size: 11.5px; }
.label-nachtrag summary { cursor: pointer; color: var(--text-muted); }
.label-nachtrag form {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 7px;
  min-width: 170px;
}
.label-nachtrag .field-input { font-size: 11.5px; padding: 4px 7px; }
/* Der Ersatz ist kein gewoehnlicher Nachtrag: Er kostet ein zweites Mal
   Porto und laesst eine angemeldete Sendung zurueck. */
.label-nachtrag--ersatz summary { color: var(--amber); font-weight: 600; }
.label-ersatz-hinweis {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: left;
}
.btn-aktion--ersatz { border-color: var(--amber); color: var(--amber); }
.btn-aktion--ersatz:hover { background: var(--amber-bg); }
.order-meta a { color: var(--accent); margin-left: 5px; }

/* ── Verkaufsbedingungen ────────────────────────────────────────────────── */
.terms { max-width: 720px; }
.terms-stand { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
.terms h2 { font-size: 15px; font-weight: 700; margin: 26px 0 8px; }
.terms p { font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.terms code { font-size: 12px; }
.garantie-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ── ADMIN: BESTELL-DETAILSEITE ──────────────────────────── */

/* Monatsexport neben dem CSV-Knopf: ein Monatsfeld und ein Knopf, in einer
   Zeile, damit die Kopfzeile der Bestellkachel nicht in die Hoehe waechst. */
.export-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}
.export-zeile-treffer { margin-right: auto; font-size: 12px; color: var(--text-muted); }
.monatsexport { display: inline-flex; align-items: center; gap: 8px; }
.monatsexport-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.monatsexport-feld { padding: 5px 8px; font-size: 12.5px; }

.order-nummer-link { color: inherit; text-decoration: none; }
.order-nummer-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.admin-zurueck {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
}
.admin-zurueck:hover { color: var(--text); }

.admin-order-card { max-width: 900px; margin-top: 24px; }

.verlauf-table { margin-top: 4px; }
.verlauf-zeit {
  white-space: nowrap;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  width: 1%;
}
.verlauf-wer { white-space: nowrap; color: var(--text-2); }
/* Aus einem Zeitstempel abgeleitet statt mitgeschrieben – erkennbar, aber
   nicht ausgegraut: fuer alte Bestellungen ist das die ganze Geschichte. */
.verlauf-row--abgeleitet .verlauf-zeit { font-style: italic; }
.verlauf-hinweis { margin-left: 6px; font-size: 11px; color: var(--text-muted); }

.order-actions--detail { margin-top: 4px; }
.order-actions--detail .aktions-stapel,
.order-actions--detail .zahlung-zeile { justify-content: flex-start; }

/* ── Intro-Video nach der Anmeldung ──────────────────────────────────────
 *
 * Eigenstaendige Seite ohne Seitenleiste. Das Video fuellt den ganzen
 * Bildschirm. object-fit: contain, nicht cover: Der Splash hat Text bis an
 * den oberen Rand, und cover schnitt ihn auf jedem Fenster ab, das nicht
 * genau 16:9 ist. contain fuellt 16:9 genauso und zeigt sonst schmale
 * schwarze Raender statt halber Ueberschriften.
 */
.intro-body { margin: 0; background: #000; overflow: hidden; }
.intro-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
}
.intro-skip {
  position: fixed;
  top: 18px; right: 20px;
  z-index: 2;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(0,0,0,.45);
  border: 1.5px solid rgba(255,255,255,.45);
  backdrop-filter: blur(4px);
}
.intro-skip:hover { border-color: var(--brand-yellow); color: var(--brand-yellow); }
/* Nur sichtbar, wenn der Browser das Autoplay verweigert hat. */
.intro-wartet {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,.35);
}
.intro-wartet[hidden] { display: none; }
.intro-abspielen { background: var(--brand-yellow); color: #111; font-size: 16px; padding: 12px 22px; }
.intro-weiter { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* Neu im Shop: die Vorschau dessen, was der Bot melden wuerde. */
.neuheiten-vorschau { margin-top: 12px; font-size: 13px; }
.neuheiten-liste { margin: 6px 0 0; padding-left: 18px; }
.neuheiten-liste li { margin: 2px 0; }

/* Beobachtete Modelle auf der Wunschliste – eine ruhige Liste ueber den Karten. */
.modellwatch { margin: 0 0 20px; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); }
.modellwatch-titel { margin: 0 0 8px; font-size: 15px; }
.modellwatch-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.modellwatch-liste li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.modellwatch-liste li form { margin-left: auto; }
.modellwatch-form { margin-top: 8px; }

