/* Tassen-Admin – Hausstil "tassen-ui" (Glassmorphism, Dark-Mode via body.dark-mode). Selbstständig, keine CDNs. */
:root {
  /* CI des Shops „Personalisierte Tasse“: Schwarz (#1a1a1a) auf Beige (#f4f1ea / #fbfaf7), Taupe #a29078 als warmer Ton */
  --bg: #f4f1ea; --bg2: #ece7dc; --bg-card: rgba(255,253,249,0.72); --bg-card-solid: #fffdf9; --bg-input: rgba(255,255,255,0.85);
  --border: rgba(26,26,26,0.10); --border-glow: rgba(26,26,26,0.22); --text: #1a1a1a; --text-dim: rgba(26,26,26,0.55);
  --accent: #1a1a1a; --accent-hover: #000000; --accent-glow: rgba(26,26,26,0.18); --accent-text: #fffdf9;
  --accent-soft: rgba(26,26,26,0.06); --accent-soft-strong: rgba(26,26,26,0.12); --taupe: #a29078; --taupe-soft: rgba(162,144,120,0.18); --taupe-text: #6f5f47;
  --green: #1f8a4c; --green-glow: rgba(31,138,76,0.3); --orange: #c27a12; --orange-glow: rgba(194,122,18,0.3);
  --red: #c62828; --red-glow: rgba(198,40,40,0.3); --blue: #2d5f9e;
  --glass-bg: rgba(255,253,249,0.6); --glass-border: rgba(26,26,26,0.07); --glass-shadow: 0 8px 32px rgba(60,50,30,0.08);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1); --spring-soft: cubic-bezier(0.22, 1.2, 0.36, 1); --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 14px; --sidebar-w: 224px; --header-h: 56px;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@font-face { font-family: "Poppins"; src: url("/files/public/fonts/ui/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/files/public/fonts/ui/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/files/public/fonts/ui/Poppins-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/files/public/fonts/ui/Poppins-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
html.dark-mode, body.dark-mode {
  /* Dunkel: Schwarz mit warmem Beige als Akzent und Schrift */
  --bg: #141311; --bg2: #1d1b18; --bg-card: rgba(36,33,29,0.72); --bg-card-solid: #24211d; --bg-input: rgba(255,250,240,0.06);
  --border: rgba(244,241,234,0.09); --border-glow: rgba(244,241,234,0.2); --text: #f4f1ea; --text-dim: rgba(244,241,234,0.55);
  --accent: #f4f1ea; --accent-hover: #ffffff; --accent-glow: rgba(244,241,234,0.14); --accent-text: #1a1a1a;
  --accent-soft: rgba(244,241,234,0.07); --accent-soft-strong: rgba(244,241,234,0.14); --taupe: #c4b298; --taupe-soft: rgba(196,178,152,0.16); --taupe-text: #d8c7aa;
  --green: #4cc27a; --orange: #e0a13a; --red: #ef6a6a; --blue: #7fa6d8;
  --glass-bg: rgba(36,33,29,0.6); --glass-border: rgba(244,241,234,0.07); --glass-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
html.dark-mode { color-scheme: dark; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 20% 40%, rgba(162,144,120,0.16), transparent),
              radial-gradient(ellipse 60% 40% at 80% 20%, rgba(255,255,255,0.5), transparent),
              radial-gradient(ellipse 50% 60% at 50% 80%, rgba(221,207,182,0.22), transparent);
  animation: gradientShift 20s ease-in-out infinite alternate; }
@keyframes gradientShift { 0% { opacity: 1; transform: scale(1) rotate(0deg); } 50% { opacity: .8; transform: scale(1.1) rotate(2deg); } 100% { opacity: 1; transform: scale(1) rotate(-1deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }
pre.json { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; overflow: auto; max-height: 480px; white-space: pre; font-size: 12px; }
kbd { border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: var(--bg-card-solid); }
.muted { color: var(--text-dim); } .small { font-size: 12px; } .danger-text { color: var(--red); }
.mt { margin-top: 18px; } .mt-s { margin-top: 8px; } .inline { display: inline; }
[hidden] { display: none !important; }

/* Glass */
.glass { background: var(--glass-bg); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }

/* Layout */
.header { position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; border-left: 0; border-right: 0; border-top: 0; animation: slideDown .5s var(--ease-out) both; }
body.dark-mode .header { background: rgba(20,19,17,0.85); }
.brand { font-weight: 800; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-emoji { font-size: 20px; }
/* Shop-Logo (SVG in currentColor: schwarz im Hellen, beige im Dunklen) mit „Admin“ als Zusatz */
.brand-logo { height: 26px; width: auto; display: block; color: var(--text); }
.brand-sub { font-weight: 500; color: var(--text-dim); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding-left: 10px; border-left: 1px solid var(--border-glow); line-height: 1; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-clock { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13px; }
.shell { display: flex; min-height: calc(100vh - var(--header-h)); position: relative; z-index: 1; }
.sidebar { width: var(--sidebar-w); flex: 0 0 auto; padding: 14px 10px; border-top: 0; border-bottom: 0; border-left: 0; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; display: flex; flex-direction: column; animation: slideRight .4s var(--ease-out) both; }
body.dark-mode .sidebar { background: rgba(20,19,17,0.6); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; min-height: 44px; border-radius: 10px; color: var(--text); font-weight: 500; transition: background .2s, transform .2s var(--spring-soft); }
.sidebar li a:hover { background: var(--accent-soft); text-decoration: none; transform: translateX(2px); }
.sidebar li a.active { background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 18px var(--accent-glow); }
.nav-icon { width: 22px; text-align: center; font-size: 15px; opacity: .85; }
.sidebar-foot { margin-top: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.sidebar-backdrop { display: none; }
.content { flex: 1 1 auto; min-width: 0; padding: 22px 24px 60px; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: var(--header-h); z-index: 40; transform: translateX(-105%); transition: transform .3s var(--ease-out); animation: none; background: var(--bg-card-solid); }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,0.35); z-index: 35; }
  body.nav-open .sidebar-backdrop { display: block; }
  .content { padding: 16px 12px 60px; }
}
#nav-toggle { display: none; }
@media (max-width: 900px) { #nav-toggle { display: inline-flex; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; font-size: 12px; margin-bottom: 4px; color: var(--text-dim); }
.section-title { margin: 22px 0 10px; }
.card { border-radius: var(--radius); padding: 18px; margin-bottom: 18px; animation: fadeIn .45s var(--ease-out) both; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.empty { color: var(--text-dim); padding: 12px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; margin: 0; }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.banner-warning { background: rgba(217,119,6,0.12); border: 1px solid rgba(217,119,6,0.35); color: var(--orange); }
.banner-error { background: rgba(220,38,38,0.1); border: 1px solid rgba(220,38,38,0.3); color: var(--red); }
body.dark-mode .banner-warning { color: #fbbf24; }
body.dark-mode .banner-error { color: #f87171; }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dash-card { display: block; border-radius: var(--radius); padding: 16px; color: var(--text); animation: fadeIn .5s var(--ease-out) both; transition: transform .25s var(--spring-soft), box-shadow .25s; transform-style: preserve-3d; }
.dash-card:hover { text-decoration: none; box-shadow: 0 14px 40px rgba(60,50,30,0.14); }
.dash-card:nth-child(1) { animation-delay: .05s; } .dash-card:nth-child(2) { animation-delay: .1s; } .dash-card:nth-child(3) { animation-delay: .15s; }
.dash-card:nth-child(4) { animation-delay: .2s; } .dash-card:nth-child(5) { animation-delay: .25s; } .dash-card:nth-child(6) { animation-delay: .3s; }
.dash-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.dash-value { font-size: 30px; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
.dash-value.warn { color: var(--orange); } .dash-value.danger { color: var(--red); }
.dash-sub { font-size: 12px; color: var(--text-dim); }
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.status-list li { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(156,163,175,0.2); }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.dot.warn { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-glow); }
.dot.off { background: #9ca3af; }
.job-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; background: var(--bg-card-solid); color: var(--text); transition: transform .2s var(--spring), box-shadow .2s, background .2s; position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; text-decoration: none; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: progress; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 18px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border-color: var(--border-glow); }
.btn-outline:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-danger { color: var(--red); }
.btn-danger.btn-outline:hover { background: rgba(220,38,38,0.08); border-color: var(--red); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.btn .spinner { width: 14px; height: 14px; }
@keyframes rippleOut { to { transform: scale(1); opacity: 0; } }
.ripple { position: absolute; border-radius: 50%; background: var(--accent-soft-strong); transform: scale(0); animation: rippleOut .6s ease-out forwards; pointer-events: none; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; min-width: 0; }
.field > span { color: var(--text-dim); font-weight: 500; }
.field.check { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; max-width: 100%; transition: border-color .2s, box-shadow .2s; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
input[type="color"] { padding: 4px; width: 56px; min-height: 44px; cursor: pointer; }
input[type="range"] { min-height: 44px; padding: 0; background: transparent; border: 0; accent-color: var(--accent); }
input[type="file"] { padding: 8px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
body.dark-mode input, body.dark-mode select, body.dark-mode textarea { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.compact { gap: 8px 12px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input { flex: 1 1 200px; width: auto; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar input[type="search"] { flex: 1 1 200px; width: auto; }
.filter-bar select { width: auto; }
.color-row { display: flex; align-items: center; gap: 10px; }
.w-num { width: 84px; }
.table-forms input, .table-forms select { min-height: 38px; padding: 6px 8px; }
.table-forms td { vertical-align: middle; }
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--orange), var(--green)); transition: width .2s; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--text-dim); } .kv dd { margin: 0; min-width: 0; word-break: break-word; }
.kv-inline { display: flex; gap: 10px; font-size: 13px; padding: 4px 0; }
.kv-inline > span:first-child { color: var(--text-dim); min-width: 90px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--accent-soft); }
.table .actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 14px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,0.06); color: var(--text); white-space: nowrap; }
body.dark-mode .badge { background: rgba(255,255,255,0.1); }
.badge-ok, .badge-done, .badge-ordered { background: rgba(5,150,105,0.14); color: var(--green); }
.badge-off, .badge-draft, .badge-no_designs { background: rgba(107,114,128,0.16); color: var(--text-dim); }
.badge-received, .badge-pending, .badge-in_cart { background: var(--taupe-soft); color: var(--taupe-text); }
.badge-processing, .badge-rendering { background: rgba(217,119,6,0.14); color: var(--orange); }
.badge-failed { background: rgba(220,38,38,0.14); color: var(--red); }
body.dark-mode .badge-ok, body.dark-mode .badge-done, body.dark-mode .badge-ordered { color: #34d399; }
body.dark-mode .badge-failed { color: #f87171; }
body.dark-mode .badge-processing, body.dark-mode .badge-rendering { color: #fbbf24; }
body.dark-mode .badge-received, body.dark-mode .badge-pending, body.dark-mode .badge-in_cart { color: #93c5fd; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-glow); color: var(--text); font-weight: 600; font-size: 13px; background: var(--bg-card); }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: 0 6px 16px var(--accent-glow); }

/* Templates */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.template-card { border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; animation: fadeIn .45s var(--ease-out) both; }
.template-card.inactive { opacity: .65; }
.template-thumb { display: block; background: repeating-conic-gradient(rgba(0,0,0,0.05) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.template-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 80px; color: var(--text-dim); font-size: 12px; }
.template-body { padding: 12px 14px 6px; }
.template-title { font-weight: 700; font-size: 15px; }
.template-actions { padding: 8px 14px 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.thumb-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: repeating-conic-gradient(rgba(0,0,0,0.05) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.thumb-preview img { width: 100%; display: block; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .editor-layout { grid-template-columns: 1fr; } }
.editor-main { min-height: 420px; }
.editor-loading { display: flex; align-items: center; gap: 10px; color: var(--text-dim); padding: 40px 0; justify-content: center; }
.editor-stub { text-align: center; padding: 30px 12px; color: var(--text-dim); border: 1px dashed var(--border); border-radius: 12px; }

/* Fonts */
.font-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.font-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.font-sample { font-size: 26px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Model binding */
.binding-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .binding-layout { grid-template-columns: 1fr; } }
.viewer-stage { height: 460px; border-radius: 12px; overflow: hidden; touch-action: none; background: radial-gradient(circle at 50% 40%, #ffffff, #dfe2ea); position: relative; }
body.dark-mode .viewer-stage { background: radial-gradient(circle at 50% 40%, #3a3a5c, #15152a); }
@media (max-width: 700px) { .viewer-stage { height: 320px; } }
.pattern-canvas { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.dropzone { border: 2px dashed var(--border-glow); border-radius: 14px; padding: 22px 16px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; outline: none; }
.dropzone:hover, .dropzone:focus, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { font-size: 26px; margin-bottom: 4px; }
.model-info { margin-top: 10px; }
.area-bind { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.area-bind.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.area-bind h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.range-row { display: grid; grid-template-columns: 48px 1fr 72px; gap: 8px; align-items: center; font-size: 13px; }
.range-row input[type="number"] { min-height: 38px; padding: 6px 8px; }
.uv-grid { display: grid; gap: 6px; margin-top: 6px; }

/* Layout editor */
.layout-editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .layout-editor { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.le-stage-wrap { overflow: auto; border-radius: 10px; }
.le-stage { background: repeating-conic-gradient(rgba(0,0,0,0.06) 0 25%, transparent 0 50%) 0 0 / 18px 18px; border: 1px solid var(--border); border-radius: 10px; touch-action: none; }
.le-preview { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.le-preview img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; background: repeating-conic-gradient(rgba(0,0,0,0.06) 0 25%, transparent 0 50%) 0 0 / 18px 18px; }
.le-side .form-grid.two { grid-template-columns: 1fr 1fr; }
.mirror-row { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.mirror-row input { min-height: 38px; padding: 6px 8px; }
.prop-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.prop-row > span { color: var(--text-dim); }
.prop-row input, .prop-row select, .prop-row textarea { min-height: 38px; padding: 6px 8px; }
.prop-row.full { grid-template-columns: 1fr; }
.layer-list { list-style: none; margin: 0; padding: 0; }
.layer-list li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.layer-list li:hover { background: var(--accent-soft); }
.layer-list li.active { background: var(--accent-soft-strong); font-weight: 600; }
.layer-list .layer-type { font-size: 11px; color: var(--text-dim); text-transform: uppercase; width: 64px; }
.layer-list .layer-btns { margin-left: auto; display: flex; gap: 2px; }
.layer-list .layer-btns button { min-height: 30px; min-width: 30px; padding: 0 6px; border-radius: 6px; }

/* Orders / designs */
.line-item-grid { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; }
@media (max-width: 700px) { .line-item-grid { grid-template-columns: 1fr; } }
.line-preview img { width: 100%; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.file-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
@media (max-width: 700px) { .file-groups { grid-template-columns: 1fr; } }
.file-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.design-card { display: block; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; color: var(--text); background: var(--bg-card); transition: transform .2s var(--spring-soft), box-shadow .2s; }
.design-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }
.design-thumb { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; }
.design-thumb img { width: 100%; height: 100%; object-fit: cover; }
.design-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.design-preview-big img { width: 100%; max-width: 480px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; max-width: calc(100vw - 40px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); font-size: 13px; font-weight: 500; color: var(--text); max-width: 360px; animation: toastIn .4s var(--spring) both; cursor: pointer; border-left: 3px solid var(--accent); }
.toast.success { border-left-color: var(--green); } .toast.error { border-left-color: var(--red); } .toast.warning { border-left-color: var(--orange); }
.toast .toast-icon { width: 24px; height: 24px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; background: var(--accent); }
.toast.success .toast-icon { background: var(--green); } .toast.error .toast-icon { background: var(--red); } .toast.warning .toast-icon { background: var(--orange); }
body.dark-mode .toast { background: rgba(30,30,55,0.95); border-color: rgba(255,255,255,0.08); }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { background: var(--bg-card-solid); border-radius: 16px; padding: 24px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.25); animation: fadeIn .3s var(--ease-out); }
.modal-card h3 { font-size: 18px; margin-bottom: 10px; }
.modal-msg { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; white-space: pre-line; }
.modal-btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

/* Misc */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border-glow); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideRight { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.login-page .login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 1; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .field { text-align: left; margin-bottom: 14px; }
.login-emoji { font-size: 44px; }

/* Sammel-Aktionen in der Bestellliste */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.bulk-bar select { min-height: 38px; padding: 6px 10px; }
.bulk-bar strong { margin-right: 4px; }
.filter-bar select, .filter-bar input { min-height: 40px; }

/* Produktseite: Farbliste und Bogen-Vorschau */
.color-dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); }
.color-dot-sm { width: 13px; height: 13px; margin-right: 7px; vertical-align: -2px; }
.chip .color-dot-sm { margin-right: 8px; }
.pa-sheet { position: relative; width: 100%; border: 1px solid var(--border); border-radius: 10px;
  background: repeating-conic-gradient(rgba(0,0,0,0.05) 0 25%, transparent 0 50%) 0 0 / 16px 16px; overflow: hidden; }
.pa-band { position: absolute; left: 0; right: 0; top: 0; background: var(--accent-soft); border-bottom: 1px dashed var(--accent); }
.pa-band span { position: absolute; left: 6px; top: 3px; font-size: 10px; color: var(--accent); }
.pa-box { position: absolute; border: 2px solid var(--accent); background: var(--taupe-soft); cursor: grab;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--accent); text-align: center; }
.pa-box:active { cursor: grabbing; }
.mb-s { margin-bottom: 8px } .mt-s { margin-top: 8px }

/* Farbwähler in der Farbtabelle: links der eingestellte Ton, daneben – falls abweichend –
   die Farbe, die das 3D-Modell heute zeigt. */
.variant-color { display: flex; align-items: center; gap: 8px; }
.variant-color input[type="color"] { width: 38px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }

/* Mehrere Druckdateien je Bestellung: schmale Knöpfe nebeneinander, damit die Zeile nicht aufreißt. */
.pdf-links { display: flex; flex-wrap: wrap; gap: 5px; }
.pdf-links .btn { padding: 3px 9px; font-size: 11.5px; min-height: 26px; }

/* Formen-Bibliothek */
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.shape-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.shape-preview { height: 96px; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(rgba(0,0,0,0.05) 0 25%, transparent 0 50%) 0 0 / 14px 14px;
  border-radius: 8px; margin-bottom: 8px; }
.shape-preview img { max-width: 82%; max-height: 82%; object-fit: contain; }
.shape-name { font-size: 12.5px; margin-bottom: 8px; word-break: break-all; }

/* Zahlenfelder im Druckbogen-Editor: dreistellige Millimeterwerte müssen ganz lesbar sein. */
.form-grid.compact input[type="number"],
.form-grid.two input[type="number"] { min-width: 88px; }
.le-side .form-grid { grid-template-columns: 1fr 1fr; }

/* Hinweis im Bogen-Editor, wenn ein Element nicht exakt mittig sitzt. */
.le-off { color: #b45309; margin-top: 6px; }
body.dark-mode .le-off { color: #fbbf24; }

/* Bestellungen: Reiter Offen / Versendet / Alle als Chips mit Zähler. */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-glow); color: var(--text); font-weight: 600; font-size: 13px; background: var(--bg-card); }
.tab:hover { text-decoration: none; border-color: var(--accent); }
.tab.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: 0 6px 16px var(--accent-glow); }
.tab-count { font-variant-numeric: tabular-nums; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,0.07); }
body.dark-mode .tab-count { background: rgba(255,255,255,0.12); }
.tab.active .tab-count { background: rgba(255,255,255,0.22); }

/* Checkbox-/Radio-Chip: das Eingabefeld bleibt für Tastatur und Formular erhalten, sichtbar ist nur der Chip.
   Der aktive Zustand kommt vom Server (.active) und – für sofortiges Feedback – über :has(). */
.chip.check { cursor: pointer; position: relative; user-select: none; }
.chip.check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.chip.check:has(input:checked) { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: 0 6px 16px var(--accent-glow); }
.chip.check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.active .color-dot-sm, .chip.check:has(input:checked) .color-dot-sm { border-color: rgba(255,255,255,0.7); }
.chip-sm { min-height: 34px; padding: 4px 12px; font-size: 12.5px; }
.chips-mode { margin-top: -6px; }
.chips-label { display: inline-flex; align-items: center; color: var(--text-dim); font-size: 12px; margin-right: 2px; }

/* Run-Leiste: alle gefilterten Bestellungen in einem Rutsch packen. */
.run-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 12px; border: 1px dashed var(--border-glow); border-radius: 12px; }
.run-bar select { width: auto; min-height: 38px; padding: 6px 10px; }
.run-link { display: inline-block; margin-right: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* Fortschritt eines Runs in einer Tabellenzelle. */
.progress-mini { height: 6px; width: 110px; max-width: 100%; background: var(--border); border-radius: 3px; overflow: hidden; margin: 4px 0; }
.progress-mini .progress-bar { background: var(--accent); transition: width .3s var(--ease-out); }
.progress-mini.done .progress-bar { background: var(--green); }
.progress-mini.big { height: 10px; width: 100%; border-radius: 5px; }

/* Verlauf auf dem Dashboard: admin.js zeichnet das SVG aus den Tageswerten (kein Framework). Die viewBox
   folgt der Containerbreite, deshalb bleiben Text und Rundungen unverzerrt. */
.chart { position: relative; margin-top: 6px; }
.chart-svg { display: block; width: 100%; height: 240px; overflow: visible; font-family: var(--font); }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .grid line.base { stroke: var(--border-glow); }
.chart .axis text { fill: var(--text-dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); fill-opacity: .42; transition: fill-opacity .15s; transform-box: fill-box; transform-origin: 50% 100%; animation: chartGrow .4s var(--ease-out) both; }
.chart .bar.is-hot { fill-opacity: .9; }
.chart .area { fill: var(--green); fill-opacity: .10; }
.chart .line { fill: none; stroke: var(--green); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .marker { fill: var(--bg-card-solid); stroke: var(--green); stroke-width: 2; }
.chart .guide { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
.chart .hit { fill: transparent; }
@keyframes chartGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .chart .bar { animation: none; } }
/* Glass-Tooltip: schwebt über dem Diagramm, folgt dem Tag unter dem Zeiger. */
.chart-tip { position: absolute; z-index: 5; min-width: 150px; padding: 10px 12px; border-radius: 14px; pointer-events: none;
  background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  font-size: 12.5px; line-height: 1.5; color: var(--text); font-variant-numeric: tabular-nums; transition: opacity .12s; }
.chart-tip strong { display: block; font-size: 12px; margin-bottom: 4px; color: var(--text-dim); font-weight: 600; letter-spacing: .01em; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.chart-tip .tip-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.chart-tip .tip-dot.in { background: var(--accent); }
.chart-tip .tip-dot.out { background: var(--green); }
.chart-tip .tip-dot.mugs { background: var(--text-dim); }
.chart-sum { margin: 10px 0 0; }
.chart-empty { color: var(--text-dim); padding: 48px 12px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; }
.chart-legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.lg-bar { background: var(--accent); opacity: .55; }
.lg-line { height: 3px; width: 16px; border-radius: 2px; background: var(--green); vertical-align: 2px; }
.period-chips { margin-bottom: 14px; }
.dash-value.mid { font-size: 26px; }

/* Farb-Chips mit Anzahl der Bestellungen im aktuellen Reiter. */
.chip-n { margin-left: 7px; padding: 0 7px; min-width: 22px; text-align: center; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(0,0,0,0.07); }
body.dark-mode .chip-n { background: rgba(255,255,255,0.12); }
.chip.active .chip-n, .chip.check:has(input:checked) .chip-n { background: rgba(255,255,255,0.22); }

/* Positionen in der Bestellliste: Vorschau, Farbe × Menge, Statuspunkt der Druckdatei. */
.order-items { display: flex; flex-direction: column; gap: 6px; }
.order-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.order-item-text { display: inline-flex; align-items: center; white-space: nowrap; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: block; border: 1px solid var(--border); background: #fff; flex: 0 0 auto; }
.thumb-btn { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; line-height: 0; flex: 0 0 auto; transition: transform .2s var(--spring-soft), box-shadow .2s; }
.thumb-btn:hover { transform: scale(1.06); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.thumb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb-ph { background: repeating-conic-gradient(rgba(0,0,0,0.06) 0 25%, transparent 0 50%) 0 0 / 12px 12px, var(--bg2); }
body.dark-mode .thumb { background: var(--bg2); }
.dot-status { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #9ca3af; box-shadow: 0 0 0 3px rgba(156,163,175,0.18); }
.dot-ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.dot-failed { background: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.dot-pending { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-glow); animation: dotPulse 1.4s ease-in-out infinite; }
.dot-missing { background: #9ca3af; box-shadow: 0 0 0 3px rgba(156,163,175,0.18); }
@keyframes dotPulse { 0%, 100% { box-shadow: 0 0 0 3px var(--orange-glow); opacity: 1; } 50% { box-shadow: 0 0 0 6px rgba(217,119,6,0.12); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .dot-pending { animation: none; } }
.row-failed .td-pick input[disabled] { opacity: .35; cursor: not-allowed; }
.table .td-pick { vertical-align: middle; }

/* Vorschau-Overlay: großes Bild einer Position, ESC oder Klick daneben schließt. */
.preview-overlay { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .2s var(--ease-out); }
.preview-card { position: relative; max-width: min(92vw, 720px); max-height: 92vh; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg-card-solid); box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.preview-card img { display: block; max-width: 100%; max-height: calc(92vh - 90px); object-fit: contain; border-radius: 10px; background: repeating-conic-gradient(rgba(0,0,0,0.05) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.preview-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.preview-close { min-height: 36px; }

/* Tabellen unter 900 px als Karten: jede Zeile eine Karte, Label links, Wert rechts. */
@media (max-width: 900px) {
  .table-wrap:has(.table-cards) { overflow: visible; margin: 0; padding: 0; }
  .table-cards, .table-cards tbody { display: block; }
  .table-cards thead { display: none; }
  .table-cards tr { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: var(--bg-card); }
  .table-cards tr:hover td { background: transparent; }
  /* Zelle als Raster: Label links in Spalte 1, alle Werte untereinander in Spalte 2. */
  .table-cards td { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 2px 14px; align-items: start; justify-items: end; padding: 8px 0; border-bottom: 1px solid var(--border); text-align: right; }
  .table-cards tr td:last-child { border-bottom: 0; }
  .table-cards td[data-label]::before { content: attr(data-label); grid-column: 1; grid-row: 1; justify-self: start; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; text-align: left; }
  .table-cards td > * { grid-column: 2; min-width: 0; }
  .table-cards td:not([data-label]) { grid-template-columns: 1fr; justify-items: start; text-align: left; }
  .table-cards td:not([data-label]) > * { grid-column: 1; }
  .table-cards .actions { justify-content: flex-end; }
  .table-cards .order-items { align-items: flex-end; }
  .table-cards .progress-row { justify-content: flex-end; }
  .table-cards .pdf-links, .table-cards .color-list { justify-content: flex-end; }
}

/* Runs: Kennzahlen in einer leichten Leiste, ruhige Pills, Fortschritt als dünne Zeile. */
.kpi-bar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin-bottom: 18px; border-radius: var(--radius); padding: 4px 6px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; min-width: 150px; flex: 1 1 150px; border-right: 1px solid var(--border); }
.kpi:last-child { border-right: 0; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.kpi-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
a.kpi-value:hover { text-decoration: none; color: var(--accent); }
.kpi-sub { font-size: 12px; color: var(--text-dim); }
.kpi-hint { flex: 2 1 260px; justify-content: center; align-items: flex-start; gap: 8px; }
.kpi-wide { flex: 2 1 260px; }
.kpi-progress { flex: 1 1 100%; padding: 4px 16px 10px; }
.kpi-progress .progress-mini { margin: 0; }
@media (max-width: 700px) { .kpi { border-right: 0; border-bottom: 1px solid var(--border); flex-basis: 100%; } .kpi-hint { border-bottom: 0; } }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--text); background: transparent; white-space: nowrap; vertical-align: middle; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.pill-ok .pill-dot { background: var(--green); }
.pill-open .pill-dot { background: var(--orange); }
.h1-pill { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.h1-pill .pill { font-size: 12px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress-mini { margin: 0; width: 120px; height: 5px; }
.table-runs td { vertical-align: middle; }
.chips-quiet { margin: 4px 0; gap: 6px; }
.chips-quiet .chip { min-height: 28px; padding: 2px 10px; font-size: 12px; font-weight: 500; background: transparent; }
.color-list { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; }
.color-item { display: inline-flex; align-items: center; white-space: nowrap; }

/* Fehlerhafte Druckdateien: Chip „Nur fehlerhafte" und der kleine Neu-rendern-Knopf neben dem roten Punkt. */
.dot-inline { display: inline-block; width: 8px; height: 8px; margin-right: 8px; box-shadow: none; }
.chip-failed.active { background: var(--red); border-color: var(--red); box-shadow: 0 6px 16px var(--red-glow); }
.chip-failed.active .dot-inline { background: #fff; }
.chip-failed:hover { border-color: var(--red); }
.btn-rerun { min-height: 26px; padding: 2px 9px; font-size: 11.5px; border-radius: 8px; color: var(--red); border-color: rgba(220,38,38,0.35); white-space: nowrap; }
.btn-rerun:hover { background: rgba(220,38,38,0.08); border-color: var(--red); }
body.dark-mode .btn-rerun { color: #f87171; }
.dash-card-danger { border-color: rgba(220,38,38,0.35); }

/* Nachdruck (interne Bestellung ohne Shopify): lila Pill, als Link zum Original. */
.pill-nachdruck { border-color: var(--border-glow); color: var(--accent); }
.pill-nachdruck .pill-dot { background: var(--accent); }
a.pill-nachdruck:hover { text-decoration: none; background: var(--accent-soft); border-color: var(--accent); }
.nachdruck-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Löschfrist der Originale: unter 7 Tagen rot mit Punkt, „bereits gelöscht" gedämpft. */
.purge-hint { display: inline-flex; align-items: center; gap: 8px; }
.purge-hint.warn { color: var(--red); font-weight: 600; }
.purge-hint.warn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-glow); flex: 0 0 auto; }
body.dark-mode .purge-hint.warn { color: #f87171; }
.purge-done { color: var(--text-dim); }

/* Farben je Run: Punkte-Leiste in der Liste, große Kachel im Detail. */
.color-bar { display: inline-flex; align-items: center; gap: 3px; }
.color-bar:hover { text-decoration: none; }
.color-bar .color-dot-sm { margin-right: 0; width: 15px; height: 15px; }
.color-more { font-size: 11px; font-weight: 700; color: var(--text-dim); margin-left: 4px; }
.farben-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.farbe-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); animation: fadeIn .4s var(--ease-out) both; }
.farbe-chip .color-dot-lg { width: 32px; height: 32px; flex: 0 0 auto; border: 1px solid var(--border-glow); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35); }
.farbe-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.farbe-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.farbe-count { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; flex: 0 0 auto; }
.farbe-n { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.farbe-unit { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }

/* Nachdruck-Dialog: Positionen mit Haken und Menge, Grund, Anlegen. Baut auf dem Vorschau-Overlay auf. */
.nd-card { width: min(92vw, 560px); gap: 12px; }
.nd-card h3 { margin: 0; font-size: 18px; }
.nd-hint { margin: 0; }
.nd-list { display: flex; flex-direction: column; gap: 6px; max-height: 44vh; overflow: auto; padding: 2px; }
.nd-row { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) 84px; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s, opacity .15s; }
.nd-row:has(input[type="checkbox"]:checked) { border-color: var(--accent); background: var(--accent-soft); }
.nd-row:has(input[type="checkbox"]:not(:checked)) { opacity: .55; }
.nd-row .thumb { object-fit: cover; border-radius: 8px; max-height: 44px; }
.nd-text { display: flex; flex-direction: column; min-width: 0; }
.nd-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-qty { min-height: 36px; padding: 4px 8px; width: 84px; text-align: center; cursor: text; }
.nd-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .nd-form { grid-template-columns: 1fr; } .nd-row { grid-template-columns: 22px 36px minmax(0, 1fr) 70px; } }
.nd-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Benutzer & Rollen: Chip mit Name und Rolle in der Kopfzeile, Rollen- und Bereichs-Chips in Tabellen. Ruhig, keine Deko. */
.user-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 6px 4px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 600; background: var(--bg-card); max-width: 260px; transition: border-color .2s, background .2s; }
.user-chip:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-soft); }
.user-chip .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 600px) { .user-chip .user-name { display: none; } .user-chip { padding-left: 6px; } .header-clock { display: none; } }
.role-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: rgba(107,114,128,0.16); color: var(--text-dim); }
.role-chip.role-inhaber { background: var(--accent-soft-strong); color: var(--accent); }
body.dark-mode .role-chip.role-inhaber { color: #c4b5fd; }
.bereich-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.bereich-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--border); color: var(--text); background: transparent; white-space: nowrap; }
.bereich-chip.bereich-all { border-color: var(--border-glow); color: var(--accent); }
body.dark-mode .bereich-chip.bereich-all { color: #c4b5fd; }
.pill-off .pill-dot { background: #9ca3af; }
.pill-failed .pill-dot { background: var(--red); }
.pill-off { color: var(--text-dim); }
.row-inactive td { opacity: .6; }
.row-inactive td:hover { opacity: 1; }
.table-cards .bereich-chips { justify-content: flex-end; }
.benutzer-hints { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
/* Fünf Aktionen je Zeile: die Zelle bekommt Breite, damit sie in zwei ruhige Reihen umbrechen statt zu stapeln. */
.table-benutzer td { vertical-align: middle; }
.table-benutzer .actions { min-width: 240px; }
.table-benutzer .pw-missing { max-width: 190px; }
.user-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-cell .small { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .table-benutzer .actions { min-width: 0; } .table-cards .user-cell { align-items: flex-end; } }

/* Modal-Formulare (Benutzer anlegen/bearbeiten, Passwort setzen): Felder untereinander, Knöpfe rechts. */
.modal-card.modal-wide { max-width: 560px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-form h3 { margin-bottom: 0; }
.modal-form .modal-msg { margin-bottom: 0; }
.modal-form .modal-btns { margin-top: 6px; }
.modal-form fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.modal-form fieldset.field > span:first-child { color: var(--text-dim); font-weight: 500; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; min-height: 40px; align-items: center; }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.check-list .check { min-height: 38px; font-size: 13px; }
@media (max-width: 520px) { .check-list { grid-template-columns: 1fr; } }
.modal-form [hidden] { display: none !important; }

/* Link-Box: Einladungs-/Reset-Link zum Kopieren, mit Mail-Status darunter. */
.link-box { display: flex; gap: 8px; align-items: stretch; }
.link-box input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.link-box .btn { flex: 0 0 auto; }
.link-hint { color: var(--text-dim); font-size: 12.5px; margin: 0; }
.link-mail { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 0; }
.link-mail .pill { font-size: 11.5px; }

/* Login-Seiten: Links unter dem Formular, Info-Banner (neutrale Antwort), Passwort-Hinweis. */
.login-links { margin-top: 14px; font-size: 13px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.login-card .field small { font-size: 12px; }
.login-card h1 { margin-bottom: 2px; }
.login-card > .muted { margin: 0 0 14px; }
.login-card .banner { text-align: left; }
.banner-info { background: var(--taupe-soft); border: 1px solid rgba(162,144,120,0.5); color: var(--taupe-text); }
body.dark-mode .banner-info { color: #93c5fd; }
.pw-hint.ok { color: var(--green); }
.pw-hint.warn { color: var(--orange); }
.field.is-invalid input { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }

/* Konto & Sicherung: Kennzahlen mit Text statt Zahl, Hinweisbox, Backup-Namen. */
.konto-kv { row-gap: 10px; }
.konto-kv dd { display: flex; align-items: center; }
.kpi-value-text { font-size: 15px; word-break: break-all; }
.kpi-date { white-space: nowrap; font-size: 18px; }
.kpi-sub .pill { margin-right: 6px; }
.backup-name { background: transparent; padding: 0; font-size: 12.5px; }
.hint-box { border-left: 3px solid var(--accent); }
.hint-box ol { margin: 8px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.forbidden-card .inline-actions { margin-top: 14px; }
.btn[disabled][title] { pointer-events: auto; cursor: not-allowed; }

/* Storno/Erstattung: rotes Pill, Zeile in der Liste gedämpft (kommt in keinen Run), Hinweisbox im Detail. */
.pill-storno { border-color: rgba(220,38,38,0.45); color: var(--red); }
.pill-storno .pill-dot { background: var(--red); }
.pill-sm { font-size: 11px; padding: 2px 8px; }
body.dark-mode .pill-storno { color: #f87171; }
.row-storno td { opacity: .62; }
.row-storno td:hover, .row-storno:hover td { opacity: 1; }
.row-storno .td-pick input[disabled] { opacity: .35; cursor: not-allowed; }
.tab-storno.active { background: var(--red); border-color: var(--red); box-shadow: 0 6px 16px var(--red-glow); }
.tab-storno:hover { border-color: var(--red); }
.banner-storno { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.mt-xs { margin-top: 4px; }

/* Verbindungswächter: Banner über allen Seiten, Karte auf der Shopify-Seite. */
.banner-shopify { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.banner-shopify a { font-weight: 600; margin-left: auto; }
.waechter-card .status-list { margin-bottom: 8px; }
.pruef-ergebnis { padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }

/* Kundennotiz: gelb, damit sie vor dem Druck auffällt – in der Liste als Sprechblase mit Tooltip. */
.banner-note { background: rgba(250,204,21,0.16); border: 1px solid rgba(202,138,4,0.45); color: var(--text); }
.banner-note strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #a16207; margin-bottom: 2px; }
body.dark-mode .banner-note strong { color: #fde047; }
.banner-note-text { white-space: pre-line; font-size: 14px; }
.note-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 6px; color: #a16207; background: rgba(250,204,21,0.22); vertical-align: -5px; cursor: help; outline: none; }
.note-icon:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
body.dark-mode .note-icon { color: #fde047; }
.note-tip { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; max-width: 320px; padding: 10px 12px; border-radius: 12px;
  background: var(--bg-card-solid); border: 1px solid rgba(202,138,4,0.45); box-shadow: var(--glass-shadow); color: var(--text); font-size: 12.5px; line-height: 1.45; white-space: pre-line; text-align: left; font-weight: 400; }
.note-tip strong { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #a16207; margin-bottom: 3px; }
.note-icon:hover .note-tip, .note-icon:focus .note-tip, .note-icon:focus-within .note-tip { display: block; }
@media (max-width: 900px) { .note-tip { left: auto; right: 0; } }
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.note-form textarea { min-height: 96px; }
.note-form .form-actions { align-items: center; }
.notiz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notiz-item { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: rgba(250,204,21,0.12); border: 1px solid rgba(202,138,4,0.3); }
.notiz-text { white-space: pre-line; font-size: 13px; }
@media (max-width: 600px) { .notiz-item { grid-template-columns: 1fr; } }
.dash-card-note { border-color: rgba(202,138,4,0.45); }

/* „Kunden anschreiben": Klappmenü mit mailto-Vorlagen – <details>, damit es ohne JS funktioniert. */
.dropdown { position: relative; display: inline-block; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after { content: '▾'; margin-left: 6px; font-size: 11px; opacity: .7; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 260px; padding: 6px; border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.dropdown-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 13px; }
.dropdown-menu a:hover { background: var(--accent-soft); text-decoration: none; }
.dropdown-hint { padding: 6px 12px 4px; border-top: 1px solid var(--border); margin-top: 2px; }
@media (max-width: 600px) { .dropdown-menu { left: 0; right: auto; } }

/* Bögen je Position: „Bogen 1 · Bogen 2" als schlanke Links – ein Ersatzbogen ohne Nachdruck. */
.bogen-rows { display: flex; flex-direction: column; gap: 3px; }
.bogen-row { white-space: nowrap; }
.bogen-links { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.bogen-links .small { margin-right: 2px; }
.bogen-link { font-weight: 600; font-variant-numeric: tabular-nums; }
.bogen-sep { color: var(--text-dim); }
.table-cards .bogen-rows { align-items: flex-end; }
.verlauf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.nd-hint-bogen { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--taupe-soft); border: 1px solid rgba(162,144,120,0.5); color: var(--text); font-size: 12.5px; }

/* Produktseite: fehlende Shopify-Varianten-IDs rot; Modal der Varianten-Übernahme. */
.row-missing-id input[name="shopify_variant_id"] { border-color: var(--red); box-shadow: 0 0 0 2px rgba(220,38,38,0.12); }
.variant-id-cell { white-space: nowrap; }
.variant-id-cell .id-missing { margin-left: 6px; font-weight: 600; }
.vu-result { padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.vu-result.ok { border-color: rgba(5,150,105,0.4); }
.vu-result.warn { border-color: rgba(220,38,38,0.4); }
.vu-count { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vu-missing { color: var(--red); font-weight: 600; }
body.dark-mode .vu-missing { color: #f87171; }
.vu-list { margin: 0; padding-left: 18px; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; max-height: 32vh; overflow: auto; }
.vu-select { width: 100%; }
.vu-meta { color: var(--text-dim); font-size: 12px; }

/* Kundendaten (DSGVO): Löschzeile mit Bestätigungsfeld. */
.loeschen-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
@media (max-width: 600px) { .loeschen-row { grid-template-columns: 1fr; } }
.loesch-ergebnis { padding: 10px 12px; border-radius: 10px; background: rgba(5,150,105,0.1); border: 1px solid rgba(5,150,105,0.35); font-size: 13px; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* Zwei-Faktor (Konto) */
.mfa-setup { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin: 12px 0; }
.mfa-setup img { border-radius: 12px; background: #fff; padding: 6px; }
.mfa-secret { display: inline-block; font-size: 15px; letter-spacing: .12em; word-break: break-all; padding: 6px 10px; border-radius: 8px; background: rgba(127,127,127,.12); }
.mfa-backup { font-size: 15px; letter-spacing: .06em; line-height: 1.7; margin: 8px 0 0; white-space: pre-wrap; }
.btn-notiz { margin-left: 6px; vertical-align: middle; }

/* Einstellungen → Weißtoleranz: Probebild vorher/nachher auf Schachbrett, damit Transparenz sichtbar ist */
.wt-vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.wt-vergleich figure { margin: 0; }
.wt-vergleich figcaption { margin-top: 4px; }
.dropzone.busy { opacity: 0.6; pointer-events: none; }
img.checker { max-width: 100%; max-height: 360px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.12);
  background-color: #fff;
  background-image: linear-gradient(45deg, #d6d6d6 25%, transparent 25%), linear-gradient(-45deg, #d6d6d6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d6d6d6 75%), linear-gradient(-45deg, transparent 75%, #d6d6d6 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }

/* Manuelle Orders: Tassenfarben als Häkchen mit Farbpunkt */
.muster-farben { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; }
.muster-farbe { display: inline-flex; align-items: center; gap: 6px; }
.muster-farbe .swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); display: inline-block; }
.inline-form { display: flex; gap: 6px; align-items: center; }
