:root {
  --ink: #171717;
  --muted: #737373;
  --accent: #c92a2a;
  --accent-hover: #a61e1e;
  --accent-soft: #fff1f1;
  --line: #e5e5e5;
  --bg: #f6f6f6;
  --white: #fff;
  --sidebar: 244px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.login-card .login-remember { display: flex; align-items: center; gap: 0.6rem; }
.login-card .login-remember input { width: auto; margin: 0; }
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #e69a9a;
  outline-offset: 4px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--ink);
  color: var(--white);
  border-right: 1px solid #252525;
  padding: 32px 23px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-logo-frame {
  display: block;
  background: #fff;
  padding: 10px;
  border-radius: 6px;
  max-width: 100%;
}
.brand-logo {
  display: block;
  width: 144px;
  max-width: 100%;
  height: auto;
}
.brand small {
  display: block;
  letter-spacing: 1.45px;
  font-size: 8px;
  font-weight: 600;
  color: var(--muted);
}
.sidebar .brand small { color: #b3b3b3; }
.login-card .brand-logo-frame { padding: 0; }
.login-card .brand-logo { width: 180px; }
.nav-label {
  margin: 48px 12px 15px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.5px;
  color: #a3a3a3;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: 6px;
  color: #cccccc;
  font-weight: 550;
}
nav a span {
  font-size: 19px;
  width: 20px;
}
nav a:hover {
  text-decoration: none;
  background: #262626;
}
nav .active {
  background: #331b1b;
  color: var(--white);
  box-shadow: inset 3px 0 var(--accent);
}
.sidebar-bottom {
  margin-top: auto;
}
.environment {
  font-size: 10px;
  color: #b3b3b3;
  border-bottom: 1px solid #333333;
  padding-bottom: 22px;
  white-space: nowrap;
}
.dot {
  width: 6px;
  height: 6px;
  background: #c92a2a;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.profile {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-top: 22px;
}
.avatar {
  width: 34px;
  height: 34px;
  background: #303030;
  color: #ff8585;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.profile strong {
  font-size: 12px;
}
.profile small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  color: #b3b3b3;
}
.signout {
  border: 0;
  background: none;
  color: #b3b3b3;
  font-size: 11px;
  margin: 15px 0 0 44px;
  padding: 0;
}
.workspace {
  margin-left: var(--sidebar);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 75px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  color: #737373;
  font-size: 11px;
}
.topbar strong {
  font-weight: 500;
  color: #333333;
}
.slash {
  padding: 0 13px;
  color: #bfbfbf;
}
.topbar-right {
  font-size: 10px;
}
.page {
  max-width: 1450px;
  width: 100%;
  margin: 0 auto;
  padding: 42px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}
.eyebrow {
  font-size: 10px;
  color: #737373;
  letter-spacing: 1.8px;
  font-weight: 650;
  margin-bottom: 13px;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  margin: 0;
  font-weight: 650;
  line-height: 1.25;
}
h1 .badge {
  vertical-align: middle;
  margin-left: 16px;
  letter-spacing: 0;
}
p {
  line-height: 1.65;
  color: #666666;
  margin: 10px 0 0;
}
h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.15px;
}
h3 {
  font-size: 14px;
  margin: 0;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 12px 17px;
  white-space: nowrap;
  line-height: 1.3;
}
.button:hover {
  background: var(--accent-hover);
  text-decoration: none;
}
.button.secondary {
  color: #333333;
  background: white;
  border-color: #d9d9d9;
}
.button.secondary:hover {
  background: #f3f3f3;
}
.full {
  width: 100%;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.metric {
  padding: 23px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.metric > span {
  font-size: 11px;
  color: #666666;
  display: flex;
  justify-content: space-between;
}
.metric > strong {
  display: block;
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 18px 0 12px;
}
.metric > small {
  font-size: 10px;
  color: #737373;
}
.value-metric {
  background: var(--ink);
  border-color: var(--ink);
}
.value-metric > span,
.value-metric > small {
  color: #cccccc;
}
.value-metric > strong {
  color: var(--white);
  font-size: 23px;
  letter-spacing: -0.6px;
}
.metric-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-top: 3px;
}
.metric-dot.pending {
  background: #c92a2a;
}
.metric-dot.accepted {
  background: #171717;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  margin-bottom: 24px;
  overflow: hidden;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 23px 25px;
  border-bottom: 1px solid var(--line);
}
.panel-heading p {
  font-size: 11px;
  margin-top: 6px;
}
.text-link {
  font-size: 11px;
  font-weight: 600;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
thead {
  background: #fafafa;
}
th {
  padding: 14px 24px;
  font-size: 10px;
  font-weight: 600;
  color: #737373;
  white-space: nowrap;
}
td {
  padding: 18px 24px;
  border-top: 1px solid #eeeeee;
  vertical-align: middle;
}
td strong {
  font-size: 12px;
  font-weight: 500;
}
td small {
  display: block;
  color: #737373;
  font-size: 10px;
  margin-top: 6px;
}
.record-link {
  font-weight: 600;
  color: #b32626;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666666;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}
.badge.sent {
  background: #fff1f1;
  color: #b32626;
}
.badge.accepted {
  background: #171717;
  color: #ffffff;
}
.badge.rejected {
  background: #c92a2a;
  color: #ffffff;
}
.badge.expired {
  background: #f0f0f0;
  color: #666666;
}
.badge.cancelled {
  background: #f0f0f0;
  color: #666666;
}
.amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 28px 0;
}
.quick-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 23px 25px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.quick-card:hover {
  text-decoration: none;
  border-color: #c92a2a;
}
.quick-icon {
  display: grid;
  place-items: center;
  background: #fff1f1;
  color: #c92a2a;
  border-radius: 7px;
  width: 40px;
  height: 40px;
  font-size: 22px;
}
.quick-card p {
  font-size: 11px;
  margin: 5px 0 0;
}
.quick-card > span:last-child {
  margin-left: auto;
  color: #737373;
}
.note {
  border-left: 2px solid #c92a2a;
  padding: 8px 18px;
  margin-top: 34px;
}
.note strong {
  font-size: 12px;
  font-weight: 550;
  color: #333333;
}
.note p {
  font-size: 11px;
  margin: 7px 0 0;
  color: #737373;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 24px 42px;
  font-size: 10px;
  color: #737373;
}
.filters {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  padding: 22px 25px;
}
.filters label {
  margin: 0;
  min-width: 140px;
}
.filters .search-label {
  min-width: 240px;
  flex: 1;
  max-width: 470px;
}
.filters .text-link {
  padding: 12px 0;
}
.table-caption {
  font-size: 10px;
  padding: 15px 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
label {
  font-size: 12px;
  font-weight: 500;
  display: block;
  margin-bottom: 18px;
  color: #333333;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  color: #171717;
  padding: 11px 12px;
  margin-top: 8px;
  min-height: 39px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #e69a9a;
  outline-offset: 1px;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
.form-panel {
  padding: 28px;
  max-width: 900px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
.coordinate-fields {
  min-width: 0;
  margin: 4px 0 16px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.coordinate-fields legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
}
.coordinate-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
.coordinate-fields small {
  display: block;
  margin-top: 2px;
}
.map-coordinates {
  margin-top: 20px;
  padding: 24px;
}
.map-coordinates h2 {
  margin-top: 0;
}
.project-map-preview {
  width: min(100%, 720px);
  margin: 18px 0;
}
.project-overview-field {
  min-width: 0;
  margin: 4px 0 16px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.project-overview-field legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
}
.project-overview-current {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.project-overview-current img {
  width: 144px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: cover;
}
.project-overview-selected {
  margin-top: 12px;
}
.project-overview-selected img {
  display: block;
  max-width: min(100%, 480px);
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: contain;
}
.project-overview-detail-image {
  display: block;
  width: min(100%, 720px);
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: contain;
  object-position: left center;
}
.project-overview-panel .panel-body > p.muted {
  margin: 8px 0;
}
.map-preview-credit {
  margin: 6px 0 0;
  font-size: 10px;
}
.map-image-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 277 / 165;
  background: #ecebe6;
  border: 1px solid var(--line);
}
.map-image-wrap > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.map-scale-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.map-scale-controls label {
  margin: 0;
}
.map-scale-controls select {
  margin: 0;
}
.map-scale-controls span {
  font-size: 12px;
}
.map-project-heading {
  line-height: 1.35;
}
.map-scale-print-label {
  display: none;
}
.map-coordinate-label {
  font-size: 12px;
}
.wide {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
}
.heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.lookup-search {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-top: 18px;
}
.lookup-search label {
  flex: 1;
  min-width: 200px;
  margin: 0;
}
.lookup-result,
.company-card {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.lookup-result .button {
  margin-top: 16px;
  display: flex;
  width: fit-content;
}
.lookup-result > a {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
}
.button.delete-link {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--white);
}
.button.delete-link:hover {
  background: var(--accent-soft);
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  line-height: 1.6;
}
.checkbox-label input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.back-link {
  display: block;
  font-size: 11px;
  color: #737373;
  margin-bottom: 17px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 27px;
  gap: 40px;
}
.detail-grid h2 {
  margin-bottom: 20px;
}
.detail-grid p {
  font-size: 12px;
}
.pre-wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
dl {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 12px;
  font-size: 12px;
  margin-top: 20px;
}
dt {
  color: #737373;
}
dd {
  margin: 0;
  color: #333333;
}
.panel-body {
  padding: 23px 25px;
}
.contact {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.contact:last-child {
  border-bottom: 0;
}
.contact summary {
  cursor: pointer;
  font-size: 12px;
  line-height: 1.6;
}
.contact summary .text-link {
  float: right;
}
.contact form {
  padding-top: 20px;
}
.count {
  font-size: 12px;
  color: #737373;
  margin-left: 8px;
}
.muted {
  color: #737373;
  font-weight: 400;
  font-size: 11px;
}
.revision-select label {
  font-size: 10px;
  margin-bottom: 0;
}
.revision-select select {
  min-width: 180px;
}
.notice {
  background: #f3f3f3;
  border: 1px solid #e5e5e5;
  color: #525252;
  border-radius: 5px;
  padding: 15px 20px;
  margin-bottom: 23px;
  font-size: 12px;
  line-height: 1.7;
}
.compact-offer {
  padding: 18px 22px;
}
.offer-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.offer-table-toolbar h2 {
  font-size: 17px;
  margin: 0;
}
.offer-table-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.offer-table-controls select {
  width: 105px;
  margin: 0;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 12px;
}
#autosave-status {
  font-size: 11px;
  color: var(--muted);
  max-width: 260px;
  line-height: 1.4;
}
#autosave-status[data-state="error"],
#autosave-status[data-state="conflict"] {
  color: var(--accent);
}
.offer-table-wrap {
  overflow-x: auto;
}
.offer-pricing-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border-top: 1px solid #252525;
}
.offer-pricing-table .description-col {
  width: auto;
}
.offer-pricing-table .quantity-col {
  width: 120px;
}
.offer-pricing-table col.rate-column {
  width: 105px;
}
.offer-pricing-table .price-col {
  width: 130px;
}
.offer-pricing-table .actions-col {
  width: 24px;
}
.offer-pricing-table th {
  padding: 8px 6px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color: #171717;
  background: #f5f6f7;
  border-bottom: 1px solid #4f4f4f;
}
.offer-pricing-table td {
  padding: 7px 6px;
  border-bottom: 1px solid #777;
  vertical-align: top;
  font-size: 14px;
}
.offer-pricing-table th:first-child,
.offer-pricing-table td:first-child {
  padding-left: 6px;
}
.offer-pricing-table th:last-child,
.offer-pricing-table td:last-child {
  padding-right: 0;
}
.offer-pricing-table th:not(:first-child) {
  text-align: right;
}
.offer-pricing-table .quantity-cell,
.offer-pricing-table th:nth-child(2) {
  text-align: center;
}
.offer-pricing-table input,
.offer-pricing-table select,
.offer-pricing-table textarea {
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  margin: 0;
  padding: 3px 4px;
  min-height: 28px;
  font-size: 14px;
  font-family: inherit;
}
.offer-pricing-table input:hover,
.offer-pricing-table textarea:hover {
  background: #fafafa;
}
.offer-pricing-table input:focus,
.offer-pricing-table textarea:focus,
.offer-pricing-table select:focus {
  background: #fff;
  outline: none;
  border-bottom-color: var(--accent);
}
.description-line {
  display: flex;
  align-items: baseline;
}
.description-line textarea {
  width: 100%;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  min-height: 28px;
}
.item-position {
  display: inline;
  padding-right: 3px;
  font-size: 14px;
}
.subitem .description-line,
.preserved-offer .subitem td:first-child {
  padding-left: 24px;
}
.quantity-unit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.quantity-unit input {
  width: 60px;
  text-align: center;
}
.quantity-unit select {
  width: 48px;
  padding: 3px 0;
  font-size: 11px;
  color: #777;
}
.item-row[data-fixed="yes"] .quantity-unit input {
  display: none;
}
.editable-rate,
.editable-amount {
  position: relative;
  text-align: right;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.editable-rate input,
.editable-amount input {
  text-align: right;
}
.editable-rate input,
.fixed-price-slot input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  z-index: 1;
}
.editable-rate input:focus,
.fixed-price-slot input:focus {
  opacity: 1;
}
.editable-rate:has(input[type="text"]:focus) .rate-display,
.editable-amount:focus-within:has(input) .line-total {
  visibility: hidden;
}
.rate-display,
.line-total {
  padding: 3px 4px;
  font-weight: 400;
  font-size: 14px;
  color: #171717;
}
.line-total {
  cursor: text;
}
.item-row[data-fixed="yes"] .editable-rate {
  visibility: hidden;
}
.item-actions .remove-item {
  background: transparent;
  border: 0;
  color: #999;
  font-size: 18px;
  padding: 0;
  margin-top: 2px;
}
.item-actions .remove-item:hover {
  color: var(--accent);
}
.remove-item:disabled {
  opacity: 0.3;
  cursor: default;
}
.item-options {
  position: relative;
}
.item-options summary {
  position: absolute;
  right: 0;
  top: -28px;
  list-style: none;
  color: #999;
  cursor: pointer;
  font-size: 12px;
  background: #fff;
  padding: 0 3px;
}
.item-options summary::-webkit-details-marker {
  display: none;
}
.description-line {
  padding-right: 22px;
}
.item-options-fields {
  display: flex;
  gap: 12px;
  padding-top: 6px;
}
.item-options-fields label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  color: #666;
}
.item-options-fields input {
  width: 54px;
  border-color: #ddd;
  font-size: 12px;
}
.item-options-fields select {
  width: 48px;
  font-size: 12px;
  border-color: #ddd;
}
.discount-summary {
  color: var(--accent);
}
.offer-table-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-top: 9px;
}
.add-line {
  background: transparent;
  border: 0;
  font-size: 12px;
  padding: 8px 0;
}
.offer-totals {
  width: 340px;
  max-width: 100%;
  font-size: 14px;
}
.offer-totals[hidden],
.pricing-option-totals[hidden] {
  display: none;
}
.offer-totals > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  gap: 12px;
  padding: 6px;
  border-bottom: 1px solid #777;
}
.offer-totals .gross-total {
  background: #f5f6f7;
  border-bottom: 1px solid #252525;
}
.vat-label {
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 13px;
}
.vat-label input {
  width: 48px;
  padding: 2px 4px;
  margin: 0 2px;
  min-height: 24px;
  font-size: 12px;
  border: 1px solid transparent;
  text-align: right;
}
.compact-offer .offer-totals {
  width: 340px;
  flex-shrink: 0;
}
.compact-offer .offer-table-footer > div:first-child {
  flex: 1;
}
.compact-offer .offer-table-footer > div:first-child:empty {
  display: none;
}
.offer-settings {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.offer-settings summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.offer-settings .panel-body {
  padding: 16px 0 0;
}
.autosave-feedback {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
}
.autosave-feedback:not(:has(:not([hidden]))) {
  padding: 0;
}
.autosave-feedback [hidden] {
  display: none !important;
}
.preserved-offer td:first-child {
  width: 65%;
}
@media (max-width: 700px) {
  .compact-offer {
    padding: 14px 12px;
  }
  .offer-pricing-table {
    min-width: 570px;
  }
  .offer-table-footer {
    flex-wrap: wrap;
  }
  .offer-totals {
    margin-left: auto;
  }
}
.icon-button {
  border: none;
  background: #f3f3f3;
  color: #b32626;
  font-size: 20px;
  border-radius: 4px;
  width: 26px;
  height: 30px;
}
.pricing-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 24px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.total-block {
  text-align: right;
}
.total-block span {
  display: block;
  font-size: 11px;
}
.total-block strong {
  font-size: 23px;
  color: var(--ink);
  font-weight: 600;
  display: block;
  margin-top: 9px;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.action-row form {
  margin: 0;
}
.action-row .accept-offer-form {
  display: flex;
  align-items: end;
  gap: 12px;
}
.accept-offer-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}
.accept-offer-form select {
  min-width: 190px;
}
.login-workspace {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-workspace .page {
  padding: 30px;
}
.login-card {
  margin: auto;
  padding: 40px;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 20px 60px #1717170a;
}
.login-card .brand {
  margin-bottom: 44px;
}
.login-card h1 {
  font-size: 27px;
}
.login-card > p {
  margin-bottom: 30px;
}
.login-card > small {
  display: block;
  text-align: center;
  margin-top: 24px;
}
.alert {
  background: #fff1f1;
  color: #a61e1e;
  padding: 14px;
  border-radius: 5px;
  margin-bottom: 20px;
  font-size: 12px;
  line-height: 1.6;
}
.error-panel {
  padding: 40px;
}
.error-panel .button {
  margin-top: 25px;
}
@media (min-width: 1600px) {
  .page {
    padding-top: 55px;
  }
}
@media (max-width: 1150px) {
  :root {
    --sidebar: 210px;
  }
  .sidebar {
    padding: 28px 17px;
  }
  .brand {
    font-size: 18px;
  }
  .brand small {
    font-size: 7px;
  }
  .page {
    padding: 30px 26px;
  }
  .topbar {
    padding: 0 26px;
  }
  .metric {
    padding: 18px;
  }
  .value-metric > strong {
    font-size: 19px;
  }
  th,
  td {
    padding-left: 17px;
    padding-right: 17px;
  }
  .topbar-right {
    display: none;
  }
}
@media (max-width: 850px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .page-heading {
    align-items: flex-start;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .detail-grid {
    gap: 24px;
  }
  .contact summary .muted {
    display: block;
  }
}
@media (max-width: 650px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px;
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 18px;
  }
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 18px;
  }
  nav a {
    padding: 9px;
    font-size: 11px;
    gap: 5px;
  }
  nav a span {
    font-size: 14px;
    width: 14px;
  }
  .workspace {
    margin-left: 0;
  }
  .topbar {
    height: 48px;
    padding: 0 19px;
    font-size: 10px;
  }
  .page {
    padding: 28px 18px;
  }
  h1 {
    font-size: 27px;
  }
  .page-heading {
    gap: 14px;
    flex-wrap: wrap;
  }
  .page-heading p {
    font-size: 12px;
  }
  .metrics {
    gap: 11px;
  }
  .metric {
    padding: 17px;
  }
  .metric > strong {
    font-size: 28px;
  }
  .value-metric > strong {
    font-size: 18px;
  }
  .panel-heading {
    padding: 18px;
    flex-wrap: wrap;
  }
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .filters {
    flex-wrap: wrap;
    padding: 18px;
  }
  .filters label {
    width: 100%;
  }
  .filters .search-label {
    min-width: 0;
  }
  .form-panel,
  .panel-body {
    padding: 21px;
  }
  .detail-grid {
    padding: 22px;
  }
  .page-footer {
    padding: 20px 18px;
    font-size: 9px;
    gap: 15px;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .login-card {
    padding: 30px;
  }
  .login-workspace .page {
    padding: 18px;
  }
}

.mobile-signout {
  display: none;
}
.mobile-signout button {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 10px;
  padding: 5px;
  white-space: nowrap;
}
@media (max-width: 650px) {
  .mobile-signout {
    display: block;
  }
  .table-wrap table {
    min-width: 650px;
  }
}

.rate-display {
  cursor: pointer;
}
.offer-pricing-table input[type="hidden"] {
  display: none !important;
}
@page {
  size: A4 landscape;
  margin: 10mm;
}
@media print {
  html,
  body {
    width: 277mm;
    min-width: 0;
    margin: 0;
    background: #fff;
  }
  .sidebar,
  .topbar,
  .page-footer,
  .map-scale-controls {
    display: none !important;
  }
  .workspace {
    width: 277mm;
    min-height: 0;
    margin: 0;
    display: block;
  }
  .workspace > .page {
    width: 277mm;
    padding: 0;
  }
  .workspace > .page > * {
    display: none !important;
  }
  #project-map-panel {
    display: block !important;
    width: 277mm;
    margin: 0;
    padding: 0;
    border: 0;
    color: #111;
  }
  #project-map-panel h2 {
    display: none;
  }
  #project-map-panel .map-project-heading,
  #project-map-panel .map-coordinate-label,
  #project-map-panel .map-scale-print-label {
    margin: 0 0 1mm;
    font-size: 8pt;
    line-height: 1.2;
  }
  #project-map-panel .map-scale-print-label {
    display: block;
  }
  #project-map-panel .project-map-preview {
    width: 277mm;
    margin: 1mm 0 0;
  }
  #project-map-panel .map-image-wrap {
    width: 277mm;
    height: 165mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  #project-map-panel .map-preview-credit {
    margin-top: 1mm;
    font-size: 8pt;
  }
}

/* Offer stages and document content share the draft autosave flow. */
.pricing-option-heading td {
  background: #fff;
  border-top: 2px solid #252525;
  padding: 14px 6px 8px;
}
.pricing-option-bar {
  display: flex;
  gap: 14px;
  align-items: end;
}
.pricing-option-bar label {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.offer-pricing-table .pricing-option-title {
  display: block;
  width: 100%;
  font-size: 19px;
  font-weight: 700;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px;
}
.pricing-option-title:focus {
  border-color: var(--accent);
  background: #fff;
}
.pricing-option-bar button {
  white-space: nowrap;
  font-size: 12px;
}
.pricing-option-totals {
  width: 340px;
  max-width: 100%;
}
.pricing-option-total {
  display: grid;
  gap: 4px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  background: #f8f9fa;
}
.pricing-option-total > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.option-total-title {
  font-size: 14px;
}
.pricing-group-heading td {
  background: #fafafa;
  border-top: 2px solid #252525;
  padding: 12px 6px 8px;
}
.pricing-group-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}
.offer-pricing-table .pricing-group-title {
  flex: 1;
  min-width: 100px;
  font-size: 15px;
  font-weight: 650;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px;
}
.offer-pricing-table .pricing-group-title:focus {
  border-color: var(--accent);
  background: #fff;
}
.pricing-group-bar button {
  white-space: nowrap;
  font-size: 12px;
}
.pricing-group-bar button:disabled {
  color: #ccc;
  cursor: default;
}
.item-options-fields {
  flex-wrap: wrap;
  padding: 10px;
  background: #fafafa;
  border: 1px solid var(--line);
  margin: 6px 0;
}
.item-options-fields .item-group {
  width: 130px;
}
#pricing-group-summary p {
  margin: 4px 0;
  font-size: 12px;
}
.travel-table-help {
  max-width: 480px;
  font-size: 11px;
  line-height: 1.5;
}
.offer-document {
  border-top: 2px solid #252525;
  margin-top: 26px;
  scroll-margin-top: 20px;
}
.offer-document .panel-heading,
.offer-document .panel-body {
  padding-left: 0;
  padding-right: 0;
}
.offer-document .panel-heading {
  border-bottom: 0;
}
.document-section-list {
  display: grid;
  gap: 18px;
}
.document-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.document-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #f6f6f6;
}
.document-section-heading input {
  font-weight: 650;
  background: transparent;
  border: 0;
  flex: 1;
  min-width: 0;
  margin: 0;
}
.section-tools {
  display: flex;
  gap: 16px;
}
.document-format-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
}
.document-format-tools span {
  font-size: 11px;
}
.document-section .document-body {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.65;
  resize: vertical;
  min-height: 130px;
}
.terms-choice {
  max-width: 480px;
  margin-top: 22px;
}
.offer-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.offer-attachment {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  padding-bottom: 12px;
}
.offer-attachment img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f6f6f6;
  display: block;
}
.offer-attachment > div,
.offer-attachment > p {
  padding: 12px 14px 0;
}
.offer-attachment label {
  font-size: 12px;
}
.offer-attachment small {
  display: block;
  margin: 6px 0;
}
.project-photo-import {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.project-photo-import > div {
  display: grid;
  gap: 4px;
  margin-right: auto;
}
.project-photo-import label {
  width: min(220px, 100%);
  margin: 0;
}
.attachment-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.attachment-upload label {
  max-width: 230px;
  margin: 0;
}
.attachment-upload button {
  margin-bottom: 1px;
}
#offer-image-status {
  width: 100%;
  color: var(--accent);
  margin: 0;
}
@media (max-width: 700px) {
  .compact-offer .offer-totals {
    width: 100%;
  }
  .offer-table-footer > div {
    width: 100%;
  }
  .offer-attachments {
    grid-template-columns: 1fr;
  }
}
.travel-breakdown {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}
.travel-breakdowns-editor {
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.travel-breakdowns-editor > .panel-heading {
  padding: 16px 0 10px;
  border-bottom: 0;
}
.travel-breakdowns-editor > .panel-body {
  padding: 8px 0;
}
.travel-breakdown-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--surface-muted, #f6f7f8);
}
.travel-breakdown-heading > input {
  flex: 1;
  min-width: 120px;
  font-weight: 650;
  padding: 6px 8px;
}
.travel-option-assignment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 0;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.travel-option-assignment select {
  min-height: 28px;
  padding: 2px 6px;
  font-size: 12px;
}
.travel-option-assignment[hidden] {
  display: none !important;
}
.travel-table-scroll {
  overflow-x: auto;
}
.travel-cost-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}
.travel-cost-table th,
.travel-cost-table td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.travel-cost-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.travel-cost-table th:nth-child(1),
.travel-cost-table td:nth-child(1) {
  width: 19%;
}
.travel-cost-table th:nth-child(2),
.travel-cost-table td:nth-child(2) {
  width: 38%;
}
.travel-cost-table th:nth-child(3),
.travel-cost-table td:nth-child(3) {
  width: 18%;
}
.travel-cost-table th:nth-child(4),
.travel-cost-table td:nth-child(4) {
  width: 20%;
}
.travel-cost-table th:nth-child(5),
.travel-cost-table td:nth-child(5) {
  width: 5%;
}
.travel-cost-table td:first-child {
  min-width: 120px;
  font-weight: 550;
}
.travel-cost-table td:nth-child(2) {
  min-width: 370px;
  white-space: nowrap;
}
.travel-cost-table input:not([type="hidden"]) {
  display: inline-block;
  vertical-align: middle;
  width: 58px;
  height: 26px;
  min-height: 26px;
  margin: 0;
  padding: 2px 4px;
  font-size: 12px;
}
.travel-cost-table td:nth-child(2) input {
  width: 48px;
}
.travel-cost-table td:nth-child(4) input {
  width: 72px;
}
.travel-cost-table td:first-child input {
  width: 100%;
}
.travel-cost-table .travel-amount,
.travel-cost-table .travel-amount-heading {
  text-align: right;
  white-space: nowrap;
}
.travel-cost-table tfoot td {
  border-bottom: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}
.travel-cost-table [data-cost="other"] td:nth-child(2) {
  color: var(--muted);
}
.travel-cost-table tr[hidden],
.travel-add-lines button[hidden] {
  display: none;
}
.travel-breakdown-footer {
  padding: 0 9px 8px;
}
.travel-add-lines {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 11px;
}
.travel-total-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 5px 0 0;
}
.travel-total {
  font-weight: 650;
}
.travel-linked {
  font-size: 11px;
}
@media (max-width: 700px) {
  .travel-breakdown-heading {
    flex-wrap: wrap;
  }
  .travel-breakdown-heading > input {
    flex-basis: 100%;
  }
  .travel-cost-table {
    min-width: 630px;
  }
}
.travel-total-bar [hidden] {
  display: none;
}
.document-section > summary {
  cursor: pointer;
  list-style: none;
}
.document-section > summary::-webkit-details-marker {
  display: none;
}
.document-section > summary::before {
  content: "▸";
  color: var(--muted);
}
.document-section[open] > summary::before {
  content: "▾";
}
#offer-archive-status {
  width: 100%;
  color: var(--accent);
}

/* Invoice tables use the same compact pricing layout as offers. */
.invoice-metadata { margin-bottom: 24px; }
#invoice-form .offer-totals { margin-left: auto; }
.invoice-pricing-table .amount, .invoice-readonly-table .amount, .invoice-summary .amount { text-align: right; }
#add-invoice-stage, .invoice-stage-toolbar .text-link { background: transparent; border: 0; color: var(--accent); font: inherit; font-size: 12px; padding: 4px; cursor: pointer; }
.invoice-stage-toolbar { display: flex; align-items: center; gap: 12px; }
.invoice-stage-toolbar .remove-item { background: transparent; border: 0; color: var(--muted); padding: 4px; cursor: pointer; }
.invoice-stage-toolbar .pricing-group-title { flex: 1; min-width: 0; }
.invoice-stage-toolbar .text-link { white-space: nowrap; }
.invoice-pricing-table .invoice-rate, .invoice-pricing-table .invoice-fixed-price { width: 100%; text-align: right; }
.invoice-row[data-fixed="yes"] .invoice-rate,
.invoice-row[data-fixed="yes"] .quantity-unit input,
.invoice-row[data-fixed="no"] .invoice-fixed-price { display: none; }
.invoice-row[data-fixed="yes"] .invoice-line-total { display: none; }
.invoice-row[data-fixed="yes"][data-discounted="yes"] .invoice-line-total { display: block; font-size: 11px; color: var(--muted); }
.invoice-stage-subtotal td { padding: 6px; font-size: 12px; background: #fafafa; }
.invoice-stage-subtotal td:first-child { text-align: right; }
#invoice-save-status { font-size: 11px; color: var(--muted); max-width: 340px; }
#invoice-save-status[data-state="error"] { color: var(--accent); }
.invoice-stage-readonly { margin-bottom: 24px; }
.invoice-readonly-table th:first-child { width: 57%; }
.invoice-readonly-table th:nth-child(2) { width: 8%; }
.invoice-readonly-table th:nth-child(3) { width: 15%; }
.invoice-readonly-table th:nth-child(4) { width: 20%; }
.invoice-readonly-table tfoot td { font-weight: 600; }
.invoice-readonly-table tfoot td:first-child { text-align: right; }
.invoice-readonly-table .subitem td:first-child { padding-left: 24px; }
.invoice-summary { margin: 20px 0 0 auto; width: min(100%, 520px); }
.invoice-summary td, .invoice-summary th { padding: 8px; font-size: 14px; }
.invoice-summary th:first-child { text-align: left; }
.invoice-summary .gross-total > * { border-top: 1px solid #111; border-bottom: 2px solid #111; }
.badge.issued { color: #b32626; background: #fff1f1; }
.badge.paid { color: white; background: #171717; }

.billing-balance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.billing-balance-grid span, .billing-balance-grid strong { display: block; }
.billing-balance-grid span { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.billing-balance-grid strong { font-size: 1.15rem; }
.billing-over-budget { color: #b00000; }
.billing-history-items { min-width: 260px; }
@media (max-width: 800px) { .billing-balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.invoice-reference-editor { border-top: 1px solid var(--line); }
.invoice-reference-editor .offer-table-toolbar { padding: 0; border: 0; }
.invoice-reference-editor h2 { font-size: 1rem; }
.invoice-reference-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(140px, 2fr) 30px; gap: 8px; align-items: center; margin-top: 8px; }
.invoice-reference-row input { padding: 7px 9px; min-width: 0; }

.overview-metrics .metric { color: var(--ink); padding: 20px; }
.overview-metrics .metric:hover { text-decoration: none; border-color: #c7c7c7; }
.overview-metrics .metric > strong { margin: 12px 0 0; font-size: 28px; }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.overview-columns .panel-heading { align-items: center; gap: 16px; }
.overview-columns .panel-heading h2 { margin: 0; }
.overview-columns th, .overview-columns td { padding: 14px 18px; }
.overview-columns .overview-due { white-space: nowrap; }
@media (max-width: 1100px) { .overview-columns { grid-template-columns: 1fr; gap: 0; } }

.document-completion-note { margin: 6px 16px; color: #ad2525; font-size: 12px; font-weight: 600; }
