:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d5dbe5;
  --accent: #2563eb;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
.topbar { height: 74px; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #111827; color: white; }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar p { margin: 4px 0 0; color: #cbd5e1; font-size: 13px; }
.status { background: #1f2937; border: 1px solid #374151; color: #dbeafe; padding: 7px 10px; border-radius: 999px; font-size: 13px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout { display: grid; grid-template-columns: 370px 1fr; gap: 14px; padding: 14px; height: calc(100vh - 74px); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.controls { padding: 14px; overflow: auto; }
section { border-bottom: 1px solid #eef2f7; padding-bottom: 16px; margin-bottom: 16px; }
section:last-child { border-bottom: none; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0; }
select, input[type="text"], input[type="number"] { width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; font: inherit; }
input[type="checkbox"] { transform: translateY(2px); margin-right: 8px; }
.templateNote, .fileInfo { color: var(--muted); font-size: 12px; line-height: 1.35; }
.dropzone { position: relative; border: 2px dashed #9ca3af; border-radius: 12px; padding: 18px; background: #f8fafc; text-align: center; cursor: pointer; display: grid; gap: 4px; color: #374151; }
.dropzone.drag { border-color: var(--accent); background: #eff6ff; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.demoButtons { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 10px 0; }
button { border: 1px solid #cbd5e1; background: white; border-radius: 9px; padding: 8px 10px; font: inherit; cursor: pointer; text-align: left; }
button:hover { border-color: var(--accent); color: var(--accent); }
.paramForm { display: grid; gap: 8px; }
.paramForm .row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; }
.paramForm .row.checkbox { grid-template-columns: 1fr; }
.warning { color: var(--danger); font-size: 12px; line-height: 1.35; }
.workspace { min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) 255px; gap: 14px; }
.viewerGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 0; }
.viewerCard { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.viewerHeader { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-bottom: 1px solid #eef2f7; }
.viewerHeader h2 { margin: 0; }
.viewerHeader span { color: var(--muted); font-size: 12px; }
.svgBox { min-height: 0; overflow: auto; background: #fff; }
.svgBox svg { width: 100%; height: 100%; min-height: 420px; display: block; background: white; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 0; }
.details > div { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px; overflow: auto; }
pre { white-space: pre-wrap; font-size: 12px; line-height: 1.4; margin: 0; color: #334155; }
ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.good { color: #047857; }
.warn { color: #b45309; }
.bad { color: #b91c1c; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .workspace { grid-template-rows: auto auto; }
  .viewerGrid, .details { grid-template-columns: 1fr; }
}

.paramIntro { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: 10px; padding: 9px 10px; font-size: 12px; line-height: 1.35; }
fieldset { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 11px 12px; margin: 0 0 10px; background: #fbfdff; }
legend { font-size: 12px; font-weight: 800; color: #334155; padding: 0 5px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: -3px; }
.twoCols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* v3 kaufmännischer MVP */
.workspace { grid-template-rows: minmax(420px, 1fr) auto auto; overflow: auto; }
select, input[type="text"], input[type="number"], input[type="date"], textarea { width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; font: inherit; }
textarea { resize: vertical; min-height: 72px; }
.orderForm { display: grid; gap: 8px; }
.priceBox { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px; font-size: 13px; line-height: 1.45; }
button.primary { background: var(--accent); color: white; border-color: var(--accent); text-align: center; font-weight: 800; }
button.primary:hover { background: #1d4ed8; color: white; }
.commerceGrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; padding-bottom: 4px; }
.commerceCard { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px; overflow: auto; min-height: 210px; }
.orderStatusCard { display: grid; gap: 6px; font-size: 13px; line-height: 1.45; margin-bottom: 12px; }
.statusBadge { display: inline-block; border-radius: 999px; padding: 4px 8px; background: #eef2ff; color: #3730a3; font-weight: 800; width: fit-content; }
.statusBadge.draft { background: #f1f5f9; color: #475569; }
.statusBadge.ordered { background: #dbeafe; color: #1e40af; }
.statusBadge.question { background: #fef3c7; color: #92400e; }
.statusBadge.production { background: #dcfce7; color: #166534; }
.statusBadge.shipped { background: #ede9fe; color: #5b21b6; }
.timeline { border-top: 1px solid #eef2f7; padding-top: 8px; display: grid; gap: 7px; font-size: 12px; color: #475569; }
.timelineItem { display: grid; grid-template-columns: 92px 1fr; gap: 8px; }
.timelineItem strong { color: #111827; }
#sevdeskPreview { background: #0f172a; color: #dbeafe; border-radius: 10px; padding: 10px; max-height: 220px; overflow: auto; }
@media (max-width: 1200px) {
  .commerceGrid { grid-template-columns: 1fr; }
}
@media print {
  .controls, .topbar, .details, .commerceGrid { display: none; }
  .layout { display: block; height: auto; padding: 0; }
  .viewerGrid { grid-template-columns: 1fr; }
  .viewerCard:first-child { display: none; }
}
