:root {
  --bg: #f7f7f6;
  --panel: #ffffff;
  --ink: #17191f;
  --muted: #626875;
  --line: #dedede;
  --line-soft: #ececec;
  --black: #17191c;
  --orange: #ff6b00;
  --orange-soft: #fff1e7;
  --danger: #f05a28;
  --shadow: 0 14px 34px rgba(18, 20, 26, .09);
  --radius: 10px;
  --font: Poppins, Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  font-size: 14px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 22px;
  border-right: 1px solid #e7e7e7;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand { margin-bottom: 34px; padding-left: 4px; }
.brand-logo { width: 162px; position: relative; line-height: 1; }
.brand-logo strong { display: block; font-size: 34px; letter-spacing: -0.11em; font-weight: 800; transform: scaleX(1.08); transform-origin: left; }
.brand-logo small { display: block; margin-top: 0; font-size: 20px; font-style: italic; letter-spacing: -0.05em; color: #36363a; }
.brand-dots { position: absolute; top: -7px; left: 84px; display: flex; gap: 4px; }
.brand-dots i { width: 7px; height: 7px; background: var(--orange); border-radius: 999px; display: block; }
.nav { display: grid; gap: 10px; }
.nav-link {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: #343842;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 8px;
  padding: 0 12px;
  position: relative;
  font-weight: 600;
  text-align: left;
}
.nav-link .icon { width: 22px; height: 22px; display: grid; place-items: center; color: #525864; font-size: 21px; line-height: 1; }
.nav-link:hover { background: #f3f3f3; }
.nav-link.active { background: #f5f5f4; color: #15171b; }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 8px;
  width: 5px;
  height: 28px;
  background: var(--orange);
  border-radius: 0 999px 999px 0;
}
.user-chip {
  margin-top: auto;
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 46px;
  display: grid;
  grid-template-columns: 36px 1fr 14px;
  gap: 10px;
  align-items: center;
  text-align: left;
  color: var(--ink);
  border-radius: 10px;
  padding: 4px 4px;
}
.user-chip:hover { background: #f7f7f7; }
.user-chip span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--orange); background: var(--orange-soft); font-weight: 800; font-size: 12px; }
.user-chip b { font-weight: 650; font-size: 13px; }
.user-chip em { font-style: normal; color: #5f6570; }
.logout-chip {
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b1111;
  border-radius: 10px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 13px;
}
.logout-chip:hover { background: #fff4f2; }
.logout-chip svg, .logout-chip i { width: 16px; height: 16px; }

.main { min-width: 0; padding: 26px 34px 44px; overflow: visible; }
.view { display: none; max-width: 1260px; margin: 0 auto; }
.view.active { display: block; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 2px; color: var(--orange); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
h1 { margin: 0; font-size: clamp(28px, 3.2vw, 39px); line-height: 1.02; letter-spacing: -0.055em; font-weight: 850; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 650;
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  line-height: 1;
  text-decoration: none;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.button.accent { color: #fff; border-color: var(--orange); background: linear-gradient(180deg, #ff7b18, #f26300); }
.button.ghost { background: #fff; }
.small-button { border: 1px dashed #cfcfcf; background: #fff; color: #252930; min-height: 34px; border-radius: 8px; font-weight: 650; padding: 0 12px; display:inline-flex; align-items:center; justify-content:center; gap:8px; text-align:center; line-height:1; }

.quote-page { position: relative; }
.quote-meta-card {
  border: 1px solid #dadada;
  border-top: 4px solid var(--orange);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(260px, 1.55fr) minmax(130px, .55fr) minmax(240px, 1fr) minmax(220px, .85fr);
  gap: 0;
  overflow: hidden;
  margin-bottom: 14px;
}
.meta-block { padding: 0 22px; border-left: 1px solid var(--line-soft); min-height: 116px; }
.meta-block:first-child { border-left: 0; padding-left: 0; }
.meta-block label { display: block; color: #292d33; font-size: 11px; font-weight: 750; margin: 0 0 6px; }
.meta-block strong, .meta-block span { display: block; line-height: 1.35; color: #111318; }
.meta-block strong { font-weight: 760; margin-bottom: 14px; }
.meta-block span { margin-bottom: 14px; }
.meta-block em { display: inline; font-style: normal; margin: 0 7px; color: #777; }
.meta-block.compact { display: grid; grid-template-columns: 1fr; align-content: start; }
.date-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 0; margin-top: 18px; }
.date-split > div + div { border-left: 1px solid var(--line-soft); padding-left: 20px; }
.date-split label { margin-top: 0; }
.notes span { max-width: 240px; }
.quote-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.edit-only { display: none; }
.edit-mode .edit-only { display: flex; }

.quote-sections { display: grid; gap: 8px; }
.quote-section {
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.035);
}
.section-bar {
  min-height: 27px;
  background: linear-gradient(180deg, #202227, #15171b);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--orange);
}
.section-bar [data-editable="section-title"] { min-width: 120px; }
.section-actions { display: none; gap: 6px; }
.edit-mode .section-actions { display: flex; }
.tiny-action { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; border-radius: 5px; min-height: 22px; padding: 0 8px; font-size: 11px; font-weight: 800; }
.tiny-action.danger { color: #ffd7ca; }
.quote-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.quote-table th {
  height: 27px;
  background: #fbfbfb;
  border-bottom: 1px solid var(--line);
  color: #14171b;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}
.quote-table td {
  min-height: 28px;
  border-bottom: 1px solid #eeeeee;
  color: #1c2026;
  font-size: 12px;
  font-weight: 520;
  vertical-align: middle;
  padding: 7px 12px;
}
.quote-table tr:hover td { background: #fffdfb; }
.quote-table th:nth-child(n+3), .quote-table td:nth-child(n+3) { text-align: right; }
.quote-table .desc { color: #30343c; text-align: left !important; }
.quote-item-select,
.quote-item-type-select {
  width: 100%;
  min-height: 28px;
  border: 1px solid rgba(255,107,0,.34);
  border-radius: 6px;
  background: #fff;
  color: #1c2026;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 26px 3px 8px;
  outline: 0;
}
.quote-item-select:focus,
.quote-item-type-select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 18%, transparent);
}
.quote-table td:has(.quote-item-select),
.quote-table td:has(.quote-item-type-select) {
  padding: 4px 7px;
}
.quote-table .desc .quote-item-select { text-align: left; }
.quote-table .delete-cell { width: 42px; display: none; }
.edit-mode .quote-table .delete-cell { display: table-cell; }
.delete-row { border: 0; background: transparent; color: #a23a16; font-weight: 800; }
.section-subtotal { display: grid; grid-template-columns: 1fr minmax(190px, 260px) minmax(120px, 180px); margin-left: auto; border-left: 1px solid var(--line); }
.section-subtotal span, .section-subtotal strong { min-height: 28px; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; border-left: 1px solid var(--line); font-size: 12px; }
.section-subtotal span { font-weight: 850; background: #fff; }
.section-subtotal strong { font-weight: 800; background: #fff; }

.labor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.labor-grid .quote-table th, .labor-grid .quote-table td { padding-left: 9px; padding-right: 9px; font-size: 11px; }
.labor-grid .section-subtotal { grid-template-columns: 1fr 130px 105px; }
.labor-grid .quote-section { min-width: 0; }

.quote-summary {
  width: min(460px, 100%);
  margin: 8px 0 0 auto;
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  box-shadow: 0 3px 13px rgba(0,0,0,.04);
}
.quote-summary div { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; min-height: 30px; font-size: 15px; }
.quote-summary strong { font-size: 16px; }
.quote-summary .discount { color: var(--danger); }
.quote-summary .total { border-top: 1px solid var(--line); margin-top: 7px; padding-top: 7px; }
.quote-summary .total span { font-size: 18px; font-weight: 850; }
.quote-summary .total strong { font-size: 25px; font-weight: 800; letter-spacing: -0.04em; }

[data-editable] { border-radius: 4px; outline: 0; }
.edit-mode [data-editable] { box-shadow: inset 0 0 0 1px rgba(255,107,0,.26); background: #fff8f1; padding: 1px 3px; }
.edit-mode [data-editable]:focus { box-shadow: inset 0 0 0 2px var(--orange); background: #fff; }

.simple-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.mini-card, .empty-card, .table-card, .list-card, .settings-card {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}
.mini-card { padding: 20px; display: grid; gap: 10px; }
.mini-card span { color: var(--muted); font-weight: 700; }
.mini-card strong { font-size: 28px; letter-spacing: -0.04em; }
.empty-card { padding: 24px; }
.empty-card h2 { margin: 0 0 8px; }
.empty-card p { color: var(--muted); max-width: 620px; line-height: 1.5; }
.table-card { overflow: hidden; }
.table-card-head { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.table-card-head h2 { margin: 0 0 3px; }
.table-card-head p { margin: 0; color: var(--muted); }
.catalog-select-wrap { display: flex; gap: 8px; align-items: center; }
.catalog-select-wrap label { color: var(--muted); font-weight: 750; }
select, input { min-height: 36px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 10px; }
.sheet-scroll { overflow: auto; }
.catalog-table { width: 100%; border-collapse: collapse; min-width: var(--catalog-min, 900px); }
.catalog-table th, .catalog-table td { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); padding: 10px 12px; text-align: left; white-space: nowrap; font-size: 13px; }
.catalog-table th { background: #191b20; color: #fff; border-right-color: rgba(255,255,255,.14); font-weight: 800; }
.catalog-table td { background: #fff; }
.list-card { display: grid; gap: 0; overflow: hidden; }
.list-card div { padding: 18px 20px; border-bottom: 1px solid var(--line-soft); display: grid; gap: 4px; }
.list-card div:last-child { border-bottom: 0; }
.list-card span { color: var(--muted); }
.settings-card { padding: 22px; display: grid; gap: 14px; max-width: 520px; }

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.dashboard-metric,
.dashboard-panel {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}
.dashboard-metric {
  min-height: 132px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}
.dashboard-metric span,
.dashboard-panel-head span,
.dashboard-list-row small,
.dashboard-empty span,
.dashboard-status-row span {
  color: var(--muted);
}
.dashboard-metric span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.dashboard-metric strong {
  font-size: 29px;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.dashboard-metric small {
  color: #4d545f;
  font-size: 12px;
  font-weight: 750;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr);
  gap: 14px;
  margin-bottom: 14px;
}
.dashboard-layout.secondary {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.dashboard-panel {
  overflow: hidden;
}
.dashboard-panel-head {
  min-height: 56px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfbfb;
}
.dashboard-panel-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}
.dashboard-panel-head span {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.dashboard-list,
.dashboard-status-list {
  display: grid;
}
.dashboard-list-row {
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  text-align: left;
}
.dashboard-list-row:last-child,
.dashboard-status-row:last-child {
  border-bottom: 0;
}
.dashboard-list-row:not(.static):hover {
  background: #fffaf5;
}
.dashboard-list-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.dashboard-list-row strong,
.dashboard-list-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-list-row strong {
  font-size: 14px;
  font-weight: 850;
}
.dashboard-list-row small {
  font-size: 12px;
  font-weight: 700;
}
.dashboard-list-row b {
  font-size: 14px;
  font-weight: 850;
  justify-self: end;
}
.dashboard-list-row.static {
  cursor: default;
}
.dashboard-status-row {
  min-height: 68px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 10px;
}
.dashboard-status-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dashboard-status-row strong {
  font-size: 13px;
  font-weight: 850;
}
.dashboard-status-row span {
  font-size: 12px;
  font-weight: 750;
}
.dashboard-status-row i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #f0f0f0;
  overflow: hidden;
}
.dashboard-status-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
}
.dashboard-empty {
  min-height: 154px;
  padding: 22px;
  display: grid;
  place-content: center;
  gap: 5px;
  text-align: center;
}
.dashboard-empty strong {
  font-weight: 850;
}
.settings-card label { display: grid; gap: 6px; font-weight: 800; }
.settings-card span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.mobile-menu { display: none; position: fixed; top: 14px; left: 14px; z-index: 35; border: 1px solid var(--line); background: #fff; border-radius: 8px; min-height: 38px; padding: 0 12px; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.sidebar-scrim { display: none; }
.toast-region { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { background: #191b20; color: #fff; padding: 12px 14px; border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.16); font-weight: 750; animation: toastIn .18s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

@media print {
  body { background: #fff; }
  .sidebar, .mobile-menu, .header-actions, .quote-tools, .section-actions, .delete-cell, .eyebrow { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .view { display: none !important; max-width: none; }
  .view[data-panel="quotes"] { display: block !important; }
  .page-header { margin: 0 0 12px; }
  .quote-meta-card, .quote-section, .quote-summary { box-shadow: none; break-inside: avoid; }
  .quote-table td, .quote-table th { font-size: 10px; padding: 4px 7px; }
  .section-bar { min-height: 22px; padding: 3px 8px; }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 84px 1fr; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand-logo strong { font-size: 24px; }
  .brand-logo small, .nav-link span:not(.icon), .user-chip b, .user-chip em, .logout-chip span { display: none; }
  .brand-logo { width: auto; }
  .brand-dots { left: 56px; }
  .nav-link { justify-content: center; padding: 0; }
  .nav-link.active::before { left: -12px; }
  .user-chip { grid-template-columns: 1fr; justify-items: center; }
  .logout-chip { justify-content: center; padding: 4px; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-layout,
  .dashboard-layout.secondary { grid-template-columns: 1fr; }
  .quote-meta-card { grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .labor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .mobile-menu { display: block; }
  .sidebar { position: fixed; transform: translateX(-105%); transition: transform .2s ease; width: 250px; }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 15; }
  .main { padding: 70px 14px 30px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; }
  .button { flex: 1; }
  .quote-meta-card { grid-template-columns: 1fr; padding: 16px; }
  .meta-block { border-left: 0; border-top: 1px solid var(--line-soft); padding: 14px 0 0; min-height: unset; }
  .meta-block:first-child { border-top: 0; padding-top: 0; }
  .quote-section { overflow-x: auto; }
  .quote-table { min-width: 680px; }
  .simple-grid { grid-template-columns: 1fr; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .dashboard-list-row { grid-template-columns: 1fr; gap: 8px; }
  .dashboard-list-row b { justify-self: start; }
}

/* Client intake form builder */
.client-form-cta {
  border: 1px solid #e0dedb;
  background: linear-gradient(180deg, #fffdf9, #ffffff);
  border-left: 4px solid var(--orange);
  border-radius: 9px;
  padding: 12px 14px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.035);
}
.client-form-cta strong { display: block; font-size: 14px; margin-bottom: 3px; }
.client-form-cta span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.small-button.solid { border-style: solid; border-color: var(--orange); color: #fff; background: linear-gradient(180deg, #ff7b18, #f26300); }

.forms-layout {
  display: grid;
  grid-template-columns: minmax(360px, .85fr) minmax(480px, 1.15fr);
  gap: 14px;
  align-items: start;
}
.form-builder-card,
.client-form-card {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
  overflow: hidden;
}
.form-builder-card { padding: 18px; }
.client-form-card { padding: 0; }
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.card-heading h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.035em; }
.card-heading p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 13px; }
.status-badge {
  flex: 0 0 auto;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #f2f2f2;
  color: #3e424a;
  font-size: 12px;
  font-weight: 800;
}
.status-badge.ready { color: #955400; background: #fff2df; }
.status-badge.sent { color: #0d6f45; background: #e9fff4; }
.builder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.builder-grid label,
.message-field,
.form-input {
  display: grid;
  gap: 6px;
  font-weight: 800;
}
.builder-grid span,
.message-field span,
.form-input span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
textarea {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  resize: vertical;
  font: inherit;
}
.message-field { margin-top: 10px; }
.field-toolbar {
  margin: 17px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--orange);
  font-weight: 800;
  padding: 4px 6px;
}
.field-list {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}
.field-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 82px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid #ececec;
  border-radius: 8px;
  background: #fff;
}
.field-row.auto-field { background: #fbfbfb; }
.include-toggle,
.required-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
}
.include-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.required-toggle { color: #555c67; font-size: 12px; font-weight: 750; }
.field-row small { color: var(--muted); text-align: right; font-size: 11px; }
.link-box {
  margin-top: 14px;
  border: 1px solid #dedede;
  border-radius: 9px;
  background: #fafafa;
  padding: 12px;
  display: grid;
  gap: 4px;
}
.link-box span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.link-box strong { font-size: 13px; word-break: break-all; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }
.form-actions .button { flex: 1; }
.client-form-preview { padding: 18px; }
.client-form-title {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.client-form-title h3 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.035em; }
.client-form-title p { margin: 0; color: var(--muted); line-height: 1.45; }
.client-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-input b { color: var(--orange); }
.form-input input,
.form-input textarea {
  width: 100%;
  min-height: 38px;
}
.wide-input { grid-column: 1 / -1; }
.readonly-field {
  color: #606773;
  background: #f7f7f7;
}
.client-submit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.client-submit-row span { color: var(--muted); font-size: 12px; }
.empty-form-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.empty-form-state strong { display: block; color: var(--ink); margin-bottom: 4px; }
.form-responses-card { margin-top: 14px; }
.responses-table th,
.responses-table td { font-size: 12px; }
.empty-response { color: var(--muted); text-align: center !important; padding: 28px !important; }
.compact-actions { flex-wrap: wrap; justify-content: flex-end; }

@media print {
  .no-print, [data-panel="forms"] { display: none !important; }
}

@media (max-width: 1080px) {
  .forms-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .client-form-cta { flex-direction: column; align-items: stretch; }
  .builder-grid, .client-form-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; align-items: start; }
  .field-row small { text-align: left; }
  .form-actions, .client-submit-row { flex-direction: column; align-items: stretch; }
  .compact-actions { width: 100%; }
}

/* Quote section template controls */
.section-add-toolbar {
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  background: #fff;
}
.section-add-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.section-type-select {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-type-select span {
  color: #3b4048;
  font-size: 12px;
  font-weight: 850;
}
.small-button.solid {
  border-style: solid;
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}
.section-title-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.section-title-wrap b {
  font-size: 13px;
  font-weight: 800;
  min-width: 80px;
}
.section-title-wrap small {
  color: rgba(255, 255, 255, .66);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.section-meta-row {
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(160px, 230px) 90px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.section-meta-row span,
.section-meta-row b {
  min-height: 28px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--line);
  padding: 0 10px;
  font-size: 12px;
}
.section-meta-row span { font-weight: 850; }
.section-meta-row b { font-weight: 650; }
.quote-table th.numeric,
.quote-table td.numeric {
  text-align: right;
}
.quote-table td[data-editable="cell"]:first-child::after,
.quote-table td[data-editable="cell"].desc::after {
  content: "";
}
.edit-mode .quote-table td[data-editable="cell"]:first-child::after {
  content: "⌄";
  color: #8b8b8b;
  float: right;
  margin-left: 8px;
  font-size: 10px;
}
.quote-section[data-section-type="multiRoom"] .section-subtotal + .section-subtotal {
  border-top: 1px solid var(--line);
}

/* Right rail, section ordering and template customization */
:root {
  --font-color: #17191f;
  --section-header-bg: #17191c;
  --section-header-text: #ffffff;
  --border-color: #dedede;
  --page-fill: #f7f7f6;
  --card-fill: #ffffff;
  --sidebar-fill: #ffffff;
}
body { color: var(--font-color); background: var(--page-fill); }
.sidebar { background: color-mix(in srgb, var(--sidebar-fill) 88%, transparent); }
.quote-meta-card,
.quote-section,
.quote-summary,
.rail-card,
.client-form-cta,
.mini-card,
.empty-card,
.table-card,
.list-card,
.settings-card,
.form-builder-card,
.client-form-card { background: var(--card-fill); border-color: var(--border-color); }
.quote-table th { border-bottom-color: var(--border-color); }
.section-bar {
  background: linear-gradient(180deg, color-mix(in srgb, var(--section-header-bg) 88%, white), var(--section-header-bg));
  color: var(--section-header-text);
  border-bottom-color: var(--orange);
}
.section-title-wrap small { color: color-mix(in srgb, var(--section-header-text) 66%, transparent); }
.tiny-action { color: var(--section-header-text); border-color: color-mix(in srgb, var(--section-header-text) 18%, transparent); }

.view[data-panel="quotes"] { max-width: 1540px; }
.quote-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
  align-items: start;
}
.quote-canvas { min-width: 0; }
.quote-brand-strip {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.quote-brand-strip > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quote-brand-strip strong {
  font-size: 18px;
  letter-spacing: -0.025em;
}
.quote-brand-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.quote-logo-image {
  display: none;
  max-width: 154px;
  max-height: 46px;
  object-fit: contain;
}
body.has-logo .quote-logo-image { display: block; }
body.has-logo #quoteBrandText { display: none; }
.company-logo-image {
  display: none;
  max-width: 158px;
  max-height: 62px;
  object-fit: contain;
}
body.has-logo .company-logo-image { display: block; }
body.has-logo .brand-logo-text { display: none; }

.quote-rail {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}
.quote-rail::-webkit-scrollbar { width: 6px; }
.quote-rail::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 999px; }
.quote-rail::-webkit-scrollbar-track { background: transparent; }

.rail-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.055);
  padding: 14px;
}
.rail-card-title {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}
.rail-card-title strong {
  font-size: 15px;
  letter-spacing: -0.025em;
}
.rail-card-title span,
.rail-select span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.rail-select { display: grid; gap: 6px; margin-bottom: 10px; }
.rail-select select { width: 100%; }
.small-button.full { width: 100%; justify-content: center; }
.summary-section-list { display: grid; gap: 0; border-top: 1px solid var(--border-color); }
.summary-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.summary-section-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #252930;
  font-weight: 750;
}
.summary-section-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 2px;
}
.summary-section-row strong { font-size: 12px; font-weight: 800; }
.summary-total-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  padding-top: 12px;
  margin-top: 2px;
}
.summary-total-row span { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.summary-total-row strong { font-size: 24px; font-weight: 800; letter-spacing: -0.045em; }
.hidden-summary-value { display: none; }

.section-actions { align-items: center; }
.order-actions {
  display: inline-flex;
  gap: 4px;
  padding-right: 6px;
  margin-right: 2px;
  border-right: 1px solid color-mix(in srgb, var(--section-header-text) 18%, transparent);
}
.move-action {
  min-width: 25px;
  min-height: 22px;
  border: 1px solid color-mix(in srgb, var(--section-header-text) 18%, transparent);
  background: rgba(255,255,255,.08);
  color: var(--section-header-text);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
}
.move-action:disabled { opacity: .38; cursor: not-allowed; }
.edit-mode .section-bar [data-editable="section-title"] {
  color: #14171b !important;
  background: #fff8f1 !important;
  box-shadow: inset 0 0 0 1px rgba(255,107,0,.55) !important;
  text-shadow: none;
}
.edit-mode .section-bar [data-editable="section-title"]:focus {
  background: #fff !important;
  box-shadow: inset 0 0 0 2px var(--orange) !important;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: start;
}
.settings-card { max-width: none; }
.settings-heading h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.035em; }
.settings-heading p { margin: 0 0 14px; color: var(--muted); line-height: 1.45; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.settings-grid input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
}
.logo-upload-box {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.logo-upload-box input {
  min-height: 42px;
  padding: 9px;
}
.logo-preview-card {
  min-height: 128px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 18px;
  background: color-mix(in srgb, var(--card-fill) 88%, var(--page-fill));
  text-align: center;
}
.settings-logo-preview {
  display: none;
  max-width: 220px;
  max-height: 72px;
  object-fit: contain;
}
body.has-logo .settings-logo-preview { display: block; }
body.has-logo #settingsBrandPreview { display: none; }

@media print {
  .quote-page { display: block; }
  .quote-rail, .quote-brand-strip { display: none !important; }
}
@media (max-width: 1180px) {
  .quote-page { grid-template-columns: 1fr; }
  .quote-rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; }
}
@media (max-width: 760px) {
  .quote-rail { grid-template-columns: 1fr; max-height: none; overflow: visible; }
  .settings-layout, .settings-grid { grid-template-columns: 1fr; }
  .quote-brand-strip { flex-direction: column; align-items: flex-start; }
}

/* Generic branding + quote list hierarchy */
.brand-logo { width: 176px; }
.brand-logo strong {
  font-size: 24px;
  letter-spacing: -0.045em;
  transform: none;
}
.brand-logo small {
  margin-top: 3px;
  font-size: 13px;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-dots { top: -8px; left: 84px; }

.quote-list-toolbar {
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-fill);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
}
.quote-list-toolbar label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}
.quote-list-toolbar label span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.quote-list-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.quotes-hierarchy { display: grid; gap: 14px; }
.client-quote-group {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-fill);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,.05);
}
.client-group-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 12px;
  background: linear-gradient(180deg, #fff, #fbfbfb);
}
.client-group-head span,
.project-quote-head span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}
.client-group-head strong {
  font-size: 19px;
  letter-spacing: -0.035em;
}
.client-group-head small {
  color: var(--muted);
  font-weight: 800;
}
.project-quote-list { display: grid; gap: 0; }
.project-quote-card {
  padding: 16px 18px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.project-quote-card:last-child { border-bottom: 0; }
.project-quote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.project-quote-head strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  letter-spacing: -0.025em;
}
.project-quote-head em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.version-list {
  display: grid;
  gap: 7px;
}
.version-row {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: 126px 110px 110px 130px 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  text-align: left;
  color: var(--ink);
}
.version-row:hover {
  border-color: var(--orange);
  box-shadow: 0 8px 18px rgba(0,0,0,.055);
  transform: translateY(-1px);
}
.version-row span { color: #3f454f; font-size: 13px; font-weight: 750; }
.version-row strong { justify-self: end; font-size: 15px; font-weight: 800; }
.version-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange) !important;
  font-weight: 950 !important;
}

/* Catalog import controls */
.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.import-catalog-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0;
}
.catalog-head { align-items: flex-start; }
.catalog-import-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  max-width: 780px;
}
.catalog-import-status.success { color: #0d7a47; font-weight: 800; }
.catalog-import-status.error { color: #b43a13; font-weight: 800; }

@media (max-width: 900px) {
  .quote-list-toolbar,
  .client-group-head,
  .project-quote-head { align-items: flex-start; flex-direction: column; display: flex; }
  .version-row { grid-template-columns: 1fr; gap: 4px; padding: 10px; }
  .version-row strong { justify-self: start; }
  .catalog-toolbar { width: 100%; justify-content: stretch; }
  .catalog-toolbar > * { flex: 1; }
}

/* New Quote modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 14, 18, .34);
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none !important; }
.modal-card {
  width: min(860px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--card-fill);
  box-shadow: 0 28px 90px rgba(0,0,0,.24);
}
.modal-header,
.modal-footer {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-header {
  border-bottom: 1px solid var(--line-soft);
}
.modal-header h2 {
  margin: 2px 0 0;
  font-size: 26px;
  letter-spacing: -.04em;
}
.modal-footer {
  border-top: 1px solid var(--line-soft);
  justify-content: flex-end;
}
.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.quote-create-options {
  padding: 18px 20px 4px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.quote-create-card {
  position: relative;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px 13px 13px;
  cursor: pointer;
  display: grid;
  align-content: start;
  gap: 6px;
}
.quote-create-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.quote-create-card:has(input:checked) {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 18%, transparent), 0 10px 22px rgba(0,0,0,.06);
}
.quote-create-card span {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.quote-create-card small {
  color: var(--muted);
  line-height: 1.35;
  font-weight: 650;
}
.new-quote-body {
  padding: 16px 20px 20px;
}
.new-quote-panel {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fbfbfa;
  padding: 16px;
  display: grid;
  gap: 14px;
}
.new-quote-panel h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.02em;
}
.new-quote-panel p {
  margin: -8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.new-quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.new-quote-grid label,
.new-quote-full label,
.new-quote-panel label {
  display: grid;
  gap: 6px;
  font-weight: 850;
}
.new-quote-grid span,
.new-quote-full span,
.new-quote-panel label > span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
}
.new-quote-grid input,
.new-quote-grid select,
.new-quote-full input,
.new-quote-panel select {
  width: 100%;
}
.empty-new-quote-state {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 18px;
  color: var(--muted);
  line-height: 1.45;
}
.new-quote-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
@media (max-width: 900px) {
  .quote-create-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .new-quote-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .modal-backdrop { padding: 10px; align-items: start; }
  .quote-create-options { grid-template-columns: 1fr; }
}


/* Compact quotes list */
.quote-list-toolbar {
  margin-bottom: 10px;
  padding: 10px 12px;
  gap: 10px;
  border-radius: 8px;
  box-shadow: none;
}
.quote-list-toolbar label {
  gap: 8px;
  flex-wrap: wrap;
}
.quote-list-toolbar label span {
  font-size: 10px;
}
.quote-list-toolbar p {
  font-size: 12px;
}
.quotes-hierarchy {
  display: grid;
  gap: 10px;
}
.compact-client-group {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-fill);
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,.035);
}
.compact-client-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfbfb;
}
.compact-client-head span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  margin-bottom: 2px;
}
.compact-client-head strong {
  font-size: 16px;
  letter-spacing: -0.025em;
}
.compact-client-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.compact-quote-table {
  display: grid;
}
.compact-quote-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 74px 92px 92px 110px 120px;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}
.compact-quote-head-row {
  background: #fcfcfc;
  border-bottom: 1px solid var(--line-soft);
}
.compact-quote-head-row span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}
.compact-quote-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  color: var(--ink);
}
.compact-quote-item:first-of-type {
  border-top: 0;
}
.compact-quote-item span {
  color: #3f454f;
  font-size: 12px;
  font-weight: 750;
}
.compact-quote-item strong {
  justify-self: end;
  font-size: 14px;
  font-weight: 800;
}
.compact-quote-item:hover {
  background: #fffaf5;
}
.project-cell {
  font-weight: 850 !important;
  color: var(--ink) !important;
}
.version-pill.compact {
  min-height: 22px;
  min-width: 46px;
  padding: 0 8px;
  font-size: 11px !important;
}

@media (max-width: 900px) {
  .quote-list-toolbar {
    align-items: flex-start;
  }
  .compact-client-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .compact-quote-head-row {
    display: none;
  }
  .compact-quote-row,
  .compact-quote-item {
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
  }
  .compact-quote-item span,
  .compact-quote-item strong {
    justify-self: start;
  }
}


/* Client directory + modal */
.clients-directory-card {
  display: grid;
  gap: 0;
}
.client-directory-item {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}
.client-modal {
  max-width: 560px;
}
.client-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 24px 18px;
}
.client-modal-body label {
  display: grid;
  gap: 6px;
}
.client-modal-body label:last-child {
  grid-column: 1 / -1;
}
.client-modal-body span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}
.client-modal-body input {
  min-height: 42px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
@media (max-width: 760px) {
  .client-directory-item,
  .client-modal-body {
    grid-template-columns: 1fr;
  }
}

/* Landing page */
.landing-body {
  background: linear-gradient(180deg, #fff 0%, #f7f7f6 100%);
}
.landing-shell {
  min-height: 100vh;
  color: var(--ink);
}
.landing-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-size: 22px;
}
.landing-brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--section-header-bg, #17191c);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.landing-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.landing-nav a,
.hero-actions a,
.cta-strip a {
  text-decoration: none;
}
.landing-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 24px 56px;
}
.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  align-items: center;
  padding: 28px 0 34px;
}
.hero-copy .eyebrow {
  margin-bottom: 10px;
}
.hero-copy h1 {
  font-size: clamp(40px, 6vw, 64px);
  line-height: .97;
  letter-spacing: -.06em;
  margin: 0 0 16px;
}
.hero-copy p {
  font-size: 18px;
  color: #49515d;
  line-height: 1.5;
  max-width: 720px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 22px;
}
.hero-points div {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  font-weight: 700;
}
.hero-preview {
  border: 1px solid var(--border-color);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,.08);
  overflow: hidden;
}
.hero-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fafafa;
}
.hero-preview-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.preview-block,
.preview-mini,
.preview-list li,
.step-card,
.feature-card,
.cta-strip {
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 16px;
}
.preview-block {
  padding: 14px;
}
.preview-block strong {
  display: block;
  margin-bottom: 10px;
}
.preview-line {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #202228 0 50%, #ececec 50% 100%);
  margin-top: 8px;
}
.preview-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.preview-mini {
  padding: 12px;
  min-height: 90px;
}
.preview-mini b {
  display: block;
  margin-bottom: 12px;
}
.preview-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.preview-list li {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-heading {
  margin: 26px 0 16px;
}
.section-heading h2 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -.04em;
}
.section-heading p {
  margin: 0;
  color: #59616f;
}
.feature-grid,
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}
.feature-card,
.step-card {
  padding: 18px;
}
.feature-card h3,
.step-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.feature-card p,
.step-card p {
  margin: 0;
  color: #5b6370;
  line-height: 1.5;
}
.step-number {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 14px;
}
.cta-strip {
  margin-top: 28px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cta-strip p {
  margin: 0;
  color: #59616f;
}
.footer-note {
  color: #6b7380;
  font-size: 13px;
  margin-top: 16px;
}
@media (max-width: 960px) {
  .hero,
  .feature-grid,
  .step-grid {
    grid-template-columns: 1fr;
  }
  .preview-mini-grid,
  .hero-points {
    grid-template-columns: 1fr;
  }
  .cta-strip,
  .landing-header {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* Typography + icon cleanup */
body, button, input, select, textarea {
  font-family: var(--font);
}
.nav-link {
  font-weight: 500;
}
.nav-link .icon i,
.landing-nav i,
.button i,
.simple-button i {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.nav-link .icon {
  font-size: 0;
}
h1, h2, h3, strong, b {
  font-weight: 650;
}
.eyebrow {
  font-weight: 700;
}

/* Much simpler landing page */
.simple-landing-body {
  --font: Poppins, Montserrat, ui-sans-serif, system-ui, sans-serif;
  background: #faf9f7;
}
.simple-landing {
  font-family: var(--font);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,107,0,.10), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f8f7f4 100%);
}
.simple-brand {
  font-size: 18px;
}
.landing-logo {
  display: block;
  width: min(260px, 54vw);
  height: auto;
}
.simple-link {
  color: #4f5662;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 500;
  text-decoration: none;
}
.simple-link:hover {
  background: #fff;
  color: #17191f;
}
.simple-button {
  min-height: 46px;
  border-radius: 12px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  border: 1px solid #e4e0da;
  white-space: nowrap;
}
.simple-button-primary {
  color: #fff;
  background: #ff6b00;
  border-color: #ff6b00;
  box-shadow: 0 14px 28px rgba(255,107,0,.22);
}
.simple-button-ghost {
  color: #17191f;
  background: #fff;
}
.simple-hero-title {
  font-weight: 700;
}
.simple-hero-copy {
  font-weight: 400;
}
.simple-benefits div {
  min-height: 54px;
  border: 1px solid #e8e3dc;
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #303640;
  font-weight: 500;
}
.simple-benefits i {
  color: #ff6b00;
}
.simple-preview-card {
  border: 1px solid #e4e0da;
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 24px 70px rgba(23,25,31,.10);
  padding: 18px;
}
.simple-preview-head,
.simple-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.simple-preview-head {
  padding-bottom: 16px;
  border-bottom: 1px solid #ebe7e0;
}
.simple-preview-head span,
.simple-preview-lines span,
.simple-profit-box span,
.simple-total-row span {
  color: #69707b;
  font-size: 12px;
  font-weight: 500;
}
.simple-preview-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  color: #17191f;
}
.simple-preview-lines {
  display: grid;
  gap: 8px;
  padding: 16px 0;
}
.simple-preview-lines div {
  min-height: 42px;
  border: 1px solid #eeeeea;
  border-radius: 12px;
  background: #fff;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.simple-preview-lines strong {
  font-size: 15px;
}
.simple-profit-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 12px;
}
.simple-profit-box div {
  border-radius: 16px;
  background: #17191c;
  color: #fff;
  padding: 16px;
}
.simple-profit-box span {
  color: rgba(255,255,255,.68);
  display: block;
  margin-bottom: 6px;
}
.simple-profit-box strong {
  color: #fff;
  font-size: 24px;
}
.simple-total-row {
  border-top: 1px solid #ebe7e0;
  padding-top: 14px;
}
.simple-total-row strong {
  font-size: 28px;
  color: #17191f;
}
.simple-section-title {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 18px;
}
.simple-section-title h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.045em;
  font-weight: 700;
}
.simple-section-title p {
  margin: 0;
  color: #5c6470;
  line-height: 1.55;
}
.simple-feature-card {
  border: 1px solid #e4e0da;
  border-radius: 18px;
  background: #fff;
  padding: 20px;
}
.simple-feature-card i {
  color: #ff6b00;
  margin-bottom: 14px;
}
.simple-feature-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -.025em;
  font-weight: 650;
}
.simple-feature-card p {
  margin: 0;
  color: #5c6470;
  line-height: 1.55;
}
.simple-flow div {
  min-height: 92px;
  border: 1px solid #e4e0da;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 14px;
  color: #2f3540;
  font-weight: 600;
}
.simple-flow i {
  color: #ff6b00;
}
@media (max-width: 640px) {
  .simple-hero-title {
    font-size: 42px !important;
  }
  .simple-button {
    width: 100%;
  }
}


/* Landing refinements: lighter cards, sticky header, cleaner typography */
.landing-sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 247, .86);
  border-bottom: 1px solid rgba(228, 224, 218, .72);
  backdrop-filter: blur(16px);
}
.simple-landing-body {
  --font: Poppins, Montserrat, ui-sans-serif, system-ui, sans-serif;
}
.simple-brand,
.simple-button,
.simple-link,
.simple-benefits div,
.simple-flow div {
  font-weight: 500;
}
.simple-hero-title {
  font-weight: 600;
  letter-spacing: -0.055em !important;
}
.simple-section-title h2,
.simple-feature-card h3,
.simple-preview-head strong,
.simple-total-row strong,
.simple-profit-box strong {
  font-weight: 600;
}
.simple-button {
  min-width: 170px;
  height: 48px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.simple-button svg,
.simple-button i {
  flex: 0 0 auto;
}
.simple-preview-lines div span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.simple-preview-lines div span svg,
.simple-preview-lines div span i {
  color: #ff6b00;
}
.simple-profit-box div {
  background: #fff7ef;
  color: #17191f;
  border: 1px solid #ffd6b8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.simple-profit-box span {
  color: #7c552f;
}
.simple-profit-box strong {
  color: #17191f;
}
.simple-feature-card {
  min-height: 178px;
}
.simple-feature-card i,
.simple-feature-card svg {
  color: #ff6b00;
}
@media (max-width: 640px) {
  .landing-sticky-header {
    padding-left: 16px;
    padding-right: 16px;
  }
  .landing-logo {
    width: min(220px, 62vw);
  }
  .simple-button {
    width: 100%;
    min-width: 0;
  }
}

/* Catalog import check modal */
.import-check-modal {
  width: min(640px, 100%);
}
.import-check-body {
  padding: 18px 20px 20px;
  display: grid;
  gap: 14px;
}
.import-check-intro {
  margin: 0;
  color: #4f5968;
  line-height: 1.5;
}
.import-check-panel,
.expected-columns-box {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}
.import-check-panel.missing {
  background: #fff8f4;
  border-color: color-mix(in srgb, var(--orange) 35%, var(--border-color));
}
.import-check-panel strong,
.expected-columns-box summary {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.expected-columns-box summary {
  margin-bottom: 0;
  cursor: pointer;
}
.expected-columns-box[open] summary {
  margin-bottom: 10px;
}
.import-check-panel ul,
.expected-columns-box ol {
  margin: 0;
  padding-left: 20px;
  color: #343b47;
  line-height: 1.65;
}
.import-check-panel li,
.expected-columns-box li {
  padding: 2px 0;
}

/* SEO landing sections + legal footer/pages */
.simple-demo-button { min-width: 128px; }
.simple-seo-section { scroll-margin-top: 92px; }
.simple-seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.simple-seo-grid article {
  border: 1px solid #e6e2dc;
  background: rgba(255,255,255,.82);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 26px rgba(30, 32, 38, .045);
}
.simple-seo-grid article i,
.simple-seo-grid article svg {
  color: #ff6b00;
  margin-bottom: 14px;
}
.simple-seo-grid h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.025em;
  color: #17191f;
}
.simple-seo-grid p {
  margin: 0;
  color: #5b6470;
  line-height: 1.65;
  font-size: 15px;
}
.simple-legal-footer {
  border-top: 1px solid #e6e2dc;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  color: #5b6470;
}
.simple-legal-footer strong {
  display: block;
  color: #17191f;
  margin-bottom: 6px;
  font-weight: 600;
}
.simple-legal-footer p {
  margin: 0;
  max-width: 560px;
  line-height: 1.55;
  font-size: 14px;
}
.simple-legal-footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.simple-legal-footer a,
.legal-page a {
  color: #17191f;
  text-decoration: none;
  font-weight: 500;
}
.simple-legal-footer a:hover,
.legal-page a:hover {
  color: #ff6b00;
}
.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  color: #242832;
  font-family: Poppins, Montserrat, system-ui, sans-serif;
}
.legal-page h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -.055em;
  margin: 22px 0 16px;
  color: #17191f;
  font-weight: 650;
}
.legal-page h2 {
  font-size: 22px;
  margin: 30px 0 10px;
  color: #17191f;
  font-weight: 600;
}
.legal-page p,
.legal-page li {
  color: #545b66;
  line-height: 1.75;
  font-size: 15px;
}
.legal-page-card {
  border: 1px solid #e6e2dc;
  border-radius: 22px;
  background: #fff;
  padding: 26px;
  box-shadow: 0 14px 34px rgba(30, 32, 38, .055);
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
@media (max-width: 1020px) {
  .simple-nav-links .simple-link { display: none; }
  .simple-seo-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .simple-legal-footer { flex-direction: column; }
  .simple-legal-footer nav { justify-content: flex-start; }
}

/* Authentication pages */
.auth-body {
  min-height: 100vh;
  background: #f7f5f1;
  color: #17191f;
  font-family: Poppins, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.auth-panel-left {
  background: linear-gradient(180deg, #fffaf3 0%, #f1ebe2 100%);
  border-right: 1px solid #e5ded5;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #17191f;
}
.auth-brand span {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e4ded6;
  display: grid;
  place-items: center;
  color: #f26300;
  box-shadow: 0 8px 20px rgba(0,0,0,.04);
}
.auth-brand strong {
  font-weight: 650;
  letter-spacing: -.035em;
  font-size: 21px;
}
.auth-copy {
  max-width: 560px;
}
.auth-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 5vw, 68px);
  line-height: .98;
  letter-spacing: -.065em;
  font-weight: 650;
}
.auth-copy p:not(.eyebrow) {
  margin: 0;
  color: #535a65;
  font-size: 18px;
  line-height: 1.6;
}
.auth-feature-list {
  display: grid;
  gap: 12px;
  max-width: 560px;
}
.auth-feature-list div {
  min-height: 48px;
  border: 1px solid #e4ded6;
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  color: #343a44;
  font-weight: 550;
}
.auth-feature-list i,
.auth-feature-list svg {
  color: #f26300;
  flex: 0 0 auto;
}
.auth-panel-right {
  background: radial-gradient(circle at 50% 0%, #ffffff 0%, #fbfaf7 48%, #f7f5f1 100%);
}
.auth-card {
  border: 1px solid #e2ddd6;
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 22px 80px rgba(47, 42, 35, .08);
  padding: clamp(24px, 5vw, 42px);
}
.auth-card-head {
  margin-bottom: 22px;
}
.auth-card-head h2 {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 650;
}
.auth-card-head p:not(.eyebrow) {
  margin: 0;
  color: #5b626c;
  line-height: 1.5;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid #e5ded5;
  border-radius: 15px;
  background: #f7f5f1;
  margin-bottom: 20px;
}
.auth-tabs button {
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #6d737d;
  min-height: 42px;
  font-weight: 650;
}
.auth-tabs button.active {
  background: #fff;
  color: #17191f;
  box-shadow: 0 7px 18px rgba(0,0,0,.06);
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form label:not(.auth-checkbox) {
  display: grid;
  gap: 7px;
}
.auth-form label > span {
  color: #525963;
  font-size: 12px;
  font-weight: 650;
}
.auth-input-wrap {
  min-height: 48px;
  border: 1px solid #e1dbd3;
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
.auth-input-wrap svg,
.auth-input-wrap i {
  color: #8b9199;
  flex: 0 0 auto;
}
.auth-input-wrap input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  color: #17191f;
  min-height: 44px;
}
.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}
.auth-row-between a,
.auth-terms a {
  color: #e45f00;
  font-weight: 650;
  text-decoration: none;
}
.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5b626c;
}
.auth-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #f26300;
}
.auth-terms {
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #8a9098;
  font-size: 12px;
  font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: #e5ded5;
  flex: 1;
}
.auth-note {
  margin: 16px 0 0;
  color: #6f7680;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
@media (max-width: 640px) {
  .auth-card { border-radius: 22px; }
  .auth-card-head h2 { font-size: 30px; }
}

.auth-note[data-type="error"] {
  color: #b42318;
  background: #fff4f2;
  border: 1px solid #ffd7d1;
  border-radius: 12px;
  padding: 10px 12px;
}
.auth-note[data-type="neutral"] {
  color: #6f7680;
}
.auth-note[data-type="success"] {
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 12px;
  padding: 10px 12px;
}

/* QuoteCel module switcher + bilingual controls */
.module-switcher {
  display: grid;
  gap: 7px;
  margin: -18px 0 24px;
}
.module-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: #303640;
  border-radius: 10px;
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,.025);
}
.module-pill i {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange);
  font-style: normal;
  font-size: 13px;
}
.module-pill:hover { border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); transform: translateY(-1px); }
.module-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 10px 22px rgba(18,20,26,.16);
}
.module-pill.active i { background: rgba(255,255,255,.12); color: #fff; }
.language-chip {
  margin: 10px 0 12px;
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 2px 8px rgba(0,0,0,.025);
}
.language-chip:hover { border-color: var(--orange); color: var(--orange); }
.summary-money-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.summary-money-row span { color: var(--muted); font-weight: 800; }
.summary-money-row strong { font-weight: 850; letter-spacing: -.02em; }
.summary-money-row.profit strong { color: #16A34A; }
body[data-quote-type="construction"] {
  --orange: #F97316;
  --orange-soft: #FFF7ED;
  --ink: #0F2A3D;
  --page-fill: #F4F6F8;
  --section-header-bg: #0F2A3D;
  --section-header-text: #ffffff;
}
body[data-quote-type="construction"] .nav-link.active::before,
body[data-quote-type="construction"] .dashboard-status-row b { background: #F97316; }
body[data-quote-type="construction"] .module-pill.active {
  background: #0F2A3D;
  border-color: #0F2A3D;
}
body[data-quote-type="construction"] .button.accent {
  border-color: #F97316;
  background: linear-gradient(180deg, #FB923C, #F97316);
}
body[data-quote-type="construction"] .quote-meta-card { border-top-color: #F97316; }
body[data-quote-type="construction"] .status-pill,
body[data-quote-type="construction"] .metric-card i { color: #0F2A3D; }
body[data-quote-type="construction"] .quote-table th:nth-child(-n+4),
body[data-quote-type="construction"] .quote-table td:nth-child(-n+4) { text-align: left; }
body[data-quote-type="construction"] .quote-table td:nth-child(9),
body[data-quote-type="construction"] .quote-table td:nth-child(10) { font-variant-numeric: tabular-nums; }

@media print {
  .module-switcher,
  .language-chip { display: none !important; }
}

@media (max-width: 1120px) {
  .module-switcher { margin-top: -10px; }
  .module-pill { justify-content: center; padding: 0; }
  .module-pill span { display: none; }
  .language-chip { font-size: 12px; padding: 0; }
}

@media (max-width: 760px) {
  .module-switcher { grid-template-columns: 1fr 1fr; margin: 0 0 18px; }
  .module-pill span { display: inline; }
}

/* Sidebar catalog submenu */
.nav-link[data-view="catalog"]::after {
  content: "⌄";
  margin-left: auto;
  color: #8b9098;
  font-size: 15px;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform .16s ease, color .16s ease;
}
.nav-link[data-view="catalog"].active::after,
.nav-link[data-view="catalog"].catalog-expanded::after {
  color: #555b66;
  transform: rotate(180deg) translateY(1px);
}
.catalog-nav-submenu {
  display: grid;
  gap: 5px;
  margin: -4px 0 8px 40px;
  padding: 2px 0 2px 12px;
  border-left: 1px solid #d7dbe0;
}
.catalog-nav-submenu[hidden] {
  display: none !important;
}
.catalog-nav-subitem {
  appearance: none;
  border: 1px solid #e2e5e8;
  background: #f1f3f5;
  color: #6b7280;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.15;
  transition: background .14s ease, color .14s ease, border-color .14s ease, transform .14s ease;
}
.catalog-nav-subitem:hover {
  background: #e9ecef;
  color: #3f4650;
  border-color: #d6dadd;
  transform: translateX(1px);
}
.catalog-nav-subitem.active {
  background: #e3e6ea;
  color: #272d36;
  border-color: #cfd5da;
}
body[data-quote-type="construction"] .catalog-nav-subitem.active {
  color: #0F2A3D;
  border-color: #cbd5e1;
}

@media (max-width: 980px) {
  .catalog-nav-submenu {
    margin-left: 34px;
  }
}

@media (min-width: 981px) and (max-width: 1100px) {
  .catalog-nav-submenu {
    display: none !important;
  }
  .nav-link[data-view="catalog"]::after {
    display: none;
  }
}

/* PDF Mail Merge landing and tool */
.pdf-merge-landing-body .simple-landing {
  background:
    radial-gradient(circle at 16% 8%, rgba(255,107,0,.13), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(23,25,31,.08), transparent 24%),
    linear-gradient(180deg, #fff 0%, #f8f7f4 100%);
}
.pdf-merge-preview-card {
  border: 1px solid #e4e0da;
  border-radius: 26px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 24px 70px rgba(23,25,31,.11);
  padding: 18px;
}
.pdf-merge-preview-head,
.pdf-merge-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pdf-merge-preview-head {
  padding-bottom: 16px;
  border-bottom: 1px solid #ebe7e0;
}
.pdf-merge-preview-head span,
.pdf-merge-result-row span {
  display: block;
  color: #68707b;
  font-size: 12px;
  font-weight: 500;
}
.pdf-merge-preview-head strong,
.pdf-merge-result-row strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  color: #17191f;
}
.pdf-merge-mini-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
}
.pdf-merge-mini-columns {
  display: grid;
  gap: 9px;
  align-content: start;
}
.pdf-merge-mini-columns span {
  min-height: 38px;
  border: 1px solid #ffd6b8;
  border-radius: 12px;
  background: #fff7ef;
  color: #7a3b05;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 650;
}
.pdf-merge-mini-page {
  position: relative;
  min-height: 360px;
  border: 1px solid #e8e3dc;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfaf8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  overflow: hidden;
  padding: 22px;
}
.mini-page-line {
  width: 46%;
  height: 8px;
  border-radius: 999px;
  background: #ece8e2;
  margin-bottom: 10px;
}
.mini-page-line.wide {
  width: 68%;
  height: 12px;
  background: #17191f;
  opacity: .88;
}
.mini-page-table {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 28px;
  height: 96px;
  border: 1px solid #ebe7e0;
  border-radius: 14px;
  background: repeating-linear-gradient(180deg, #fff 0, #fff 28px, #f1eee8 29px);
}
.mini-field {
  position: absolute;
  border: 1px dashed #ff6b00;
  border-radius: 10px;
  background: rgba(255,247,239,.94);
  color: #17191f;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(255,107,0,.12);
}
.mini-field.one { top: 90px; left: 24px; width: 128px; }
.mini-field.two { top: 150px; right: 24px; width: 118px; }
.mini-field.three { bottom: 148px; right: 24px; width: 110px; }
.pdf-merge-result-row {
  border-top: 1px solid #ebe7e0;
  padding-top: 14px;
}
.pdf-merge-keyword-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.pdf-merge-keyword-panel div,
.pdf-merge-faq-grid article {
  border: 1px solid #e4e0da;
  border-radius: 18px;
  background: #fff;
  padding: 20px;
}
.pdf-merge-keyword-panel strong,
.pdf-merge-keyword-panel span {
  display: block;
}
.pdf-merge-keyword-panel strong,
.pdf-merge-faq-grid h3 {
  color: #17191f;
  font-size: 18px;
  margin: 0 0 8px;
  font-weight: 650;
  letter-spacing: -.02em;
}
.pdf-merge-keyword-panel span,
.pdf-merge-faq-grid p {
  color: #5c6470;
  line-height: 1.58;
  margin: 0;
}
.pdf-merge-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.pdf-merge-home-card {
  border: 1px solid #ffd6b8;
  background: linear-gradient(180deg, #fffaf6, #fff);
}
.pdf-merge-home-card .simple-button {
  margin-top: 16px;
  min-width: 0;
}

.pdf-merge-tool-body {
  background: #f7f6f3;
  min-height: 100vh;
  color: #17191f;
}
.pdf-merge-tool-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.pdf-merge-tool-header {
  min-height: 72px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e4e0da;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.pdf-merge-tool-brand img {
  display: block;
  width: min(220px, 52vw);
  height: auto;
}
.pdf-merge-tool-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdf-merge-tool-header nav a {
  color: #4f5662;
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 600;
}
.pdf-merge-tool-header nav a:hover {
  background: #f8f7f4;
  color: #17191f;
}
.pdf-merge-tool-main {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}
.pdf-merge-tool-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.pdf-merge-tool-topbar h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 650;
}
.pdf-merge-tool-topbar p:not(.eyebrow) {
  margin: 0;
  color: #5b6470;
  max-width: 770px;
  line-height: 1.6;
}
.pdf-merge-tool-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pdf-merge-tool-actions .button svg,
.pdf-merge-tool-actions .button i {
  width: 18px;
  height: 18px;
}
.pdf-merge-workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.pdf-merge-left-panel {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding-right: 3px;
}
.pdf-merge-upload-card,
.pdf-merge-column-card,
.pdf-merge-field-settings,
.pdf-merge-preview-panel,
.pdf-merge-data-preview {
  border: 1px solid #e4e0da;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(23,25,31,.055);
}
.pdf-merge-upload-card,
.pdf-merge-column-card,
.pdf-merge-field-settings {
  padding: 16px;
}
.pdf-merge-card-title {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.pdf-merge-card-title > span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff1e7;
  color: #ff6b00;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.pdf-merge-card-title strong,
.pdf-merge-card-title small {
  display: block;
}
.pdf-merge-card-title strong {
  font-size: 15px;
  font-weight: 700;
}
.pdf-merge-card-title small {
  color: #6a717c;
  line-height: 1.35;
}
.pdf-merge-file-drop {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  min-height: 142px;
  border: 1px dashed #d8d1c9;
  border-radius: 16px;
  background: #fbfaf8;
  padding: 18px;
  color: #4f5662;
  transition: .16s ease;
}
.pdf-merge-file-drop:hover,
.pdf-merge-file-drop.drag-over {
  border-color: #ff6b00;
  background: #fff7ef;
  color: #17191f;
}
.pdf-merge-file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.pdf-merge-file-drop svg,
.pdf-merge-file-drop i {
  width: 28px;
  height: 28px;
  color: #ff6b00;
}
.pdf-merge-file-drop strong,
.pdf-merge-file-drop span {
  display: block;
}
.pdf-merge-file-drop span {
  font-size: 12px;
  color: #737984;
}
.pdf-merge-column-search-wrap input,
.pdf-merge-field-settings input,
.pdf-merge-field-settings select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #ddd8d1;
  border-radius: 10px;
  background: #fff;
  padding: 0 11px;
  color: #17191f;
}
.pdf-merge-columns {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  margin-top: 12px;
  padding-right: 2px;
}
.pdf-merge-column-chip {
  appearance: none;
  border: 1px solid #e7dfd6;
  border-radius: 12px;
  background: #fff;
  color: #17191f;
  min-height: 58px;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  cursor: grab;
}
.pdf-merge-column-chip:hover {
  border-color: #ffb27c;
  background: #fffaf6;
  transform: translateY(-1px);
}
.pdf-merge-column-chip:active {
  cursor: grabbing;
}
.pdf-merge-column-chip strong {
  font-size: 13px;
  font-weight: 700;
}
.pdf-merge-column-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #737984;
  font-size: 12px;
}
.pdf-merge-column-empty {
  border: 1px dashed #ddd8d1;
  border-radius: 12px;
  color: #747b86;
  padding: 14px;
  text-align: center;
  background: #fbfaf8;
}
.pdf-merge-field-settings {
  display: grid;
  gap: 11px;
}
.pdf-merge-field-settings[hidden] {
  display: none;
}
.pdf-merge-field-settings .pdf-merge-card-title {
  margin-bottom: 0;
}
.pdf-merge-field-settings label {
  display: grid;
  gap: 6px;
  color: #4f5662;
  font-weight: 650;
  font-size: 12px;
}
.pdf-merge-field-settings label span {
  color: #4f5662;
}
.pdf-merge-field-settings input[type="color"] {
  padding: 3px;
  min-height: 42px;
}
.pdf-merge-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
}
.pdf-merge-check input {
  width: auto;
  min-height: 0;
}
.small-button.danger {
  color: #9d2712;
  border-color: #ffd2c5;
  background: #fff6f3;
}
.pdf-merge-preview-panel {
  min-width: 0;
  overflow: hidden;
}
.pdf-merge-preview-toolbar {
  min-height: 62px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e9e3dc;
  background: #fff;
}
.pdf-merge-page-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pdf-merge-page-controls strong {
  color: #17191f;
  font-size: 13px;
}
.pdf-merge-preview-status {
  color: #656d78;
  font-size: 13px;
  text-align: right;
}
.pdf-merge-canvas-wrap {
  position: relative;
  min-height: 680px;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 26px;
  background:
    linear-gradient(45deg, rgba(0,0,0,.035) 25%, transparent 25%) 0 0 / 22px 22px,
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,.035) 75%) 0 0 / 22px 22px,
    #eceae7;
}
.pdf-merge-empty-state {
  margin: 110px auto;
  min-height: 260px;
  width: min(520px, 100%);
  display: grid;
  place-items: center;
  text-align: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #d7d0c7;
  border-radius: 20px;
  background: rgba(255,255,255,.76);
  color: #68707b;
  padding: 28px;
}
.pdf-merge-empty-state svg,
.pdf-merge-empty-state i {
  width: 42px;
  height: 42px;
  color: #ff6b00;
}
.pdf-merge-empty-state strong {
  color: #17191f;
  font-size: 20px;
  letter-spacing: -.02em;
}
.pdf-merge-empty-state span {
  max-width: 360px;
  line-height: 1.55;
}
.pdf-merge-page-shell {
  position: relative;
  background: #fff;
  box-shadow: 0 20px 60px rgba(18,20,26,.18);
}
.pdf-merge-page-shell canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.pdf-merge-field-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.pdf-merge-field-layer.drag-over::after {
  content: "Drop column here";
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px dashed #ff6b00;
  border-radius: 10px;
  background: rgba(255,107,0,.08);
  color: #af4a00;
  font-weight: 800;
  pointer-events: none;
}
.pdf-merge-field {
  position: absolute;
  min-height: 28px;
  border: 1px dashed rgba(255,107,0,.9);
  border-radius: 8px;
  background: rgba(255,247,239,.84);
  padding: 4px 28px 4px 7px;
  line-height: 1.18;
  overflow: hidden;
  overflow-wrap: anywhere;
  cursor: move;
  user-select: none;
  box-shadow: 0 10px 22px rgba(255,107,0,.12);
}
.pdf-merge-field.selected {
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(255,107,0,.16), 0 10px 22px rgba(255,107,0,.12);
}
.pdf-merge-field button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: rgba(255,255,255,.86);
  color: #9d2712;
  font-weight: 900;
  line-height: 1;
}
.is-dragging-pdf-field,
.is-dragging-pdf-field * {
  cursor: grabbing !important;
}
.pdf-merge-data-preview {
  margin-top: 16px;
  padding: 16px;
}
.pdf-merge-data-preview[hidden] {
  display: none;
}
.pdf-merge-data-preview > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.pdf-merge-data-preview strong {
  font-size: 15px;
  font-weight: 700;
}
.pdf-merge-data-preview span {
  color: #6a717c;
  font-size: 12px;
}
.pdf-merge-preview-table-wrap {
  overflow: auto;
  border: 1px solid #ece6de;
  border-radius: 12px;
}
.pdf-merge-data-preview table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}
.pdf-merge-data-preview th,
.pdf-merge-data-preview td {
  border-bottom: 1px solid #f0ebe5;
  border-right: 1px solid #f0ebe5;
  padding: 8px 10px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.pdf-merge-data-preview th {
  background: #fbfaf8;
  color: #17191f;
  font-weight: 750;
}
.toast.error {
  background: #9d2712;
}
.toast.info {
  background: #191b20;
}
.toast.show {
  opacity: 1;
}
@media (max-width: 1100px) {
  .pdf-merge-workspace {
    grid-template-columns: 1fr;
  }
  .pdf-merge-left-panel {
    position: static;
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pdf-merge-column-card,
  .pdf-merge-field-settings {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .pdf-merge-mini-layout,
  .pdf-merge-keyword-panel,
  .pdf-merge-faq-grid,
  .pdf-merge-left-panel {
    grid-template-columns: 1fr;
  }
  .pdf-merge-tool-header,
  .pdf-merge-tool-topbar,
  .pdf-merge-preview-toolbar,
  .pdf-merge-data-preview > div:first-child {
    align-items: stretch;
    flex-direction: column;
  }
  .pdf-merge-tool-main {
    padding: 16px;
  }
  .pdf-merge-canvas-wrap {
    min-height: 520px;
    padding: 14px;
    place-items: start;
  }
  .pdf-merge-tool-actions,
  .pdf-merge-tool-actions .button,
  .pdf-merge-tool-header nav {
    width: 100%;
  }
  .pdf-merge-tool-header nav {
    justify-content: space-between;
  }
  .pdf-merge-tool-actions .button {
    justify-content: center;
  }
}

/* Ensure PDF merge dynamic panels actually disappear when hidden.
   Author display rules such as display:grid can override the browser's default hidden styling. */
.pdf-merge-empty-state[hidden],
.pdf-merge-page-shell[hidden],
.pdf-merge-data-preview[hidden],
.pdf-merge-field-settings[hidden] {
  display: none !important;
}

.pdf-merge-browser-error {
  margin: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 96, 31, 0.24);
  border-radius: 18px;
  background: rgba(255, 96, 31, 0.08);
  color: #17191f;
  display: grid;
  gap: 0.35rem;
}

.pdf-merge-browser-error strong {
  font-weight: 800;
}

.pdf-merge-browser-error span {
  color: #5f6675;
  line-height: 1.55;
}
