@font-face {
  font-family: Geist;
  src: url("/static/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Geist;
  src: url("/static/fonts/geist-cyrillic-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #252525;
  --muted: #737373;
  --line: #e5e5e5;
  --paper: #fff;
  --canvas: #fafafa;
  --primary: oklch(0.705 0.213 47.604);
  --primary-hover: oklch(0.646 0.222 41.116);
  --primary-ink: oklch(0.98 0.016 73.684);
  --soft: #f5f5f5;
  --red: #dc2626;
  /* Chart palette. Profit wears the brand accent because it is the number that
     matters; parts cost recedes to grey; loss is the status red. The pair was
     checked for colour-blind separation, and every figure is also written out
     in the legend, the tooltips and the table under the chart, so colour never
     carries a value on its own. */
  --viz-profit: #ea580c;
  --viz-cost: #a3a3a3;
  --viz-loss: #d03b3b;
  --sidebar: #2b2b2b;
  --sidebar-muted: #a3a3a3;
  --sidebar-active: #404040;
  --radius: 0.625rem;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  font-family:
    Geist,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  font-size: 16px;
  font-synthesis: none;
}
html {
  scroll-behavior: smooth;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 1.875rem;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-bottom: 0.45rem;
  font-weight: 750;
}
h2 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 650;
}
h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.muted {
  color: var(--muted);
}
.preline {
  white-space: pre-line;
}
.block {
  display: block;
}
.align-right {
  text-align: right;
}
.eyebrow {
  display: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  object-fit: cover;
}
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 256px;
  padding: 1rem;
  background: var(--sidebar);
  color: #fafafa;
  border-right: 1px solid #3d3d3d;
  display: flex;
  flex-direction: column;
}
.sidebar > .brand {
  padding: 0.25rem 0.5rem;
}

.sidebar nav {
  display: grid;
  gap: 0.2rem;
  margin-top: 2rem;
}
.sidebar nav a {
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  color: #d4d4d4;
  font-weight: 500;
  font-size: 0.9rem;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--sidebar-active);
  color: #fff;
  text-decoration: none;
}
.sidebar nav a.active {
  font-weight: 600;
}
.sidebar-user {
  margin-top: auto;
  border-top: 1px solid #424242;
  padding-top: 0.8rem;
  display: grid;
  gap: 0.3rem;
}
.sidebar-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem;
  border-radius: 0.55rem;
}
.sidebar-profile:hover,
.sidebar-profile.active {
  background: var(--sidebar-active);
  text-decoration: none;
}
.user-avatar {
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #525252;
  border-radius: 50%;
  background: #383838;
  color: #e5e5e5;
}
.user-details {
  min-width: 0;
  display: grid;
  line-height: 1.25;
}
.user-details strong {
  overflow: hidden;
  color: #fafafa;
  font-size: 0.85rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-details small {
  color: var(--sidebar-muted);
  font-size: 0.72rem;
}
.sidebar-user form {
  display: flex;
}
.sidebar-logout {
  width: 100%;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--sidebar-muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.sidebar-logout:hover {
  border-color: #737373;
  background: #3a3a3a;
  color: #fff;
}
.main {
  margin-left: 256px;
  max-width: 1500px;
  padding: 2.25rem 3rem 5rem;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.page-header p:last-child {
  margin-bottom: 0;
}
.header-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.title-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.back {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid #d4d4d4;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.025);
}
.button:hover {
  background: #fafafa;
  border-color: #bfbfbf;
  text-decoration: none;
}
.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  font-weight: 650;
}
.button.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.button.danger {
  color: var(--red);
  border-color: #fecaca;
}
.button.danger:hover {
  background: #fef2f2;
}
.button.wide {
  width: 100%;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.panel-header p {
  margin: 0;
}
.panel-header a {
  font-size: 0.85rem;
  font-weight: 550;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.stats a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  box-shadow: var(--shadow);
}
.stats a:hover {
  text-decoration: none;
  border-color: #d4d4d4;
}
.stats strong {
  font-size: 1.55rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stats .money-stat {
  font-size: 1.1rem;
}
.dashboard-grid,
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.list {
  display: grid;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row:hover {
  background: #fafafa;
  text-decoration: none;
}
.list-row div {
  display: grid;
}
.list-row span {
  font-size: 0.8rem;
  color: var(--muted);
}
.empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
}
.filters {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.filters > input[type="search"] {
  width: min(32rem, 50vw);
}
.filters.compact select {
  width: 12rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.check input {
  width: auto;
  accent-color: var(--primary);
}
input,
textarea,
select {
  width: 100%;
  padding: 0.57rem 0.68rem;
  border: 1px solid #d4d4d4;
  border-radius: 0.45rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.705 0.213 47.604 / 0.16);
}
textarea {
  resize: vertical;
}
.uppercase {
  text-transform: uppercase;
}
.form-panel {
  padding: 1.35rem;
  max-width: 900px;
}
.profile-grid {
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}
.profile-panel .panel-header {
  align-items: flex-start;
}
.profile-panel .panel-header p {
  margin-top: 0.25rem;
  font-size: 0.82rem;
}
.profile-form {
  padding: 1.2rem;
}
.profile-form input:disabled {
  background: var(--soft);
  color: var(--muted);
  cursor: not-allowed;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 1rem;
}
.form-stack {
  display: grid;
  gap: 1rem;
}
.form-grid label,
.form-stack label {
  display: grid;
  gap: 0.38rem;
  font-size: 0.84rem;
  font-weight: 550;
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.35rem;
}
.field-error {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 550;
}
.hint {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--muted);
}
.form-alert {
  padding: 0.7rem 0.8rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 0.5rem;
  font-size: 0.85rem;
}
.form-alert.inset {
  margin: 1rem;
}
.flash {
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.2rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 0.55rem;
  color: #9a3412;
  font-weight: 550;
  font-size: 0.88rem;
}
.auth-shell {
  min-height: 100vh;
  background: color-mix(in oklch, var(--soft) 50%, white);
}
.auth-main {
  width: min(100% - 2rem, 560px);
  margin: 0 auto;
  padding: 4rem 0;
}
.auth-brand {
  width: max-content;
  margin: 0 auto 1.5rem;
  font-size: 1.5rem;
}
.auth-brand .brand-mark {
  width: 2.25rem;
  height: 2.25rem;
}
.auth-card {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  max-width: 384px;
  margin: 0 auto;
}
.auth-card.wide-card {
  width: 680px;
  max-width: calc(100vw - 2rem);
  margin-left: 50%;
  transform: translateX(-50%);
}
.auth-card-header {
  text-align: center;
  margin-bottom: 1.35rem;
}
.auth-card-header h1 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}
.auth-card-header p {
  font-size: 0.875rem;
  margin: 0;
}
.auth-switch {
  text-align: center;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.auth-switch a,
.forgot-link {
  color: var(--ink);
  font-weight: 550;
}
.forgot-link {
  justify-self: end;
  font-size: 0.8rem;
  color: var(--muted);
}
.table-panel {
  overflow-x: auto;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.84rem;
}
.pagination p {
  margin: 0;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.pagination .disabled {
  color: #a3a3a3;
  background: var(--soft);
  cursor: default;
  box-shadow: none;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
  background: #fafafa;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #fdfdfd;
}
tr.archived {
  opacity: 0.62;
}
.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.strong-link {
  font-weight: 650;
  color: var(--ink);
}
.stacked {
  display: grid;
}
.stacked small {
  color: var(--muted);
}
.tag,
.status {
  display: inline-block;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  color: #525252;
  font-size: 0.72rem;
  font-weight: 600;
}
.plate {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: 0.035em;
  color: var(--ink);
}
.plate-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.035em;
}
.details {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.75rem 1rem;
  padding: 1.2rem;
  margin: 0;
}
.details dt {
  font-size: 0.78rem;
  color: var(--muted);
}
.details dd {
  margin: 0;
  font-size: 0.88rem;
}
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fff;
}
.danger-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.vehicle-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.vehicle-strip div {
  display: grid;
  padding: 1rem 1.2rem;
  border-right: 1px solid var(--line);
}
.vehicle-strip div:last-child {
  border: 0;
}
.vehicle-strip span,
.party-grid span,
.document-notes span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
}
.timeline {
  padding: 1.2rem;
}
.timeline article {
  position: relative;
  padding: 0 0 1.4rem 1.4rem;
  border-left: 1px solid #d4d4d4;
}
.timeline article:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}
.timeline time {
  font-size: 0.72rem;
  color: var(--muted);
}
.timeline h3 {
  margin: 0.15rem 0;
}
.timeline p {
  font-size: 0.85rem;
  margin: 0.25rem 0;
}
.timeline a {
  font-size: 0.78rem;
  color: var(--muted);
}
.offer-editor {
  display: grid;
  gap: 1rem;
}
.offer-editor .form-panel {
  max-width: none;
}
.item-editor input,
.item-editor select {
  min-width: 100px;
}
.item-editor td:nth-child(2) {
  width: 60%;
}
.item-editor td:nth-child(2) input {
  min-width: 260px;
}
.item-editor .item-row-action {
  width: 1%;
  padding-left: 0.25rem;
}
.remove-row {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}
.remove-row:hover {
  background: #fef2f2;
  color: var(--red);
}
.table-scroll {
  overflow-x: auto;
}
.sticky-actions {
  position: sticky;
  bottom: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.75rem;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 0.65rem;
}
.document {
  width: 100%;
  padding: 2.2rem;
}
.document-header,
.party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.document-header {
  padding-bottom: 1.7rem;
  border-bottom: 2px solid var(--ink);
}
.document-header h2,
.document-header h1 {
  margin-bottom: 0.3rem;
}
.document-header p,
.party-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.document-header > .align-right > strong {
  font-size: 1.6rem;
  letter-spacing: 0.12em;
}
.party-grid {
  padding: 1.5rem 0;
}
.party-grid > div {
  display: grid;
  align-content: start;
}
.party-grid strong {
  font-size: 1.05rem;
  margin: 0.25rem 0;
}
.document table {
  margin-top: 0.5rem;
}
.totals {
  width: min(100%, 380px);
  margin: 1.2rem 0 0 auto;
}
.totals div {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
}
.totals .grand-total {
  font-size: 1.15rem;
  border-top: 2px solid var(--ink);
  margin-top: 0.4rem;
  padding-top: 0.7rem;
}
.document-notes {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.document-notes p {
  font-size: 0.85rem;
}
.repair-document {
  margin-bottom: 1rem;
}
.completion-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.2rem;
}
.completion-panel p {
  max-width: 650px;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.completion-panel form {
  display: flex;
  align-items: end;
  gap: 0.6rem;
}
.completion-panel label {
  display: grid;
  gap: 0.3rem;
  min-width: 190px;
  font-size: 0.8rem;
  font-weight: 550;
}
.print-page {
  background: #e5e5e5;
}
.print-toolbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--sidebar);
  color: #fff;
  font-size: 0.85rem;
  z-index: 2;
}
.print-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 1.5rem auto;
  padding: 18mm;
  background: #fff;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.14);
}
.print-title {
  font-size: 1.8rem !important;
  letter-spacing: 0.12em;
}
.print-sheet table {
  margin-top: 1rem;
}
.print-sheet .party-grid {
  padding: 2rem 0;
}
/* Dashboard stat tiles */
.stat-body {
  display: grid;
  gap: 0.15rem;
  width: 100%;
}
.stat-body > span {
  font-size: 0.8rem;
}
.stat-body .money-stat {
  font-size: 1.5rem;
  line-height: 1.2;
}
.stat-body small {
  font-size: 0.75rem;
  line-height: 1.35;
}
.delta {
  font-weight: 600;
  color: var(--muted);
}
/* The arrow, not the colour, carries the direction. */
.delta.is-up::before {
  content: "↑ ";
}
.delta.is-down::before {
  content: "↓ ";
}
.delta.is-up {
  color: #0a7d0a;
}
.delta.is-down {
  color: #b93030;
}
.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.counters a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.85rem;
}
.counters a:hover {
  text-decoration: none;
  border-color: #d4d4d4;
}
.counters strong {
  color: var(--ink);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

/* Charts */
.chart-panel {
  margin-bottom: 1rem;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.legend-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.legend-key i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.key-profit {
  background: var(--viz-profit);
}
.key-cost {
  background: var(--viz-cost);
}
.key-loss {
  background: var(--viz-loss);
}
/* The columns keep their proportions on a narrow screen by scrolling, rather
   than shrinking the month labels into illegibility. */
.chart {
  overflow-x: auto;
  padding: 1.1rem 1.2rem 0.2rem;
}
.chart svg {
  display: block;
  width: 100%;
  min-width: 520px;
  height: auto;
}
.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.chart-axis,
.chart-month,
.chart-year {
  fill: var(--muted);
  font-size: 11px;
}
.chart-year {
  font-size: 10px;
}
.chart-profit {
  fill: var(--viz-profit);
}
.chart-cost {
  fill: var(--viz-cost);
}
.chart-loss {
  fill: var(--viz-loss);
}
.chart-band {
  fill: transparent;
}
.chart-bar:hover .chart-band {
  fill: rgba(0, 0, 0, 0.035);
}
.chart-bar.is-current .chart-month {
  fill: var(--ink);
  font-weight: 650;
}
.chart-hint {
  margin: 0.2rem 1.2rem 1.1rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.chart-table {
  border-top: 1px solid var(--line);
}
.chart-table summary {
  padding: 0.7rem 1.2rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
}
.chart-table[open] summary {
  border-bottom: 1px solid var(--line);
}

/* Revenue split bars */
.split-bars {
  display: grid;
  gap: 1.1rem;
  padding: 1.1rem 1.2rem;
}
.split-head,
.split-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.split-head strong {
  font-size: 0.92rem;
}
.split-head span,
.split-foot {
  font-size: 0.76rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* A 2px gap in the surface colour separates the segments; no stroke is drawn
   around the marks. */
.split-track {
  display: flex;
  gap: 2px;
  height: 14px;
  margin: 0.4rem 0 0.3rem;
}
.split-track span {
  display: block;
  border-radius: 0;
}
.split-track span:last-child {
  border-radius: 0 4px 4px 0;
}
.seg-profit {
  background: var(--viz-profit);
}
.seg-cost {
  background: var(--viz-cost);
}
.seg-loss {
  background: var(--viz-loss);
}

/* Internal margin panel */
.margin-panel {
  margin-top: 1rem;
}
.margin-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.1rem 1.2rem;
}
.margin-figures > div {
  display: grid;
  gap: 0.15rem;
}
.margin-figures span {
  font-size: 0.78rem;
  color: var(--muted);
}
.margin-figures strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.margin-figures small {
  font-size: 0.75rem;
  color: var(--muted);
}
.margin-result strong {
  color: var(--primary-hover);
}
.margin-empty {
  padding: 1.1rem 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.margin-empty p {
  margin: 0;
}
.profit {
  font-variant-numeric: tabular-nums;
}
/* The supplier price is internal: tinting the column keeps that visible while
   editing a document the customer will read. */
.item-editor .cost-column {
  background: #fafafa;
}
.empty .button {
  margin-top: 0.9rem;
}

/* Public landing page */
.landing-shell {
  min-height: 100vh;
  overflow-x: hidden;
  background: #fff;
}
.landing-container {
  width: min(1180px, calc(100% - 3rem));
  margin-inline: auto;
}
.landing-nav {
  position: relative;
  z-index: 20;
  height: 76px;
  border-bottom: 1px solid rgba(37, 37, 37, 0.08);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}
.landing-nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.landing-brand {
  font-size: 1.28rem;
  letter-spacing: -0.04em;
}
.landing-brand .brand-mark {
  width: 2.15rem;
  height: 2.15rem;
}
.landing-nav nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  color: #5f5f5f;
  font-size: 0.88rem;
  font-weight: 550;
}
.landing-nav nav a:hover,
.landing-login:hover {
  color: var(--primary-hover);
  text-decoration: none;
}
.landing-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.landing-login {
  font-size: 0.88rem;
  font-weight: 600;
}
.landing-nav .button {
  min-height: 2.55rem;
  padding-inline: 1rem;
}
.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 7rem 0 7.5rem;
  background:
    radial-gradient(
      circle at 75% 42%,
      rgba(249, 115, 22, 0.08),
      transparent 30rem
    ),
    #fbfaf7;
}
.landing-hero::before {
  content: "";
  position: absolute;
  width: 34rem;
  height: 34rem;
  right: -17rem;
  top: -19rem;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 5rem rgba(249, 115, 22, 0.025),
    0 0 0 10rem rgba(249, 115, 22, 0.018);
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(560px, 1.14fr);
  align-items: center;
  gap: 3.25rem;
}
.landing-kicker {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  color: #c85107;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.landing-kicker > span {
  width: 1.8rem;
  height: 2px;
  background: var(--primary);
}
.hero-copy h1 {
  max-width: 650px;
  margin-bottom: 1.5rem;
  font-size: clamp(3.2rem, 5.3vw, 5.15rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 790;
}
.hero-copy h1 em {
  color: var(--primary-hover);
  font-style: normal;
}
.hero-lead {
  max-width: 590px;
  margin-bottom: 2rem;
  color: #626262;
  font-size: 1.08rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.landing-cta {
  min-height: 3.15rem;
  gap: 1.2rem;
  padding: 0.75rem 1.2rem;
  border-radius: 0.55rem;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.16);
}
.landing-cta span {
  font-size: 1.15rem;
}
.hero-secondary {
  color: #5d5d5d;
  font-size: 0.87rem;
  font-weight: 600;
}
.hero-secondary span {
  margin-left: 0.35rem;
  color: var(--primary-hover);
}
.hero-secondary:hover {
  color: var(--ink);
  text-decoration: none;
}
.hero-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1.35rem 0 0;
  color: #858585;
  font-size: 0.78rem;
}
.hero-note svg {
  color: var(--primary-hover);
}
.product-preview {
  position: relative;
  width: 700px;
  transform: perspective(1300px) rotateY(-2deg) rotateX(1deg);
  transform-origin: center;
}
.product-preview::before {
  content: "";
  position: absolute;
  inset: 12% -10% -10% 15%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(234, 88, 12, 0.15);
  filter: blur(70px);
}
.preview-window {
  overflow: hidden;
  border: 1px solid #d8d6d1;
  border-radius: 0.85rem;
  background: #fff;
  box-shadow:
    0 30px 70px rgba(48, 38, 28, 0.15),
    0 3px 12px rgba(48, 38, 28, 0.08);
}
.preview-bar {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  border-bottom: 1px solid #e8e8e8;
  background: #f8f8f7;
}
.preview-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d6d6d3;
}
.preview-bar span {
  margin-left: auto;
  margin-right: auto;
  color: #aaa;
  font-size: 7px;
}
.preview-shell {
  min-height: 390px;
  display: grid;
  grid-template-columns: 116px 1fr;
  background: #f7f7f6;
}
.preview-sidebar {
  padding: 15px 11px;
  background: #292929;
  color: #fff;
}
.preview-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 3px 20px;
  font-size: 10px;
}
.preview-logo img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}
.preview-sidebar ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #bcbcbc;
  font-size: 7px;
}
.preview-sidebar li {
  padding: 7px 8px;
  border-radius: 4px;
}
.preview-sidebar li.selected {
  background: #414141;
  color: #fff;
  font-weight: 650;
}
.preview-content {
  min-width: 0;
  padding: 23px 22px;
}
.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.preview-heading > div {
  display: grid;
}
.preview-heading b {
  font-size: 14px;
}
.preview-heading small,
.preview-card-title small {
  color: #999;
  font-size: 7px;
}
.preview-heading > span {
  padding: 7px 9px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 7px;
  font-weight: 650;
}
.preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.preview-stats > div,
.preview-chart-card,
.preview-list-card {
  border: 1px solid #e5e5e3;
  border-radius: 6px;
  background: #fff;
}
.preview-stats > div {
  display: grid;
  padding: 12px;
}
.preview-stats small {
  color: #878787;
  font-size: 7px;
}
.preview-stats strong {
  margin: 3px 0;
  font-size: 17px;
  letter-spacing: -0.04em;
}
.preview-stats em {
  color: #888;
  font-size: 6px;
  font-style: normal;
}
.preview-stats > div:first-child em {
  color: #27824c;
}
.preview-panels {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 8px;
}
.preview-chart-card,
.preview-list-card {
  height: 202px;
  padding: 13px;
}
.preview-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.preview-card-title b {
  font-size: 8px;
}
.preview-chart {
  height: 125px;
  display: flex;
  align-items: end;
  gap: 9px;
  padding: 18px 9px 0;
  border-bottom: 1px solid #ddd;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 30px,
    #eeeeec 31px
  );
}
.preview-chart span {
  width: 22px;
  height: var(--bar);
  border-radius: 2px 2px 0 0;
  background: #bdbdb8;
}
.preview-chart span.current {
  background: var(--primary);
}
.preview-months {
  display: flex;
  justify-content: space-around;
  padding-top: 5px;
  color: #999;
  font-size: 5px;
}
.preview-list-card {
  display: grid;
  align-content: start;
}
.preview-job {
  display: grid;
  grid-template-columns: 23px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 11px 0;
  border-bottom: 1px solid #eeeeec;
}
.preview-job:last-child {
  border: 0;
}
.preview-job > i {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #f1f1ef;
  color: #777;
  font-size: 6px;
  font-style: normal;
}
.preview-job > span {
  display: grid;
}
.preview-job b {
  font-size: 6px;
}
.preview-job small {
  color: #999;
  font-size: 5px;
}
.preview-job > em {
  padding: 3px 4px;
  border-radius: 6px;
  background: #fff4e9;
  color: #bd550d;
  font-size: 5px;
  font-style: normal;
}
.preview-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid #e6e3dd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(35, 30, 25, 0.14);
  transform: rotateY(2deg) rotateX(-1deg);
}
.preview-badge > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ebf7ef;
  color: #25814a;
  font-size: 12px;
  font-weight: 800;
}
.preview-badge > div {
  display: grid;
}
.preview-badge b {
  font-size: 8px;
}
.preview-badge small {
  color: #999;
  font-size: 6px;
}
.preview-badge-top {
  top: -28px;
  right: -24px;
}
.preview-badge-bottom {
  bottom: -28px;
  left: -28px;
}
.preview-badge-bottom > span {
  background: #fff1e8;
  color: var(--primary-hover);
}
.landing-strip {
  border-block: 1px solid #eeeae5;
  background: #fff;
}
.landing-strip .landing-container {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8b8985;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.11em;
}
.landing-strip i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--primary);
}
.landing-section {
  padding: 8rem 0;
  background: #fff;
}
.section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 2rem;
  margin-bottom: 3.25rem;
}
.section-heading .landing-kicker {
  grid-column: 1 / -1;
  margin-bottom: -0.4rem;
}
.section-heading h2,
.workflow-copy h2,
.final-card h2 {
  margin: 0;
  font-size: clamp(2.4rem, 4.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 760;
}
.section-heading > p:last-child {
  max-width: 470px;
  margin: 0 0 0.25rem auto;
  color: #6f6f6f;
  font-size: 1rem;
  line-height: 1.7;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.feature-card {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  padding: 2rem;
  border: 1px solid #e8e7e3;
  border-radius: 0.8rem;
  background: #fafaf8;
}
.feature-card-wide {
  grid-column: 1 / -1;
  min-height: 360px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}
.feature-icon {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  margin-bottom: 2rem;
  border: 1px solid #fed7aa;
  border-radius: 0.65rem;
  background: #fff7ed;
  color: var(--primary-hover);
}
.feature-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-icon.dark {
  border-color: #555;
  background: #3c3c3c;
  color: #ffad72;
}
.feature-number {
  margin: 0 0 0.55rem;
  color: var(--primary-hover);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.feature-card h3 {
  max-width: 460px;
  margin-bottom: 0.7rem;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.feature-card > p:not(.feature-number),
.feature-card > div > p {
  max-width: 470px;
  color: #747474;
  font-size: 0.9rem;
  line-height: 1.65;
}
.mini-timeline {
  align-self: stretch;
  display: grid;
  align-content: center;
  padding: 1.5rem 2rem;
  border: 1px solid #e6e5e1;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 15px 35px rgba(30, 30, 30, 0.06);
}
.mini-timeline span {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem 0 1.4rem 1.5rem;
  border-left: 1px solid #ddd;
}
.mini-timeline span:last-child {
  padding-bottom: 0.5rem;
}
.mini-timeline i {
  position: absolute;
  top: 0.85rem;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.mini-timeline b {
  font-size: 0.76rem;
}
.mini-timeline small {
  color: #999;
  font-size: 0.67rem;
}
.mini-offer {
  position: absolute;
  right: 2rem;
  bottom: -1rem;
  left: 2rem;
  min-height: 175px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  padding: 1.5rem;
  border: 1px solid #e3e2de;
  border-radius: 0.65rem 0.65rem 0 0;
  background: #fff;
  box-shadow: 0 15px 35px rgba(30, 30, 30, 0.07);
  color: #777;
  font-size: 0.7rem;
}
.mini-offer > span {
  color: #999;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
}
.mini-offer > b {
  justify-self: end;
  color: #333;
  font-size: 0.72rem;
}
.mini-offer > i {
  grid-column: 1 / -1;
  height: 1px;
  margin-bottom: 0.4rem;
  background: #e8e8e5;
}
.mini-offer em {
  justify-self: end;
  color: #333;
  font-style: normal;
}
.mini-offer strong {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid #333;
  color: #222;
}
.feature-card-accent {
  border-color: #333;
  background: #2b2b2b;
  color: #fff;
}
.feature-card-accent .feature-number {
  color: #ff9c57;
}
.feature-card-accent > p:not(.feature-number) {
  color: #bdbdbd;
}
.mini-metric {
  position: absolute;
  right: 2rem;
  bottom: 1.5rem;
  left: 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 1.25rem;
  border: 1px solid #484848;
  border-radius: 0.6rem;
  background: #333;
}
.mini-metric small {
  grid-column: 1 / -1;
  color: #aaa;
  font-size: 0.65rem;
}
.mini-metric strong {
  margin-top: 0.2rem;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
}
.mini-metric > span {
  align-self: center;
  color: #6ed195;
  font-size: 0.68rem;
}
.mini-metric > div {
  grid-column: 1 / -1;
  height: 55px;
  display: flex;
  align-items: end;
  gap: 7px;
  margin-top: 0.7rem;
  border-bottom: 1px solid #555;
}
.mini-metric i {
  flex: 1;
  height: var(--h);
  border-radius: 2px 2px 0 0;
  background: #6d6d6d;
}
.mini-metric i:last-child {
  background: var(--primary);
}
.workflow-section {
  position: relative;
  overflow: hidden;
  padding: 8rem 0;
  background: #292929;
  color: #fff;
}
.workflow-section::after {
  content: "";
  position: absolute;
  width: 32rem;
  height: 32rem;
  left: -17rem;
  bottom: -19rem;
  border: 1px solid #4c3b30;
  border-radius: 50%;
  box-shadow:
    0 0 0 5rem rgba(249, 115, 22, 0.025),
    0 0 0 10rem rgba(249, 115, 22, 0.018);
}
.workflow-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 8rem;
}
.landing-kicker.light {
  color: #ff9d5b;
}
.workflow-copy > p:not(.landing-kicker) {
  max-width: 460px;
  margin: 1.5rem 0 2rem;
  color: #aaa;
  line-height: 1.7;
}
.landing-light-button {
  gap: 2rem;
  min-height: 3rem;
  padding-inline: 1.2rem;
  border-color: #fff;
  background: #fff;
}
.workflow-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.workflow-steps li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1.2rem;
  padding: 1.45rem 0;
  border-bottom: 1px solid #454545;
}
.workflow-steps li:first-child {
  padding-top: 0;
}
.workflow-steps li > span {
  padding-top: 0.15rem;
  color: #ff9c57;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.workflow-steps b {
  font-size: 1.08rem;
  font-weight: 620;
}
.workflow-steps p {
  margin: 0.3rem 0 0;
  color: #999;
  font-size: 0.84rem;
}
.landing-final {
  padding: 7rem 0;
  background: #fbfaf7;
}
.final-card {
  position: relative;
  overflow: hidden;
  padding: 5rem 2rem;
  border: 1px solid #ebe6df;
  border-radius: 1rem;
  background: #fff;
  text-align: center;
  box-shadow: 0 18px 60px rgba(49, 38, 28, 0.06);
}
.final-card::before,
.final-card::after {
  content: "";
  position: absolute;
  width: 16rem;
  height: 16rem;
  border: 1px solid #fee2cd;
  border-radius: 50%;
}
.final-card::before {
  top: -10rem;
  left: -7rem;
  box-shadow: 0 0 0 3rem #fff8f3;
}
.final-card::after {
  right: -7rem;
  bottom: -10rem;
  box-shadow: 0 0 0 3rem #fff8f3;
}
.final-mark {
  margin-bottom: 1.25rem;
}
.final-mark img {
  border-radius: 0.85rem;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.18);
}
.final-card .landing-kicker {
  justify-content: center;
}
.final-card h2 {
  font-size: clamp(2.7rem, 5vw, 4.5rem);
}
.final-card > p:not(.landing-kicker) {
  margin: 1rem 0 1.8rem;
  color: #747474;
}
.final-card .landing-cta {
  position: relative;
  z-index: 1;
}
.landing-footer {
  padding: 2.2rem 0;
  border-top: 1px solid #ece9e4;
  background: #fff;
}
.landing-footer .landing-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}
.landing-footer .landing-brand {
  font-size: 1rem;
}
.landing-footer .landing-brand .brand-mark {
  width: 1.8rem;
  height: 1.8rem;
}
.landing-footer p {
  margin: 0;
  color: #929292;
  font-size: 0.72rem;
}
.landing-footer > div > div {
  justify-self: end;
  display: flex;
  gap: 1.5rem;
  color: #666;
  font-size: 0.78rem;
  font-weight: 600;
}
.landing-shell a:focus-visible,
.landing-shell button:focus-visible {
  outline: 3px solid rgba(249, 115, 22, 0.35);
  outline-offset: 3px;
}

/* Demonstration garage */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.75rem 0.7rem 1rem;
  margin-bottom: 1.2rem;
  background: var(--sidebar);
  border-radius: 0.55rem;
  color: #e5e5e5;
  font-size: 0.86rem;
}
.demo-banner strong {
  color: #fff;
}
.demo-banner .button {
  min-height: 2.2rem;
  padding-block: 0.35rem;
  font-size: 0.8rem;
}
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}
.link-button:hover {
  text-decoration: underline;
}
.landing-nav-actions form,
.hero-actions form,
.final-actions form {
  display: contents;
}
.landing-demo-cta {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.final-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

@media (max-width: 1100px) {
  .landing-hero {
    padding-top: 5.5rem;
  }
  /* minmax(0, …) lets the column shrink below the fixed-width preview, which
     would otherwise stretch the headline off a phone screen. */
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-copy {
    max-width: 760px;
    text-align: center;
    margin-inline: auto;
  }
  .hero-copy .landing-kicker,
  .hero-actions,
  .hero-note {
    justify-content: center;
  }
  .hero-lead {
    margin-inline: auto;
  }
  .product-preview {
    width: min(700px, 88vw);
    margin: 2.5rem auto 0;
  }
  .workflow-grid {
    gap: 4rem;
  }
}
@media (max-width: 720px) {
  .landing-container {
    width: min(100% - 2rem, 1180px);
  }
  .landing-nav {
    height: 66px;
  }
  .landing-nav-inner {
    gap: 1rem;
  }
  .landing-nav nav,
  .landing-signup {
    display: none;
  }
  .landing-nav-actions {
    gap: 0.9rem;
  }
  .landing-nav-actions {
    margin-left: auto;
  }
  .landing-nav .button {
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.76rem;
  }
  .landing-hero {
    padding: 4.3rem 0 5rem;
  }
  .hero-copy h1 {
    font-size: clamp(2.8rem, 14vw, 4rem);
  }
  .hero-lead {
    font-size: 0.96rem;
  }
  .hero-actions {
    flex-direction: column;
    gap: 1.1rem;
  }
  .hero-actions {
    align-items: stretch;
    gap: 0.75rem;
  }
  .landing-cta {
    width: 100%;
    justify-content: center;
  }
  /* The preview is a fixed 700px desktop screenshot; on a phone it is scaled to
     the container (358px at 390px wide) and the space it no longer uses is
     taken back from the margin. */
  .product-preview {
    width: 700px;
    margin-left: 50%;
    transform: translateX(-50%) scale(0.5);
    transform-origin: top center;
    margin-bottom: -215px;
  }
  .preview-badge-top {
    right: 8px;
  }
  .preview-badge-bottom {
    left: 8px;
  }
  .landing-strip .landing-container {
    min-height: 70px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem 1.1rem;
    padding-block: 1rem;
    font-size: 0.58rem;
  }
  .landing-strip i:nth-of-type(even) {
    display: none;
  }
  .landing-section,
  .workflow-section {
    padding: 5rem 0;
  }
  .section-heading,
  .feature-grid,
  .feature-card-wide,
  .workflow-grid {
    grid-template-columns: 1fr;
  }
  .section-heading {
    gap: 1.25rem;
    margin-bottom: 2.2rem;
  }
  .section-heading > p:last-child {
    margin-left: 0;
  }
  .section-heading h2,
  .workflow-copy h2 {
    font-size: 2.6rem;
  }
  .feature-card,
  .feature-card-wide {
    min-height: 440px;
    padding: 1.4rem;
  }
  .feature-card-wide {
    gap: 1.5rem;
  }
  .feature-card-wide .feature-icon {
    margin-bottom: 1rem;
  }
  .mini-timeline {
    padding: 1rem 1.25rem;
  }
  .mini-offer,
  .mini-metric {
    right: 1.4rem;
    left: 1.4rem;
  }
  .workflow-grid {
    gap: 3.5rem;
  }
  .landing-light-button {
    width: 100%;
  }
  .landing-final {
    padding: 3.5rem 0;
  }
  .final-card {
    width: calc(100% - 2rem);
    padding: 3.5rem 1.25rem;
  }
  .landing-footer .landing-container {
    grid-template-columns: 1fr auto;
  }
  .landing-footer p {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 850px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 0.8rem 1rem;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    margin-top: 0.75rem;
  }
  .sidebar > .brand {
    max-width: calc(100% - 6rem);
  }
  .sidebar > .brand > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-user {
    position: absolute;
    top: 0.65rem;
    right: 1rem;
    display: flex;
    border: 0;
    padding: 0;
  }
  .sidebar-profile {
    padding: 0;
  }
  .sidebar-profile:hover,
  .sidebar-profile.active {
    background: transparent;
  }
  .user-details,
  .sidebar-logout span {
    display: none;
  }
  .sidebar-logout {
    width: 2.35rem;
    height: 2.35rem;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0;
    border-color: #4b4b4b;
  }
  .main {
    margin: 0;
    padding: 1.5rem 1rem 4rem;
  }
  .dashboard-grid,
  .detail-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .page-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .stats,
  .counters {
    grid-template-columns: 1fr;
  }
  .vehicle-strip {
    grid-template-columns: 1fr;
  }
  .vehicle-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .filters {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .filters > input[type="search"] {
    width: 100%;
  }
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .pagination-controls {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .document {
    padding: 1rem;
  }
  .header-actions {
    justify-content: flex-end;
  }
  .completion-panel,
  .completion-panel form {
    align-items: stretch;
    flex-direction: column;
  }
  .print-sheet {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 1rem;
  }
  .print-toolbar {
    position: static;
    flex-wrap: wrap;
  }
}
/* Phones. List tables become one card per row: the first link in each row is
   stretched over the whole card, so the separate "Преглед" column goes. */
@media (max-width: 640px) {
  .panel-header {
    flex-wrap: wrap;
  }
  .list-row .align-right strong,
  .card-table .cell-total,
  .card-table .cell-profit {
    white-space: nowrap;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .stats a {
    align-items: flex-start;
    padding: 0.9rem;
  }
  .stat-body .money-stat {
    font-size: 1.2rem;
  }
  .stat-body small {
    font-size: 0.7rem;
  }
  .table-panel {
    overflow-x: visible;
  }
  .card-table thead {
    display: none;
  }
  .card-table,
  .card-table tbody {
    display: block;
  }
  .card-table tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 1rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
  }
  .card-table tbody tr:last-child {
    border-bottom: 0;
  }
  .card-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none !important;
    font-size: 0.85rem;
  }
  .card-table .cell-action,
  .card-table .is-empty {
    display: none;
  }
  .card-table .strong-link::after {
    content: "";
    position: absolute;
    inset: 0;
  }
  .card-table td.number {
    text-align: right;
  }
  .card-table .strong-link + small,
  .card-table .tag {
    margin-left: 0.4rem;
  }

  .board-table tr {
    grid-template-areas:
      "number total"
      "customer profit"
      "car status";
  }
  .board-table .cell-number {
    grid-area: number;
  }
  .board-table .cell-number small {
    display: inline;
  }
  .board-table .cell-customer {
    grid-area: customer;
    color: var(--muted);
  }
  .board-table .cell-car {
    grid-area: car;
  }
  .board-table .cell-status {
    grid-area: status;
    justify-self: end;
  }
  .board-table .cell-total {
    grid-area: total;
  }
  .board-table .cell-profit {
    grid-area: profit;
  }
  .board-table .cell-profit small {
    display: none;
  }
  .board-table .cell-profit strong::before {
    content: "печалба ";
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 400;
  }

  .customers-table tr {
    grid-template-columns: minmax(0, 1fr);
  }
  .customers-table .cell-company,
  .customers-table .cell-contact {
    color: var(--muted);
    font-size: 0.8rem;
  }
  .customers-table .stacked {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.6rem;
    overflow-wrap: anywhere;
  }

  .cars-table tr {
    grid-template-areas:
      "plate mileage"
      "car car"
      "customer customer";
  }
  .cars-table .cell-plate {
    grid-area: plate;
  }
  .cars-table .cell-car {
    grid-area: car;
  }
  .cars-table .cell-customer {
    grid-area: customer;
    color: var(--muted);
    font-size: 0.8rem;
  }
  .cars-table .cell-mileage {
    grid-area: mileage;
    color: var(--muted);
    font-size: 0.8rem;
  }

  .lines-table tr {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "description description total"
      "kind quantity price";
    column-gap: 0.5rem;
    padding-inline: 0;
  }
  .lines-table .cell-description {
    grid-area: description;
  }
  .lines-table .cell-total {
    grid-area: total;
    font-weight: 650;
  }
  .lines-table .cell-kind {
    grid-area: kind;
  }
  .lines-table .cell-kind .tag {
    margin-left: 0;
  }
  .lines-table .cell-quantity,
  .lines-table .cell-price {
    color: var(--muted);
    font-size: 0.78rem;
  }
  .lines-table .cell-quantity {
    grid-area: quantity;
    text-align: left !important;
  }
  .lines-table .cell-quantity::after {
    content: " ×";
  }
  .lines-table .cell-price {
    grid-area: price;
    text-align: left !important;
  }

  /* The item editor: one stacked card per line, labelled from data-label. */
  .item-editor thead {
    display: none;
  }
  .item-editor,
  .item-editor tbody {
    display: block;
  }
  .item-editor tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "kind remove"
      "description description"
      "quantity price"
      "cost cost";
    gap: 0.6rem 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .item-editor td {
    display: block;
    width: auto !important;
    padding: 0;
    border: 0;
  }
  .item-editor td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
  }
  .item-editor input,
  .item-editor select,
  .item-editor td:nth-child(2) input {
    width: 100%;
    min-width: 0;
  }
  .item-editor .cell-kind {
    grid-area: kind;
  }
  .item-editor .cell-description {
    grid-area: description;
  }
  .item-editor .cell-quantity {
    grid-area: quantity;
  }
  .item-editor .cell-price {
    grid-area: price;
  }
  .item-editor .cell-cost {
    grid-area: cost;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
  }
  .item-editor .item-row-action {
    grid-area: remove;
    justify-self: end;
    align-self: end;
  }
  .sticky-actions {
    justify-content: stretch;
  }
  .sticky-actions > * {
    flex: 1;
  }
}
@media print {
  .print-toolbar {
    display: none;
  }
  .print-page {
    background: #fff;
  }
  .print-sheet {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  @page {
    size: A4;
    margin: 15mm;
  }
  body {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
