/*
  USA Hemp Solutions - Product Builder Demo
  Author: Hasif Ahmed <xmart@live.com> (www.hasif.info)
  Digitalbkk Co., Ltd.
*/

:root {
  --navy: #102543;
  --navy-700: #16335c;
  --blue: #285fa8;
  --blue-600: #1f4f8f;
  --blue-soft: #e8f0fb;
  --ink: #172033;
  --text: #2b3546;
  --muted: #667085;
  --dim: #98a2b3;
  --line: #dfe5ec;
  --line-strong: #c9d3de;
  --soft: #f6f8fb;
  --bg: #eef2f6;
  --card: #ffffff;
  --green: #16705a;
  --green-soft: #e6f4ef;
  --amber: #b7791f;
  --amber-soft: #fdf3e2;
  --red: #b42318;
  --red-soft: #fdecea;
  --purple: #5b4b9e;
  --purple-soft: #ecebf7;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 37, 67, 0.06), 0 8px 24px rgba(16, 37, 67, 0.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --topbar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
[hidden] { display: none !important; }
svg { display: block; }

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(145deg, var(--navy), var(--blue));
  color: #fff; font-weight: 800; font-size: 11px; letter-spacing: 0.06em;
  display: flex; align-items: center; justify-content: center;
}
.brand-title { font-weight: 700; color: var(--ink); font-size: 14px; line-height: 1.2; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.view-switch {
  display: flex; background: var(--soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.view-switch button {
  border: 0; background: transparent; border-radius: 999px;
  padding: 6px 16px; font-weight: 600; color: var(--muted); font-size: 12.5px;
}
.view-switch button.active { background: var(--navy); color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.user-chip .avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--blue-soft); color: var(--blue);
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.badge-count {
  background: var(--blue); color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 12.5px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--soft); border-color: var(--dim); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--blue-600); border-color: var(--blue-600); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover:not(:disabled) { background: var(--navy-700); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover:not(:disabled) { background: #125c4a; }
.btn.danger { color: var(--red); border-color: #efc4bf; }
.btn.danger:hover:not(:disabled) { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn.ghost:hover:not(:disabled) { background: var(--blue-soft); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }

/* ---------- Layout ---------- */
.view { min-height: calc(100vh - var(--topbar-h)); }
.builder {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(400px, 1fr) 296px;
  gap: 16px;
  padding: 16px 20px 24px;
  max-width: 1600px;
  margin: 0 auto;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  min-width: 0;
}

/* Category tabs */
.cat-tabs {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cat-tab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 14px; font-weight: 600; font-size: 12.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.cat-tab:hover:not(:disabled) { border-color: var(--dim); color: var(--ink); }
.cat-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-tab .pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--amber-soft); color: var(--amber);
}
.cat-tab.active .pill { background: rgba(255,255,255,0.18); color: #fff; }
.cat-tab.soon { opacity: 0.6; }
.cat-tab.soon .pill { background: var(--soft); color: var(--muted); }
.cat-tabs .spacer { flex: 1; }
.cat-tabs .hint { font-size: 12px; color: var(--muted); }

/* ---------- Preview panel ---------- */
.preview-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.preview-title { font-weight: 700; color: var(--ink); font-size: 14px; }
.preview-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--soft); color: var(--muted); white-space: nowrap;
}
.chip.blue { background: var(--blue-soft); border-color: #cddcf1; color: var(--blue); }
.chip.green { background: var(--green-soft); border-color: #bfe3d5; color: var(--green); }
.chip.amber { background: var(--amber-soft); border-color: #f1dcb4; color: var(--amber); }
.chip.red { background: var(--red-soft); border-color: #f2c4bf; color: var(--red); }
.chip.purple { background: var(--purple-soft); border-color: #d6d2ec; color: var(--purple); }
.chip.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.build-path {
  padding: 10px 16px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.build-path .lbl { font-weight: 700; color: var(--blue); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.build-path .seg { display: inline-flex; align-items: center; gap: 6px; }
.build-path .seg::after { content: "\2192"; color: var(--dim); }
.build-path .seg:last-child::after { content: ""; }

.panel.preview {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  align-self: start;
  height: calc(100vh - var(--topbar-h) - 32px);
  min-height: 640px;
}
.preview-canvas {
  flex: 1;
  min-height: 320px;
  background:
    radial-gradient(ellipse at 50% 30%, #ffffff 0%, #f4f6f9 55%, #e9edf2 100%);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.preview-canvas { overflow: hidden; user-select: none; }
.preview-zoom-layer {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  transform-origin: center center; transition: transform 0.12s ease-out; will-change: transform;
}
.preview-zoom-layer.dragging { transition: none; cursor: grabbing; }
.preview-canvas.zoomed .preview-zoom-layer { cursor: grab; }
.preview-canvas svg { width: 100%; height: 100%; }
.zoom-controls {
  position: absolute; top: 12px; right: 12px; display: inline-flex;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden;
  box-shadow: var(--shadow); z-index: 2;
}
.zoom-controls button {
  border: 0; background: transparent; padding: 5px 10px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-right: 1px solid var(--line); min-width: 32px;
}
.zoom-controls button:last-child { border-right: 0; }
.zoom-controls button:hover { background: var(--soft); color: var(--ink); }
.zoom-controls #zoom-level { font-size: 11.5px; min-width: 50px; font-variant-numeric: tabular-nums; }
.preview-canvas .canvas-note {
  position: absolute; left: 12px; bottom: 10px; z-index: 2;
  font-size: 11px; color: var(--muted); background: rgba(255,255,255,0.9);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; pointer-events: none;
}
.preview-foot {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.seg-group { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-group button {
  border: 0; background: transparent; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted);
  border-right: 1px solid var(--line);
}
.seg-group button:last-child { border-right: 0; }
.seg-group button.active { background: var(--navy); color: #fff; }
.layer-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.layer-legend .chip.off { opacity: 0.45; text-decoration: line-through; }

/* ---------- Configurator panel ---------- */
.steps {
  display: flex; border-bottom: 1px solid var(--line); overflow-x: auto;
}
.step-tab {
  flex: 1; min-width: 96px; border: 0; background: transparent;
  padding: 12px 8px 10px; text-align: left; border-bottom: 2px solid transparent;
  display: flex; flex-direction: column; gap: 2px;
}
.step-tab .n { font-size: 10.5px; font-weight: 700; color: var(--dim); letter-spacing: 0.04em; }
.step-tab .t { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.step-tab.active { border-bottom-color: var(--blue); }
.step-tab.active .n, .step-tab.active .t { color: var(--blue); }
.step-tab.done .n { color: var(--green); }
.step-tab.done .n::before { content: "\2713 "; }

.step-body { padding: 16px; flex: 1; overflow-y: auto; }
.step-head h2 { margin: 0; font-size: 16px; color: var(--ink); font-weight: 700; }
.step-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

.field { margin-top: 18px; }
.field-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px;
}
.field-label .why { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--blue); font-size: 11.5px; }
.field-label .lock { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--dim); font-size: 11.5px; }

.opt-grid { display: grid; gap: 8px; }
.opt-grid.c2 { grid-template-columns: repeat(2, 1fr); }
.opt-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.opt-grid.c4 { grid-template-columns: repeat(4, 1fr); }

.opt {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 10px 12px; text-align: left; position: relative;
  display: flex; flex-direction: column; gap: 2px;
  transition: border-color 0.12s, background 0.12s;
}
.opt:hover:not(:disabled):not(.locked) { border-color: var(--dim); }
.opt.selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.opt.locked { background: var(--soft); cursor: default; }
.opt:disabled { background: var(--soft); }
.opt .name { font-weight: 600; color: var(--ink); font-size: 13px; display: flex; justify-content: space-between; gap: 6px; }
.opt .sub { color: var(--muted); font-size: 11.5px; }
.opt .price { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.opt.selected .price { color: var(--blue); }
.opt .blocked { font-size: 11px; color: var(--red); margin-top: 3px; }
.opt.pill { padding: 8px 10px; align-items: center; text-align: center; }
.opt.pill .name { justify-content: center; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius);
  padding: 6px 10px 6px 6px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text);
}
.swatch .dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.12); }
.swatch.selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; background: #fff; font-size: 13px;
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.textarea { min-height: 70px; resize: vertical; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input { flex: 1; }

.check {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; margin-top: 8px;
}
.check input { margin-top: 2px; accent-color: var(--blue); }
.check .name { font-weight: 600; color: var(--ink); font-size: 12.5px; }
.check .sub { color: var(--muted); font-size: 11.5px; }
.check.locked { background: var(--soft); cursor: default; }

.dropzone {
  display: block;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 16px;
  text-align: center; background: var(--soft); cursor: pointer;
}
.dropzone:hover { border-color: var(--blue); background: var(--blue-soft); }
.dropzone strong { display: block; color: var(--ink); font-size: 12.5px; }
.dropzone span { color: var(--muted); font-size: 11.5px; }
.dropzone input { display: none; }
.upload-row {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: #fff;
}
.upload-row img { width: 56px; height: 40px; object-fit: contain; background: var(--soft); border-radius: 6px; border: 1px solid var(--line); }
.upload-row .meta { flex: 1; min-width: 0; }
.upload-row .meta strong { display: block; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row .meta span { font-size: 11.5px; color: var(--green); }

.qty-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.qty-presets button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600; color: var(--muted);
}
.qty-presets button.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

.rules-box {
  margin: 0 16px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft);
  padding: 10px 12px;
}
.rules-box .title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.rules-box ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rules-box li { font-size: 12px; color: var(--text); display: flex; gap: 8px; align-items: flex-start; }
.rules-box li .k {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; background: #fff; border: 1px solid var(--line); color: var(--muted); margin-top: 1px;
}
.rules-box li .k.show { color: var(--green); border-color: #bfe3d5; }
.rules-box li .k.block { color: var(--red); border-color: #f2c4bf; }
.rules-box li .k.moq { color: var(--amber); border-color: #f1dcb4; }
.rules-box li .k.lead { color: var(--purple); border-color: #d6d2ec; }
.rules-box li .k.fixed { color: var(--dim); }

.step-foot {
  border-top: 1px solid var(--line); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.step-foot .counter { font-size: 12px; color: var(--muted); }

/* ---------- Summary panel ---------- */
.summary { position: sticky; top: calc(var(--topbar-h) + 16px); align-self: start; }
.summary-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.summary-head .t { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.summary-head .s { font-size: 11.5px; color: var(--muted); }
.stat-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12.5px; }
.stat .k { color: var(--muted); }
.stat .v { font-weight: 600; color: var(--ink); text-align: right; }
.stat.big { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.stat.big .v { font-size: 18px; font-weight: 800; color: var(--navy); }
.stat .v .sub { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.stat .v.price-hidden { color: var(--muted); font-weight: 500; font-size: 12px; }
.moq-note { margin: 0 16px; font-size: 12px; padding: 8px 10px; border-radius: 8px; }
.moq-note.ok { background: var(--green-soft); color: var(--green); }
.moq-note.warn { background: var(--amber-soft); color: var(--amber); }
.summary-actions { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.summary-actions .saved { font-size: 11.5px; color: var(--muted); text-align: center; }
.spec-list { border-top: 1px solid var(--line); padding: 12px 16px; }
.spec-list .title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.spec-list dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; color: var(--ink); font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Staff view ---------- */
.staff {
  max-width: 1600px; margin: 0 auto; padding: 16px 20px 24px;
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
.staff-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.staff-tabs .spacer { flex: 1; }
.staff-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.queue-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.queue-head .t { font-weight: 700; color: var(--ink); }
.queue-list { display: flex; flex-direction: column; }
.req-card {
  border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.req-card:last-child { border-bottom: 0; }
.req-card:hover { background: var(--soft); }
.req-card.active { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.req-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.req-card .id { font-size: 11px; font-weight: 700; color: var(--dim); letter-spacing: 0.04em; }
.req-card .name { font-weight: 600; color: var(--ink); font-size: 13px; }
.req-card .meta { font-size: 11.5px; color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }

.detail-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.detail-head h2 { margin: 0; font-size: 16px; color: var(--ink); }
.detail-head .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.detail-body { padding: 16px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.detail-body .full { grid-column: 1 / -1; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 12px 14px;
}
.card .card-title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card.soft { background: var(--soft); }
.mini-preview { background: radial-gradient(ellipse at 50% 30%, #fff, #eef1f5); border-radius: 8px; border: 1px solid var(--line); }
.mini-preview svg { width: 100%; height: 240px; }

.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table td .sub { display: block; font-size: 11px; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; font-size: 12px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 4px; }
.timeline .dot.grey { background: var(--dim); }
.timeline .dot.green { background: var(--green); }
.timeline .dot.amber { background: var(--amber); }
.timeline .dot.purple { background: var(--purple); }
.timeline .when { color: var(--dim); font-size: 11px; }
.timeline .note { color: var(--muted); }

.pipeline { display: flex; align-items: center; gap: 0; flex-wrap: wrap; row-gap: 6px; }
.pipeline .stage {
  font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
}
.pipeline .stage.done { color: var(--green); border-color: #bfe3d5; background: var(--green-soft); }
.pipeline .stage.current { color: #fff; background: var(--navy); border-color: var(--navy); }
.pipeline .arrow { color: var(--dim); font-size: 11px; padding: 0 5px; }

.price-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-edit label { font-size: 11px; color: var(--muted); font-weight: 600; display: block; margin-bottom: 4px; }
.kpi { font-size: 20px; font-weight: 800; color: var(--navy); }
.kpi small { font-size: 11px; font-weight: 500; color: var(--muted); display: block; }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.toggle-list { display: flex; flex-direction: column; gap: 6px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .k { color: var(--ink); font-weight: 500; }
.toggle-row .k small { color: var(--muted); display: block; font-size: 11px; font-weight: 400; }
.switch { position: relative; width: 36px; height: 20px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background 0.12s; cursor: pointer;
}
.switch span::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform 0.12s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------- Drawer / modal / toast ---------- */
.backdrop {
  position: fixed; inset: 0; background: rgba(16, 37, 67, 0.4); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(520px, 100%); background: #fff; z-index: 60;
  box-shadow: -8px 0 40px rgba(16,37,67,0.18); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.2s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.drawer-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.drawer-body { padding: 16px 18px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.req-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.req-item .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.req-item .name { font-weight: 700; color: var(--ink); }
.req-item .meta { font-size: 12px; color: var(--muted); }
.req-item .staff-note { margin-top: 8px; font-size: 12px; background: var(--amber-soft); color: var(--amber); padding: 7px 9px; border-radius: 7px; }
.req-item .staff-note.ok { background: var(--green-soft); color: var(--green); }
.versions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.req-item .actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

.modal {
  background: #fff; border-radius: var(--radius-lg); width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(16,37,67,0.3);
}
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.modal-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.icon-btn { border: 0; background: transparent; font-size: 20px; color: var(--muted); line-height: 1; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
pre.json {
  margin: 0; background: #0f1a2b; color: #d7e3f4; padding: 14px; border-radius: 8px; font-size: 11.5px; line-height: 1.5;
  overflow: auto; max-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(16,37,67,0.3); z-index: 80; transition: opacity 0.15s, transform 0.15s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .builder { grid-template-columns: 1fr 1fr; }
  .summary { grid-column: 1 / -1; position: static; }
  .panel.preview { min-height: 560px; }
  .stat-list { display: grid; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .builder { grid-template-columns: 1fr; padding: 12px; }
  .panel.preview { position: static; height: auto; min-height: 0; }
  .preview-canvas { min-height: 420px; }
  .staff-grid, .detail-body { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .brand-sub { display: none; }
  .stat-list { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .cat-tabs, .steps, .step-foot, .summary-actions, .preview-foot { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; }
}
