:root {
  --ink: #1d2524;
  --muted: #66736f;
  --paper: #f6f2ea;
  --panel: #fffdf8;
  --line: #d8d1c4;
  --green: #24584e;
  --green-2: #d9ebe2;
  --gold: #c48a2c;
  --blue: #2d5f83;
  --red: #b94d3f;
  --quote-primary: #24584e;
  --quote-accent: #c3483b;
  --shadow: 0 18px 48px rgba(35, 43, 39, 0.12);
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(29, 37, 36, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(29, 37, 36, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #192421;
  color: #f8f2e7;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.brand {
  display: flex;
  justify-content: center;
}

.brand img {
  display: block;
  width: min(100%, 218px);
  max-height: 82px;
  object-fit: contain;
  object-position: center;
}

.app-menu {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.app-menu-main,
.app-menu-bottom {
  display: grid;
  gap: 6px;
}

.app-menu-bottom {
  margin-top: auto;
}

.app-menu a {
  color: #e8eee9;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.app-menu a:hover,
.app-menu a.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.account-summary {
  display: grid;
  gap: 3px;
  margin-top: 14px;
  padding: 13px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #b8c7c0;
  font-size: 0.76rem;
  line-height: 1.3;
}

.account-summary strong {
  color: #f8f2e7;
  font-size: 0.82rem;
}

.sidebar-signout {
  width: max-content;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d9ebe2;
  font-size: 0.76rem;
  font-weight: 800;
}

.section-kicker,
.totals span,
.picker-head span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
}

.draft-label {
  margin-top: 18px;
}

main {
  padding: 32px;
  display: grid;
  gap: 22px;
  align-content: start;
  max-width: 1480px;
  width: 100%;
  min-width: 0;
}

.topbar,
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.topbar h1 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.page-job #appTitle,
.page-equipment #appTitle,
.page-rough #appTitle,
.page-finish #appTitle,
.page-labor #appTitle,
.page-packet #appTitle {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-jobs .top-actions,
.page-settings .top-actions {
  display: none;
}

.panel,
.workflow-bar {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}

.workflow-bar {
  padding: 12px 14px;
  margin-top: -10px;
  box-shadow: 0 10px 28px rgba(35, 43, 39, 0.08);
}

.page-section {
  display: none;
}

.page-section.current-page {
  display: block;
}

.job-grid.current-page,
.labor-layout.current-page {
  display: grid;
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.job-grid {
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.job-site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.job-site-fields {
  display: grid;
  gap: 14px;
}

.job-site-fields .form-cluster {
  grid-template-columns: repeat(2, minmax(170px, 1fr));
}

.form-cluster {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #37423f;
  font-size: 0.86rem;
  font-weight: 800;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c7beb0;
  background: #fffaf1;
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

.address-autocomplete {
  position: relative;
  display: block;
}

.address-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #c7beb0;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 14px 34px rgba(31, 43, 39, 0.16);
}

.address-suggestion {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.address-suggestion strong {
  font-size: 0.86rem;
  line-height: 1.25;
}

.address-suggestion span {
  color: var(--muted);
  font-size: 0.75rem;
}

.address-suggestion:hover,
.address-suggestion.is-active {
  background: #ecf3ef;
}

.job-map-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.job-map {
  position: relative;
  min-height: 256px;
  overflow: hidden;
  border: 1px solid #c7beb0;
  border-radius: 8px;
  background: #edf2ee;
}

.job-map iframe {
  width: 100%;
  height: 100%;
  min-height: 256px;
  border: 0;
  display: block;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 24px;
  text-align: center;
  color: #52615d;
  background:
    linear-gradient(90deg, rgba(36, 88, 78, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(36, 88, 78, 0.08) 1px, transparent 1px),
    #f4f6f2;
  background-size: 24px 24px;
}

.map-empty[hidden],
.job-map iframe[hidden] {
  display: none;
}

.map-empty strong {
  color: var(--ink);
}

.map-empty span {
  max-width: 240px;
  font-size: 0.82rem;
  line-height: 1.35;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(36, 88, 78, 0.16);
}

.primary,
.ghost,
.segmented {
  border: 1px solid var(--green);
  border-radius: 6px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 900;
}

a.primary,
a.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary {
  background: var(--green);
  color: #fff;
}

.ghost,
.segmented {
  background: #fffaf1;
  color: var(--green);
}

.segmented.active {
  background: var(--green);
  color: #fff;
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-equipment {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.selected-equipment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.selected-equipment-head span,
.equipment-type {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.selected-equipment-head h3 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.selected-equipment-head > strong {
  color: var(--green);
  font-size: 1.15rem;
}

.selected-equipment-list {
  display: grid;
}

.selected-equipment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 84px auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #ece5d9;
}

.selected-equipment-row:last-child {
  border-bottom: 0;
}

.selected-equipment-row strong {
  display: block;
  margin-top: 2px;
}

.equipment-detail {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.equipment-price {
  color: var(--green);
  white-space: nowrap;
}

.equipment-quantity {
  margin: 0;
  font-size: 0.74rem;
}

.equipment-quantity input {
  min-height: 32px;
  margin-top: 4px;
  padding: 4px 7px;
}

.selected-equipment-empty {
  margin: 0;
  padding: 16px 14px;
  color: var(--muted);
  font-weight: 700;
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(var(--visible-pickers, 2), minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker.is-hidden {
  display: none;
}

.picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search {
  margin: 12px;
  width: calc(100% - 24px);
}

.option-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  max-height: 330px;
}

.option {
  text-align: left;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 6px;
  padding: 10px;
}

.option.selected {
  border-color: var(--green);
  background: var(--green-2);
}

.option .selection-state {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 900;
}

.option strong {
  display: block;
}

.option span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 0.82rem;
}

.suggestion-panel {
  border-color: rgba(196, 138, 44, 0.42);
}

.suggestion-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.suggestion-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
  padding: 14px;
}

.suggestion-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.suggestion-card.is-added {
  border-color: rgba(36, 88, 78, 0.35);
  background: var(--green-2);
}

.suggestion-card:hover,
.suggestion-card:focus-visible {
  border-color: var(--green);
  background: #fffdf8;
  transform: translateY(-1px);
  outline: none;
}

.suggestion-card.is-added:hover,
.suggestion-card.is-added:focus-visible {
  border-color: rgba(179, 65, 53, 0.45);
}

.danger-action {
  border-color: rgba(179, 65, 53, 0.55);
  color: #9a362d;
}

.suggestion-card strong,
.empty-state strong {
  display: block;
  line-height: 1.25;
}

.suggestion-card span,
.empty-state span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.suggestion-card p {
  margin: 10px 0 0;
  color: #4d5b56;
  font-size: 0.88rem;
  line-height: 1.35;
}

.empty-state {
  grid-column: 1 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 36, 33, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.rough-modal {
  width: min(980px, 100%);
  max-height: min(860px, 88vh);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 24px 70px rgba(16, 24, 22, 0.28);
}

.unit-modal {
  width: min(820px, 100%);
}

.picker-modal {
  grid-template-rows: auto minmax(0, 1fr);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.equipment-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
  overflow: auto;
}

.equipment-tier-grid {
  grid-template-columns: 1fr;
}

.equipment-picker-card {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
}

.equipment-picker-card:hover,
.equipment-picker-card:focus-visible {
  border-color: var(--green);
  background: var(--green-2);
  outline: none;
}

.equipment-picker-card strong,
.equipment-picker-card span {
  display: block;
}

.equipment-picker-card strong {
  font-size: 1rem;
  line-height: 1.35;
}

.equipment-picker-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.unit-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
  overflow: auto;
}

.unit-type-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: center;
  min-height: 128px;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.unit-type-card:hover,
.unit-type-card:focus-visible {
  border-color: var(--green);
  background: var(--green-2);
}

.unit-type-card img {
  grid-row: 1 / span 2;
  width: 112px;
  height: 106px;
  object-fit: contain;
  background: #f4f2ed;
}

.unit-type-card strong {
  align-self: end;
  font-size: 1rem;
}

.unit-type-card span {
  align-self: start;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.equipment-catalog-list {
  padding: 0 20px 20px;
}

.equipment-catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid #e8e2d7;
}

.equipment-catalog-row:last-child {
  border-bottom: 0;
}

.equipment-catalog-row > div > strong,
.equipment-catalog-row > div > span {
  display: block;
}

.equipment-catalog-row > div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #ece5d9;
}

.modal-header h2 {
  margin: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  padding: 16px 20px;
  background: #fbf7ed;
  border-bottom: 1px solid #ece5d9;
}

.finish-category-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.category-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.category-card:hover,
.category-card:focus-visible,
.category-card.is-active {
  border-color: var(--green);
  background: var(--green-2);
  outline: none;
}

.category-card:hover,
.category-card:focus-visible {
  transform: translateY(-1px);
}

.category-card strong,
.category-card small {
  display: block;
  min-width: 0;
}

.category-card strong {
  line-height: 1.15;
}

.category-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.category-card em {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f1eadf;
  color: var(--green);
  font-style: normal;
  font-weight: 900;
  font-size: 0.78rem;
}

.category-card.is-active em {
  background: var(--green);
  color: #fff;
}

.category-icon {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e2dace;
  background: #fff;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.category-icon b {
  position: absolute;
  inset: auto 4px 4px auto;
  display: none;
  min-width: 22px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--green);
  font-size: 0.64rem;
  line-height: 1;
  padding: 3px 4px;
  text-align: center;
}

.category-icon--label b {
  position: static;
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  color: var(--green);
  font-size: 0.92rem;
  padding: 0;
}

.rough-picker-tools {
  padding: 14px 20px;
  border-bottom: 1px solid #ece5d9;
}

.rough-picker-tools label {
  max-width: 420px;
}

.rough-item-list {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding: 16px 20px 20px;
}

.rough-item-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
}

.rough-item-card strong,
.rough-item-card span {
  display: block;
}

.rough-item-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.rough-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.picker-message {
  border: 1px solid rgba(36, 88, 78, 0.22);
  border-radius: 8px;
  background: var(--green-2);
  color: var(--green);
  padding: 10px 12px;
  font-weight: 900;
}

.readiness-panel {
  background: #fffefa;
}

.jobs-panel {
  background: #fffefa;
}

.quotes-panel {
  background: #fffefa;
}

.customers-panel {
  background: #fffefa;
}

.customers-table td:nth-child(4),
.customers-table th:nth-child(4) {
  text-align: center;
}

.customer-row {
  background: #fffdf8;
  cursor: pointer;
}

.customer-row:hover,
.customer-row:focus-visible {
  background: #f4eee2;
  box-shadow: inset 3px 0 0 var(--green);
  outline: none;
}

.customer-row td:nth-child(2) span,
.customer-row td:nth-child(3) span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.quotes-table td:nth-child(3),
.quotes-table th:nth-child(3) {
  text-align: right;
}

.jobs-toolbar {
  margin-top: 18px;
}

.jobs-toolbar label {
  max-width: 420px;
}

.jobs-table-wrap {
  margin-top: 14px;
}

.jobs-table {
  min-width: 760px;
}

.job-row {
  background: #fffdf8;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.job-row:hover,
.job-row:focus-visible {
  background: #f4eee2;
  box-shadow: inset 3px 0 0 var(--green);
  outline: none;
}

.job-row.is-active {
  background: var(--green-2);
}

.job-row strong,
.job-row span {
  display: block;
}

.job-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.job-status {
  display: inline-flex;
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fbf7ed;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.quote-status {
  display: inline-flex;
  width: max-content;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf7ed;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.quote-status.sent { border-color: #bd8a27; background: #fff7df; color: #76540f; }
.quote-status.viewed { border-color: #6c91aa; background: #edf6fb; color: #285a77; }
.quote-status.signed { border-color: #508768; background: #ebf7ef; color: #215d3c; }

.table-empty {
  padding: 24px !important;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.table-empty span {
  display: block;
}

.table-empty .ghost {
  margin-top: 12px;
}

.readiness-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.readiness-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid #d6b0a9;
  border-radius: 8px;
  background: #fff3f0;
  padding: 12px;
}

.readiness-item.is-ready {
  border-color: rgba(36, 88, 78, 0.35);
  background: var(--green-2);
}

.readiness-item > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4d7d1;
  color: var(--red);
  font-weight: 900;
}

.readiness-item.is-ready > span {
  background: var(--green);
  color: #fff;
}

.readiness-item strong {
  display: block;
  line-height: 1.25;
}

.readiness-item p {
  margin: 4px 0 0;
  color: #4d5b56;
  font-size: 0.82rem;
  line-height: 1.35;
}

.table-wrap {
  margin-top: 18px;
  overflow: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 10px;
  border-bottom: 1px solid #ece5d9;
  vertical-align: middle;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: rgba(36, 88, 78, 0.035);
}

td:nth-child(3),
td:nth-child(4),
td:nth-child(6) {
  font-weight: 900;
}

.reason {
  max-width: 280px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.qty {
  width: 88px;
}

.icon {
  width: 32px;
  height: 32px;
  border: 1px solid #d6b0a9;
  background: #fff3f0;
  color: var(--red);
  border-radius: 6px;
  font-weight: 900;
}

.page-section.labor-layout.current-page {
  display: block;
}

.labor-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.labor-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.5fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.job-finish-labor,
.labor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
}

.job-finish-labor {
  padding: 16px;
}

.labor-section-title span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.labor-section-title h3 {
  margin-top: 4px;
}

.labor-system-list {
  display: grid;
  gap: 12px;
}

.labor-card {
  overflow: hidden;
}

.labor-card summary {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
}

.labor-card summary::-webkit-details-marker {
  display: none;
}

.labor-card summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 7px solid var(--green);
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  transform: rotate(-90deg);
  transition: transform 140ms ease;
}

.labor-card[open] summary::before {
  transform: rotate(0deg);
}

.labor-card summary span {
  display: grid;
  gap: 2px;
}

.labor-card summary small {
  color: var(--muted);
  font-size: 0.78rem;
}

.labor-card[open] summary {
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.labor-system-body {
  padding: 16px;
}

.labor-system-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.labor-system-tools label {
  max-width: 300px;
  margin: 0;
}

.labor-system-tools > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.labor-system-tools .ghost {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
}

.labor-phase {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.labor-phase > strong {
  color: var(--green);
  font-size: 0.9rem;
}

.labor-phase label {
  font-size: 0.78rem;
}

.labor-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.labor-task-grid label {
  margin: 0;
  font-size: 0.78rem;
}

.labor-subtotal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.labor-subtotal span {
  color: var(--muted);
  font-weight: 800;
}

.packet-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.quote-workbench-header {
  width: min(1180px, 100%);
  margin: 0 auto 20px;
  padding: 2px 0 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.packet-letterhead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 5px solid var(--quote-primary);
  border-bottom: 1px solid var(--line);
}

.packet-letterhead img {
  width: 150px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.packet-letterhead strong,
.packet-letterhead span {
  display: block;
}

.packet-letterhead strong {
  color: var(--quote-primary);
  font-size: 1.05rem;
}

.packet-letterhead span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.packet-letterhead-title {
  color: var(--quote-accent);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.packet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.estimate-toolbar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}

.estimate-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
}

.quote-detail-tabs {
  display: inline-flex;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffaf1;
}

.quote-detail-tab {
  min-width: 78px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.quote-detail-tab:last-child {
  border-right: 0;
}

.quote-detail-tab.active {
  background: var(--green);
  color: #fff;
}

.estimate-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.75rem;
  white-space: nowrap;
}

.estimate-controls .quote-price-control[hidden] {
  display: none;
}

.estimate-controls select,
.estimate-controls .quote-price-control input {
  min-height: 38px;
  margin: 0;
  padding: 7px 9px;
  font-size: 0.84rem;
}

.estimate-controls .quote-price-control input {
  width: 104px;
}

.estimate-controls .custom-total-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 132px;
  padding: 0 13px;
  font-size: 0.86rem;
  line-height: 1;
  white-space: nowrap;
}

.estimate-note-control {
  width: min(100%, 850px);
  margin: -10px auto 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.estimate-note-control summary {
  width: max-content;
  cursor: pointer;
  color: var(--green);
  font-weight: 900;
}

.estimate-note-control[open] {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbf7ed;
}

.estimate-note-control[open] summary {
  margin-bottom: 10px;
}

.estimate-note-control label {
  display: grid;
  gap: 6px;
}

.packet-actions {
  flex-wrap: nowrap;
}

.packet-actions .primary,
.packet-actions .ghost {
  min-height: 38px;
  padding: 0 13px;
  white-space: nowrap;
}

.packet-cover {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 14px;
}

.packet-cover > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
  padding: 14px;
}

.packet-cover span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
}

.packet-cover strong {
  display: block;
  margin-top: 6px;
  font-size: 1.3rem;
}

.packet-cover p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.quote-editor {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
}

.quote-editor label {
  margin: 0;
}

.quote-override-control {
  display: flex;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 42px;
  font-size: 0.86rem;
}

.quote-override-control input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.quote-editor > label:last-child {
  grid-column: 1 / -1;
}

.quote-detail-control select {
  margin-top: 6px;
}

.packet-panel > .quote-editor {
  max-width: 850px;
  margin: 14px auto 18px;
}

.quote-document {
  width: min(100%, 850px);
  min-height: 11in;
  margin: 0 auto;
  padding: 54px 58px 42px;
  border: 1px solid #d7d4cb;
  background: #fff;
  box-shadow: 0 14px 34px rgba(35, 43, 39, 0.14);
}

.quote-document-pages {
  display: grid;
  gap: 28px;
}

.quote-document-continuation .packet-letterhead {
  margin-top: 0;
}

.quote-continuation-sections {
  padding-top: 30px;
}

.quote-document .packet-letterhead {
  margin-top: 0;
  padding: 0 0 18px;
}

.quote-document-meta {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 42px;
  padding: 28px 0 24px;
}

.quote-document-meta section:last-child {
  text-align: right;
}

.quote-document-meta span,
.quote-price-band span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-document-meta strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 1.08rem;
}

.quote-document-meta p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.quote-price-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-radius: 4px;
  background: var(--quote-primary);
  color: #fff;
}

.quote-price-band span {
  color: rgba(255, 255, 255, 0.82);
}

.quote-price-band strong {
  color: #fff;
  font-size: 2rem;
}

.quote-document-sections {
  display: grid;
  gap: 26px;
  padding-top: 31px;
}

.quote-document-sections section {
  padding-bottom: 22px;
  border-bottom: 1px solid #e4e1d9;
}

.quote-document-sections section:last-child {
  border-bottom: 0;
}

.quote-document-sections h3 {
  margin: 0 0 13px;
  color: var(--quote-primary);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quote-document-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.quote-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
  padding: 15px;
}

.quote-grid h3 {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.quote-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

.quote-list li {
  line-height: 1.35;
}

.quote-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.quote-itemized-group + .quote-itemized-group {
  margin-top: 18px;
}

.quote-itemized-group > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
}

.quote-itemized-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
}

.quote-itemized-line > span,
.quote-itemized-line > b {
  padding: 7px 0;
  border-bottom: 1px solid #ece7dd;
  font-size: 0.88rem;
  line-height: 1.35;
}

.quote-itemized-line > b {
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

.packet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.packet-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
  padding: 15px;
}

.packet-grid h3 {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.packet-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 9px 0;
  border-bottom: 1px solid #ece5d9;
}

.packet-line span {
  font-weight: 800;
  line-height: 1.25;
}

.packet-line strong {
  white-space: nowrap;
}

.packet-line em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.35;
}

.packet-empty {
  color: var(--muted);
  margin-bottom: 0;
}

.settings-panel {
  background: #fffefa;
}

.settings-tabs {
  display: flex;
  gap: 22px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-tab {
  position: relative;
  min-height: 42px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.settings-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: transparent;
  content: "";
}

.settings-tab:hover,
.settings-tab:focus-visible {
  color: var(--green);
}

.settings-tab.active {
  color: var(--green);
}

.settings-tab.active::after {
  background: var(--green);
}

.settings-tab-content[hidden] {
  display: none;
}

.team-settings {
  margin-top: 18px;
}

.team-header {
  margin-bottom: 14px;
}

.team-header h3,
.pending-invites h4 {
  margin: 3px 0 0;
}

.team-table-wrap {
  margin-top: 16px;
}

.pending-invites {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pending-invite-line {
  padding: 9px 0;
  border-bottom: 1px solid rgba(216, 209, 196, 0.7);
  color: var(--muted);
  font-size: 0.9rem;
}

.section-description {
  margin: 5px 0 0;
  color: var(--muted);
}

.danger-text {
  color: var(--red);
}

.invite-link-field input {
  font-size: 0.78rem;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  display: grid;
  width: min(100%, 440px);
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card > img {
  width: 178px;
  max-height: 76px;
  object-fit: contain;
  object-position: left center;
}

.auth-card h1 {
  margin: 3px 0 0;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label,
.auth-copy,
.auth-error {
  margin: 0;
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid rgba(185, 77, 63, 0.35);
  border-radius: 6px;
  background: #fff4f1;
  color: #87382e;
  line-height: 1.4;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.45;
}

.brand-settings {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--quote-primary);
  border-radius: 8px;
  background: #fbf7ed;
}

.brand-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-settings-heading > div:first-child > span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-settings-heading h3 {
  margin-top: 4px;
}

.brand-logo-preview {
  display: grid;
  place-items: center;
  width: 158px;
  height: 64px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.brand-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr) 112px 112px;
  gap: 12px;
  align-items: end;
}

.brand-fields label {
  margin: 0;
}

.color-field input {
  min-height: 42px;
  padding: 4px;
}

.brand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-actions .file-button,
.brand-actions .ghost {
  flex: 0 0 auto;
  white-space: nowrap;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: #fffaf1;
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.refresh-note {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid rgba(36, 88, 78, 0.25);
  border-radius: 8px;
  background: var(--green-2);
  padding: 12px 14px;
}

.refresh-note strong,
.refresh-note span {
  display: block;
}

.refresh-note span {
  color: #33423e;
  font-size: 0.88rem;
  line-height: 1.35;
}

.workbook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.workbook-actions .file-button,
.workbook-actions button,
.workbook-actions a {
  min-height: 38px;
  margin: 0;
}

.workbook-table-wrap {
  margin-top: 0;
}

.workbook-table td:first-child {
  min-width: 260px;
}

.workbook-table td:first-child strong,
.workbook-table td:first-child span {
  display: block;
}

.workbook-table td:first-child span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.workbook-table tr.is-active {
  background: rgba(36, 88, 78, 0.06);
}

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

.compact-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
}

#catalogRefreshStatus {
  color: var(--muted);
  font-size: 0.84rem;
}

.refresh-note code {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(36, 88, 78, 0.18);
  border-radius: 4px;
  padding: 2px 4px;
}

.totals {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  min-width: min(100%, 650px);
}

.report-totals {
  margin-top: 18px;
  min-width: 0;
}

.totals div {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.totals strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.totals .grand strong {
  color: var(--green);
  font-size: 1.7rem;
}

.workflow-bar[hidden] {
  display: none;
}

.workflow-bar {
  display: grid;
  gap: 8px;
  align-items: start;
  grid-auto-rows: min-content;
}

.workflow-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 0;
}

.workflow-bar-head > div:first-child {
  min-width: 0;
}

.workflow-bar-head span,
.workflow-bar-head strong {
  display: block;
}

.workflow-bar-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workflow-bar-head strong {
  margin-top: 2px;
  font-size: 0.9rem;
  line-height: 1.25;
}

.workflow-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.workflow-actions .primary,
.workflow-actions .ghost {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.84rem;
  line-height: 1;
}

.workflow-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece5d9;
}

.workflow-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 160ms ease;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 6px;
  align-items: center;
  grid-auto-rows: min-content;
}

.workflow-steps a {
  display: inline-flex;
  align-items: center;
  height: 20px;
  min-width: 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.workflow-steps span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffaf1;
  color: var(--muted);
  font-size: 0.64rem;
}

.workflow-steps a.is-current {
  color: var(--green);
}

.workflow-steps a.is-current span,
.workflow-steps a.is-complete span {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .app-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .app-menu-main,
  .app-menu-bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    align-content: start;
  }

  .app-menu-bottom {
    margin-top: 0;
  }

  .equipment-grid,
  .job-grid.current-page,
  .labor-layout.current-page,
  .labor-workspace,
  .brand-fields {
    grid-template-columns: 1fr;
  }

  .job-site-layout {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .form-cluster {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .quote-workbench-header {
    align-items: flex-start;
  }

  .estimate-toolbar,
  .estimate-controls,
  .packet-actions {
    flex-wrap: wrap;
  }

  .estimate-toolbar {
    justify-content: flex-start;
  }

  .totals,
  .labor-task-grid,
  .suggestion-list,
  .category-grid,
  .packet-grid,
  .quote-grid,
  .packet-cover,
  .quote-editor,
  .readiness-list {
    grid-template-columns: repeat(2, 1fr);
    min-width: 0;
  }
}

@media (max-width: 700px) {
  main,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .app-menu {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-menu-main,
  .app-menu-bottom {
    grid-template-columns: repeat(2, 1fr);
  }

  .quote-workbench-header {
    display: grid;
  }

  .estimate-toolbar,
  .estimate-controls {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 9px;
  }

  .estimate-controls label {
    justify-content: space-between;
  }

  .packet-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .packet-actions .primary,
  .packet-actions .ghost {
    padding: 0 8px;
    font-size: 0.76rem;
  }

  .customer-form {
    grid-template-columns: 1fr;
  }

  .totals,
  .labor-system-list,
  .brand-fields,
  .suggestion-list,
  .category-grid,
  .packet-grid,
  .quote-grid,
  .packet-cover,
  .quote-editor,
  .readiness-list,
  .form-cluster,
  .job-site-fields .form-cluster {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .rough-modal {
    max-height: 92vh;
  }

  .rough-item-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .rough-item-actions {
    justify-content: space-between;
    white-space: normal;
  }

  .job-map,
  .job-map iframe {
    min-height: 220px;
  }

  .workflow-bar-head,
  .workflow-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .workflow-steps {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .quote-document {
    min-height: 0;
    padding: 34px 24px 28px;
  }

  .quote-document .packet-letterhead {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .quote-document .packet-letterhead img {
    width: 120px;
  }

  .quote-document .packet-letterhead > div:nth-child(2) {
    display: none;
  }

  .quote-document-meta {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .quote-document-meta section:last-child {
    text-align: left;
  }

  .quote-price-band,
  .quote-document-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .selected-equipment-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .equipment-price {
    grid-column: 1;
  }

  .equipment-quantity {
    grid-column: 2;
    grid-row: 2;
  }

  .unit-type-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .equipment-catalog-list {
    padding: 0 14px 14px;
  }

  .equipment-catalog-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .equipment-catalog-row .equipment-price {
    grid-column: 1;
  }

  .equipment-catalog-row button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  table {
    min-width: 780px;
  }
}

.send-quote-modal {
  width: min(560px, 100%);
  display: block;
}

.send-quote-form {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.send-quote-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.send-quote-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.send-quote-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.customer-modal {
  width: min(640px, 100%);
  display: block;
}

#customerModal .customer-modal {
  width: min(860px, 100%);
}

.customer-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

#customerModal .customer-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.customer-address-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.customer-address-field {
  min-width: 0;
}

.customer-address-field label {
  display: grid;
}

.customer-address-field .field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.customer-map-card {
  min-width: 0;
}

.customer-map {
  min-height: 170px;
  height: 100%;
}

.customer-map iframe {
  min-height: 170px;
}

.customer-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.confirmation-modal {
  width: min(460px, 100%);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.confirmation-content {
  padding: 4px 20px 20px;
}

.confirmation-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

.danger-action {
  border-color: var(--red);
  background: var(--red);
}

.app-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 15px;
  border: 1px solid #508768;
  border-radius: 6px;
  background: #edf7f0;
  color: #215d3c;
  box-shadow: 0 10px 28px rgba(16, 24, 22, 0.16);
  font-weight: 800;
}

.app-toast[data-tone="error"] {
  border-color: rgba(185, 77, 63, 0.45);
  background: #fff3f0;
  color: #87382e;
}

.signature-page {
  min-height: 100vh;
  margin: 0;
  background: #f2f0ea;
  color: #1d2724;
  font-family: Arial, sans-serif;
}

.signature-shell { width: min(760px, calc(100% - 32px)); margin: 48px auto; }
.signature-card { padding: 34px; border: 1px solid #d7d4cb; border-radius: 8px; background: #fff; box-shadow: 0 14px 34px rgba(35, 43, 39, 0.12); }
.signature-head, .signature-summary, .signature-pad-wrap > div { display: flex; justify-content: space-between; gap: 20px; }
.signature-head { align-items: center; padding-bottom: 24px; border-bottom: 1px solid #e4e1d9; }
.signature-head img { width: 160px; max-height: 62px; object-fit: contain; object-position: left center; }
.signature-head div, .signature-summary div { display: grid; gap: 6px; }
.signature-head div { text-align: right; }
.signature-head span, .signature-summary span { color: #697470; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.signature-head strong { font-size: 1.05rem; }
.signature-summary { padding: 28px 0; }
.signature-summary p { margin: 0; color: #697470; font-size: 0.9rem; }
.signature-total { color: #24584e; font-size: 1.7rem; }
.signature-pdf-link { margin-bottom: 26px; }
.signature-form { display: grid; gap: 20px; padding-top: 24px; border-top: 1px solid #e4e1d9; }
.signature-form > label { display: grid; gap: 7px; font-size: 0.86rem; font-weight: 900; }
.signature-pad-wrap { display: grid; gap: 10px; }
.signature-pad-wrap > div { align-items: center; }
.signature-pad-wrap canvas { width: 100%; height: 180px; touch-action: none; border: 1px solid #cfc9be; border-radius: 5px; background: #fffefa; }
.signature-consent { display: flex !important; align-items: flex-start; justify-content: flex-start; gap: 10px !important; line-height: 1.4; font-weight: 700 !important; }
.signature-consent input { width: 18px; min-width: 18px; min-height: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; padding: 0; }
.signature-complete { margin-top: 28px; padding: 20px; border: 1px solid #a4c5ae; background: #edf8f0; }
.signature-complete h1 { margin: 0 0 7px; color: #215d3c; font-size: 1.25rem; }
.signature-complete p, .signature-error { margin: 0; color: #385345; }
.signature-error { color: #9a362d; font-weight: 800; }

@media (max-width: 700px) {
  #customerModal .customer-form,
  .customer-address-layout {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: letter;
    margin: 0.5in;
  }

  .sidebar,
  .topbar,
  .workflow-bar,
  .top-actions,
  .packet-actions,
  .app-toast,
  .modal-backdrop,
  .quote-editor,
  .app-menu,
  .search,
  .ghost,
  .danger,
  .page-section:not(#packet) {
    display: none !important;
  }

  .app-shell,
  main {
    display: block;
    padding: 0;
  }

  .packet-panel {
    display: block !important;
    padding: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
  }

  .quote-document {
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .quote-document-pages {
    display: block;
  }

  .quote-document {
    break-after: page;
    page-break-after: always;
  }

  .quote-document:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .quote-document,
  .quote-price-band {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
