:root {
  --bg: #f3f3f2;
  --card: #ffffff;
  --ink: #1d2328;
  --ink-2: #4a545d;
  --muted: #7a848d;
  --line: #e2e2e0;
  --brand: #e8781a;
  --accent: #c25e0c;
  --accent-ink: #ffffff;
  --accent-soft: #fdf1e6;
  --dark: #3f4144;
  --ok: #2f7a4f;
  --ok-soft: #e6f2ea;
  --warn: #9a6a12;
  --warn-soft: #fbf1dc;
  --err: #b0392f;
  --err-soft: #fbe8e6;
  --info-soft: #e8eef3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 28, .04), 0 4px 16px rgba(20, 24, 28, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1, h2, .cfg-title, .price-big { font-family: Poppins, Inter, system-ui, sans-serif; font-weight: 600; }
h1 { font-size: 28px; letter-spacing: -.01em; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 22px 0 10px; }
a { color: inherit; }
button { font: inherit; color: inherit; }
input, textarea {
  font: inherit; color: var(--ink); width: 100%; padding: 10px 12px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
select {
  font: inherit; color: var(--ink); padding: 10px 12px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 14px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.err { color: var(--err); font-size: 14px; margin: 4px 0; }

.demo-bar { background: #2a2b2d; color: #cfd0d2; text-align: center; font-size: 12.5px; padding: 6px 12px; }
.site-head { background: var(--dark); border-bottom: 3px solid var(--brand); margin-bottom: 18px; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1200px; margin: 0 auto; padding: 10px 20px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 64px; width: auto; display: block; }
.brand small { font-weight: 500; font-size: 12px; color: #b9bbbe; border-left: 1px solid #66686c; padding-left: 14px; text-transform: uppercase; letter-spacing: .08em; }
#nav { display: flex; align-items: center; gap: 18px; font-size: 14px; flex-wrap: wrap; justify-content: flex-end; }
.nav-user { color: #c9cbce; }
.nav-link { text-decoration: none; font-weight: 600; color: #fff; text-transform: uppercase; font-size: 13px; letter-spacing: .04em; }
.nav-link:hover { color: var(--brand); }
.site-head .btn-link { color: #e4e5e6; }
.site-head .btn-link:hover { color: var(--brand); }
.foot { color: var(--muted); font-size: 12.5px; padding-top: 40px; padding-bottom: 32px; }
.foot a { color: var(--ink-2); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #ece9e3; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 14.5px; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #a84f08; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn-link { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--accent); }
.btn-link.danger { color: var(--err); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.st-draft { background: #eeece8; color: var(--ink-2); }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-approved { background: var(--ok-soft); color: var(--ok); }
.st-rejected { background: var(--err-soft); color: var(--err); }

.banner { padding: 14px 16px; border-radius: 10px; margin: 0 0 18px; font-size: 14.5px; }
.banner.ok { background: var(--ok-soft); color: #1f5236; }
.banner.info { background: var(--info-soft); color: #2b4153; }
.banner.warn { background: var(--warn-soft); color: #6b4a0c; }

/* hero / login */
.hero { display: grid; grid-template-columns: 1.25fr .9fr; gap: 40px; align-items: start; padding: 28px 0 10px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px; }
.hero h1 { font-size: 38px; max-width: 14em; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 34em; }
.hero-steps { padding-left: 20px; color: var(--ink-2); }
.hero-steps li { margin: 6px 0; }
.refs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0 8px; }
.refs figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 5; background: #ddd; }
.refs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.refs figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; color: #fff; font-size: 12.5px; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.login { padding: 26px; }
.login h2 { margin-bottom: 4px; }

/* dashboard */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 20px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.back { display: inline-block; text-decoration: none; color: var(--ink-2); font-size: 14px; margin: 6px 0 8px; }
.back:hover { color: var(--accent); }
.quote-list { display: grid; gap: 12px; }
.quote-card { display: grid; grid-template-columns: 230px 1fr auto; gap: 20px; align-items: center; padding: 16px 20px; text-decoration: none; transition: border-color .15s; }
.quote-card:hover { border-color: var(--accent); }
.quote-card h3 { margin: 4px 0 2px; }
.quote-card p { margin: 0; font-size: 13.5px; }
.qc-thumbs { display: flex; gap: 6px; align-items: flex-end; min-height: 80px; }
.qc-thumbs svg { width: 70px; height: 80px; }
.qc-top { display: flex; gap: 10px; align-items: center; }
.qc-id { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.qc-total { text-align: right; display: grid; }
.qc-total b { font-size: 19px; }
.empty { padding: 40px; text-align: center; }

/* quote */
.title-input { font-size: 26px; font-weight: 700; border: 1px dashed transparent; padding: 4px 8px; margin: 4px 0 0 -8px; background: transparent; }
.title-input:hover { border-color: var(--line); }
.quote-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.pos-list { padding: 4px 0; }
.pos-row { display: grid; grid-template-columns: 120px 1fr 150px; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: center; }
.pos-row:last-child { border-bottom: 0; }
.pos-row.has-err { background: #fffafa; }
.pos-thumb svg { width: 120px; height: 130px; display: block; }
.pos-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.pos-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.pos-spec { color: var(--ink-2); font-size: 13.5px; margin: 6px 0; }
.pos-actions { display: flex; gap: 16px; }
.pos-price { text-align: right; display: grid; gap: 2px; }
.pos-price b { font-size: 18px; }
.pos-price .muted { font-size: 13px; }
.add-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.bulk-icon { display: flex; align-items: flex-end; gap: 3px; flex: none; }
.add-btn .bulk-icon svg { width: 30px; height: 40px; }
.banner-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* quick table entry */
.bulk-shared { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 16px; padding: 18px 20px 4px; margin-bottom: 14px; }
.bulk-shared select { width: 100%; }
label.check { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 12px; }
label.check input { width: auto; margin: 0; }
.bulk-card { padding: 6px 0 0; }
.bulk-scroll { overflow-x: auto; }
table.bulk { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
table.bulk th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 6px; border-bottom: 1px solid var(--line); }
table.bulk td { padding: 6px; vertical-align: middle; }
table.bulk tr[data-row] td { border-top: 1px solid #f0ede8; }
table.bulk tr[data-row]:first-child td { border-top: 0; }
table.bulk th:first-child, table.bulk td:first-child { padding-left: 18px; }
table.bulk input, table.bulk select { margin: 0; padding: 8px 9px; font-size: 14px; }
table.bulk input[type=number] { width: 92px; }
table.bulk input.qty { width: 64px; }
table.bulk select { width: 100%; min-width: 150px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table.bulk td.thumb svg { width: 48px; height: 48px; display: block; }
table.bulk .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.bulk-err { display: none; }
tr.bulk-err.show { display: table-row; }
tr.bulk-err td { padding: 0 6px 8px 70px; font-size: 13px; }
.warn-text { color: var(--warn); }
.bulk-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); }
.bulk-paste { padding: 0 18px 18px; }
.bulk-paste textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.bulk-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; margin-top: 14px; position: sticky; bottom: 12px; }
.add-btn {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; text-align: left; cursor: pointer;
  background: var(--card); border: 1.5px dashed #cfc9bf; border-radius: var(--radius); transition: border-color .15s, background .15s;
}
.add-btn:hover { border-color: var(--brand); background: #fffaf5; }
.add-btn svg { width: 64px; height: 84px; flex: none; }
.add-btn b { display: block; font-size: 16px; }
.add-btn small { color: var(--muted); }
.add-row.big .add-btn { padding: 28px; }
.summary { padding: 20px; position: sticky; top: 16px; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0 0 14px; font-size: 14.5px; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { font-weight: 700; font-size: 17px; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; }
.summary .btn-link { display: block; margin: 14px auto 0; }

/* configurator */
.cfg { display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: start; }
.cfg-main { padding: 22px 24px; min-width: 0; }
.cfg-title { font-size: 22px; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 22px; flex-wrap: wrap; }
.step-chip {
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #faf9f7; border-radius: 99px;
  padding: 5px 12px 5px 6px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.step-chip span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e9e6e0; font-size: 11px; font-weight: 700; }
.step-chip.done span { background: var(--ok-soft); color: var(--ok); }
.step-chip.on { border-color: var(--brand); color: var(--ink); background: var(--accent-soft); }
.step-chip.on span { background: var(--brand); color: #fff; }
.step-body { min-height: 300px; }
.step-body > p { margin-top: 0; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.choices.col { grid-template-columns: 1fr; }
.choices.grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.choices.icons .choice { align-items: center; text-align: center; }
.choices.swatches { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .12s, background .12s;
}
.choice:hover:not(:disabled) { border-color: #e9b98d; }
.choice.on { border-color: var(--brand); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice:disabled { opacity: .4; cursor: not-allowed; }
.choice svg { width: 100%; max-width: 100px; height: 100px; margin-bottom: 4px; }
.c-label { font-weight: 600; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.c-sub { font-size: 12.5px; color: var(--muted); }
.choices.swatches .choice { display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; row-gap: 0; align-items: center; }
.choices.swatches .swatch { grid-row: span 2; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); flex: none; }

.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.num-wrap { display: flex; align-items: center; gap: 8px; }
.num-wrap span { color: var(--muted); margin-top: 6px; }
.num small { display: block; margin-top: 4px; font-weight: 400; }
.info { background: var(--info-soft); color: #2b4153; padding: 12px 14px; border-radius: 9px; font-size: 14px; margin: 14px 0 0; }
.spec { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.spec th { text-align: left; font-weight: 500; color: var(--muted); padding: 7px 12px 7px 0; width: 130px; vertical-align: top; }
.spec td { padding: 7px 0; border-bottom: 1px solid var(--line); }

.cfg-side { position: sticky; top: 16px; display: grid; gap: 14px; }
.preview { padding: 16px 16px 8px; background: linear-gradient(#fbfaf8, #f3f1ec); }
.preview svg { width: 100%; height: auto; display: block; max-height: 460px; }
.preview p { margin: 4px 0 6px; }
.price-box { padding: 18px 20px; }
.price-head { display: grid; gap: 2px; }
.price-big { font-size: 32px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.msg { font-size: 13.5px; padding: 9px 12px; border-radius: 8px; margin: 10px 0 0; }
.msg.err { background: var(--err-soft); color: var(--err); }
.msg.tip { background: var(--warn-soft); color: #6b4a0c; }
.msg.warn { background: var(--warn-soft); color: #6b4a0c; }
.breakdown { margin-top: 14px; font-size: 13.5px; }
.breakdown summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.breakdown table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.breakdown td { padding: 5px 0; border-bottom: 1px solid #f0ede8; }
.breakdown td:last-child { text-align: right; white-space: nowrap; padding-left: 10px; font-variant-numeric: tabular-nums; }
.breakdown tr.sub td { font-weight: 600; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 30px; }
  .quote-layout, .cfg { grid-template-columns: 1fr; }
  .add-row { grid-template-columns: 1fr 1fr; }
  .summary, .cfg-side { position: static; }
  .cfg-side { order: -1; grid-template-columns: 1fr 1fr; }
  .quote-card { grid-template-columns: 1fr auto; }
  .qc-thumbs { display: none; }
}
@media (max-width: 640px) {
  .wrap, .top { padding-left: 16px; padding-right: 16px; }
  .brand small { display: none; }
  .brand img { height: 48px; }
  .refs { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .refs figcaption { font-size: 11px; padding: 16px 6px 6px; }
  h1 { font-size: 23px; }
  .cfg-side { grid-template-columns: 1fr; }
  .preview svg { max-height: 240px; }
  .cfg-main { padding: 18px 16px; }
  .add-row { grid-template-columns: 1fr; }
  .bulk-foot .btn { width: 100%; }
  .pos-row { grid-template-columns: 84px 1fr; padding: 14px 16px; gap: 12px; }
  .pos-thumb svg { width: 84px; height: 96px; }
  .pos-price { grid-column: 2; text-align: left; }
  .title-input { font-size: 21px; }
}
.step-body .choices + label { margin-top: 18px; }

.plan-teaser { display: block; margin-top: 14px; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; background: #fff; text-decoration: none; max-width: 650px; }
.plan-teaser b { display: block; color: var(--ink); }
.plan-teaser span { color: var(--muted); font-size: 13.5px; }
.plan-teaser:hover { border-color: var(--brand); }
