:root {
  --ink: #152A4A;
  --ink-soft: #5a6578;
  --navy: #152A4A;
  --navy-deep: #0f1e36;
  --forest: #152A4A;
  --forest-deep: #0f1e36;
  --moss: #1e3a63;
  --leaf: #2a4d7a;
  --gold: #D4A017;
  --brass: #D4A017;
  --brass-light: #e3bf55;
  --cream: #F4EFE6;
  --paper: #f7f6f3;
  --line: #e2e0db;
  --ok: #2f6b4f;
  --warn: #b7791f;
  --alert: #9b3b2e;
  --shadow: 0 18px 50px rgba(15, 30, 54, 0.12);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "Poppins", "Outfit", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
h1, h2, h3, .serif { font-family: "Poppins", system-ui, sans-serif; font-weight: 500; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; }
.check-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  line-height: 1.45;
}
.check-block input { margin-top: 3px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* LOGIN */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}
.login-visual {
  position: relative;
  background: var(--forest-deep) url("assets/hero-living.jpg") center/cover no-repeat;
}
.login-visual::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,30,54,.35) 0%, rgba(15,30,54,.84) 100%);
}
.login-visual-copy {
  position: absolute; left: 48px; right: 48px; bottom: 48px; z-index: 1; color: #f7f2ea;
}
.login-visual-copy .eyebrow {
  letter-spacing: .18em; text-transform: uppercase; font-size: 12px; color: var(--brass-light);
}
.login-visual-copy h1 { font-size: 52px; line-height: 1.05; margin: 12px 0 16px; max-width: 520px; }
.login-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 64px; background: var(--paper);
}
.mark {
  display: flex; align-items: center; gap: 12px; margin-bottom: 36px;
}
.topbar .mark { cursor: pointer; }
.mark-slats {
  width: 34px; height: 28px; display: flex; flex-direction: column; justify-content: space-between; flex-shrink: 0;
}
.mark-slats span { display: block; height: 6px; background: var(--gold); border-radius: 1px; }
.mark strong { display: block; font-size: 18px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--navy); line-height: 1.1; }
.mark em { display: block; font-style: normal; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }
.mark span { font-size: 12px; color: var(--ink-soft); }
.login-panel h2 { font-size: 34px; margin-bottom: 8px; }
.login-panel p.lede { color: var(--ink-soft); margin-bottom: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 15px; color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }
.btn {
  border: 0; border-radius: 999px; padding: 13px 22px; cursor: pointer;
  font-size: 14px; letter-spacing: .04em; font-weight: 500;
}
.btn-primary { background: var(--forest); color: #f7f2ea; }
.btn-primary:hover { background: var(--moss); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-brass { background: var(--brass); color: #1a1408; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { margin-top: 18px; font-size: 13px; color: var(--ink-soft); background: #eeebe4; padding: 12px 14px; border-radius: 12px; }
.error { color: var(--alert); font-size: 13px; margin-bottom: 10px; }

/* TOP BAR */
.topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 20;
  gap: 12px;
}
.nav-drop { position: relative; display: flex; align-items: center; }
.nav { display: flex; gap: 6px; }
.nav button {
  background: transparent; border: 0; padding: 8px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-soft);
}
.nav button.active, .nav button:hover { background: var(--cream); color: var(--ink); }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--forest); color: #fff;
  display: grid; place-items: center; font-size: 12px;
}

.page { padding: 32px 36px 72px; max-width: 1280px; margin: 0 auto; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.page-head h1 { font-size: 36px; }
.page-head p { color: var(--ink-soft); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
}
.stat span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.stat strong { display: block; font-family: "Poppins", sans-serif; font-weight: 500; font-size: 30px; margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 22px; margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 12px 6px; border-bottom: 1px solid #efe8dc; vertical-align: middle; }
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; letter-spacing: .04em;
}
.badge-draft { background: #eeebe4; }
.badge-sent { background: #f3e4b8; }
.badge-ordered,.badge-accepted,.badge-production { background: #d5e4da; color: var(--ok); }
.badge-shipped { background: #d7e3ee; }
.badge-delivered { background: #dceadf; }
.badge-hold { background: #f0d7d2; color: var(--alert); }

.catalog { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.product {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.product img { width: 100%; height: 220px; object-fit: cover; display: block; }
.product-body { padding: 18px 20px 22px; }
.product-body h3 { font-size: 24px; margin-bottom: 6px; }
.product-body p { color: var(--ink-soft); font-size: 14px; margin-bottom: 14px; }
.price-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.price-line strong { font-family: "Poppins", sans-serif; font-weight: 500; font-size: 26px; }
.price-line span { font-size: 13px; color: var(--ink-soft); }

.wizard-steps {
  display: flex; justify-content: center; gap: 0; margin: 8px 0 28px; list-style: none;
}
.wizard-steps li {
  display: flex; flex-direction: column; align-items: center; min-width: 88px; position: relative;
  font-size: 12px; color: var(--ink-soft);
}
.wizard-steps li + li::before {
  content: ""; position: absolute; left: -50%; top: 14px; width: 100%; height: 2px; background: var(--line); z-index: 0;
}
.wizard-steps .dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; margin-bottom: 6px; position: relative; z-index: 1;
}
.wizard-steps li.on .dot { background: var(--navy); color: #fff; border-color: var(--navy); }
.wizard-steps li.done .dot { background: var(--ok); color: #fff; border-color: var(--ok); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.pick-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; text-align: left;
}
.pick-card:hover, .pick-card.on { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(21,42,74,.12); }
.pick-card img {
  width: 100%; height: 110px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; display: block;
}
.pick-swatch {
  width: 100%; height: 120px; border-radius: 12px; margin-bottom: 10px;
  background: #eceae4; display: flex; align-items: center; justify-content: center;
}
.pick-swatch svg { width: 92px; height: 74px; display: block; overflow: visible; }
.pick-card h3 { font-size: 16px; margin-bottom: 4px; }
.pick-card p { font-size: 13px; color: var(--ink-soft); }
.spec-acc { border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.spec-acc > summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; font-size: 13px; background: #f3f1ec;
}
.spec-acc > summary::-webkit-details-marker { display: none; }
.spec-acc .acc-body { padding: 14px 16px 18px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.opt {
  border: 1px solid var(--line); border-radius: 12px; background: #f7f6f3; padding: 10px 8px; text-align: center;
  cursor: pointer; font-size: 12px; min-height: 88px;
}
.opt.on { outline: 2px solid var(--navy); background: #fff; }
.opt svg { width: 56px; height: 44px; display: block; margin: 0 auto 6px; }
.sides { display: grid; grid-template-columns: 80px 80px 80px; justify-content: center; gap: 8px; text-align: center; margin: 12px 0; }
.sides .mid { grid-column: 2; }
.side-tog { display: inline-flex; gap: 4px; }
.side-tog button { border: 0; border-radius: 8px; padding: 4px 8px; font-size: 12px; }
.side-tog button.on { background: var(--ok); color: #fff; }

.configure {
  display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.summary {
  background: var(--forest-deep); color: #f4efe6; border-radius: var(--radius); padding: 24px;
  position: sticky; top: 92px;
}
.summary h3 { color: #fff; margin-bottom: 8px; }
.summary .muted { color: #c9d5ce; font-size: 13px; margin-bottom: 18px; }
.row-line { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.total { font-family: "Poppins", sans-serif; font-weight: 500; font-size: 36px; margin: 16px 0 18px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; outline: 1px solid #d7ccbb; cursor: pointer;
}
.swatch.selected { outline: 2px solid var(--forest); }

.quote-list { display: flex; flex-direction: column; gap: 12px; }
.quote-item {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  display: grid; grid-template-columns: 1.2fr .7fr .7fr .8fr auto; gap: 12px; align-items: center;
}
.quote-item button { white-space: nowrap; }

.hidden { display: none !important; }
.linkish { background: none; border: 0; color: var(--moss); cursor: pointer; text-decoration: underline; font-size: 13px; }

.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--line); }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brass);
}
.timeline li:last-child { border-left-color: transparent; }

.apply-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.section-label {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 8px 0 12px;
}
.hardware-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 28px;
}
.hw-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; display: grid; grid-template-columns: 48px 1fr; gap: 14px;
}
.hw-mark {
  width: 48px; height: 48px; border-radius: 12px; background: var(--navy); color: var(--gold);
  display: grid; place-items: center; font-weight: 600; font-size: 18px; flex-shrink: 0;
}
.hw-kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.hw-card h3 { font-size: 18px; margin-bottom: 6px; }
.hw-card p { color: var(--ink-soft); font-size: 13px; margin-bottom: 10px; }
.hw-spec { list-style: none; font-size: 13px; color: var(--ink); margin: 0 0 12px; }
.hw-spec li { padding: 3px 0 3px 14px; position: relative; }
.hw-spec li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.nav-toggle {
  display: none;
  background: var(--cream);
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  gap: 8px;
}
.nav-toggle::after { content: "▾"; font-size: 11px; opacity: .7; }
.nav-toggle[aria-expanded="true"]::after { content: "▴"; }
.toast {
  position: fixed; top: 18px; right: 18px; z-index: 80;
  background: var(--navy); color: #f7f2ea;
  padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 14px;
}
.sub { color: var(--ink-soft); font-size: 13px; }
.order-no { font-size: 20px; font-weight: 600; letter-spacing: 0.02em; }
.click-row { cursor: pointer; }
.click-row:hover td { background: var(--cream); }
.row-line.ink { border-bottom: 1px solid var(--line); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--cream); padding: 1px 6px; border-radius: 6px; }
.qty-row { display: flex; gap: 8px; align-items: center; }
.qty-row input { width: 72px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.btn.light { color: #f4efe6; border-color: rgba(255,255,255,.25); }
input.num { width: 100px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
table input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
#dealer-filter { border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: #fff; }
.app-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.app-card h3 { margin-bottom: 8px; }

@media (max-width: 1100px) {
  .login-wrap, .grid-2, .configure, .catalog, .hardware-grid, .stats, .quote-item, .apply-grid, .app-list { grid-template-columns: 1fr; }
  .login-visual { min-height: 240px; }
  .login-visual-copy { left: 24px; right: 24px; bottom: 24px; }
  .login-visual-copy h1 { font-size: 34px; }
  .login-panel { padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); }
  .page { padding: 18px 16px calc(88px + env(safe-area-inset-bottom)); }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head h1 { font-size: 28px; }
  .topbar { height: auto; min-height: 64px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); flex-wrap: wrap; }
  .who { font-size: 13px; }
  .who #who-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-toggle { display: inline-flex; min-height: 44px; align-items: center; }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    flex-direction: column;
    padding: 8px;
    z-index: 40;
  }
  .nav.open { display: flex; }
  .nav button { min-height: 44px; text-align: left; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: 1; }
  .field input, .field select, .field textarea, .btn {
    font-size: 16px;
    min-height: 44px;
  }
  .btn-row { width: 100%; }
  .btn-row .btn { flex: 1 1 160px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .summary { position: static; }
  .sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 15;
    margin: 16px -20px -8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #152A4A;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .toast { left: 12px; right: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .check-block { font-size: 15px; }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
  .login-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .login-visual { min-height: 180px; }
  .login-visual-copy h1 { font-size: 26px; }
  .mark { margin-bottom: 20px; }
}
