:root {
  color-scheme: light;
  --ink: #111419;
  --muted: #667085;
  --soft: #f4f6f8;
  --paper: #ffffff;
  --line: #d9dee7;
  --line-strong: #b8c0cc;
  --brand: #e43d30;
  --brand-dark: #a9231c;
  --charcoal: #151a20;
  --steel: #455564;
  --green: #12845f;
  --gold: #a96713;
  --blue: #2457a6;
  --shadow: 0 18px 55px rgba(17, 20, 25, 0.12);
  --radius: 8px;
  --topbar-height: 76px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(244, 246, 248, 0.88), rgba(244, 246, 248, 0.98)),
    radial-gradient(circle at 18% 0%, rgba(228, 61, 48, 0.13), transparent 32%),
    #f4f6f8;
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--topbar-height);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(150px, 0.7fr);
  gap: 20px;
  align-items: center;
  padding: 14px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid rgba(217, 222, 231, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--charcoal);
  color: white;
  font-weight: 850;
  box-shadow: inset 0 -4px 0 rgba(228, 61, 48, 0.8);
}

.brand-lockup strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

.brand-lockup small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  overflow-x: auto;
}

.tab-button {
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--steel);
  background: transparent;
  white-space: nowrap;
  min-width: 56px;
}

.tab-button.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(17, 20, 25, 0.08);
}

.quick-contact {
  justify-self: end;
}

.quick-contact a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 750;
  background: var(--paper);
}

main {
  width: 100%;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.workbench,
.page-band {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 42px);
}

.booking-surface {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1fr) minmax(300px, 0.76fr);
  gap: clamp(18px, 2.4vw, 34px);
  align-items: stretch;
  min-height: calc(100vh - var(--topbar-height) - 78px);
}

.media-plate {
  overflow: hidden;
  border-radius: var(--radius);
  min-height: 420px;
  background: var(--charcoal);
  box-shadow: var(--shadow);
}

.media-plate img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.booking-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(12px, 2vw, 24px) 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(2.45rem, 5vw, 5.8rem);
  line-height: 0.96;
  font-weight: 900;
}

h2 {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  line-height: 1.1;
}

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

.booking-copy p:not(.eyebrow) {
  max-width: 58ch;
  margin: 20px 0 0;
  color: var(--steel);
  font-size: 1.08rem;
  line-height: 1.55;
}

.verified-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.verified-strip span,
.pill,
.status-dot {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--steel);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 750;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}

.intake-form,
.tool-form,
.panel,
.metric-tile,
.proof-item {
  border: 1px solid rgba(217, 222, 231, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(17, 20, 25, 0.07);
}

.intake-form {
  align-self: center;
  display: grid;
  gap: 14px;
  padding: clamp(18px, 2vw, 26px);
}

.form-head,
.panel-head,
.section-title,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-head {
  padding-bottom: 4px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--steel);
  font-size: 0.84rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  min-height: 44px;
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(228, 61, 48, 0.16);
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  gap: 12px;
}

.button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 820;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.button.danger {
  border-color: rgba(169, 35, 28, 0.28);
  color: var(--brand-dark);
  background: #fff1f0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  padding: 0;
  font-size: 1.35rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.metric-tile {
  min-height: 128px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 18px;
}

.metric-tile span,
.proof-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-tile strong {
  display: block;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1;
}

.metric-tile small {
  color: var(--steel);
  font-weight: 700;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(240px, 0.9fr) minmax(240px, 0.9fr) minmax(240px, 0.9fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.panel {
  padding: clamp(17px, 2vw, 24px);
}

.panel-copy {
  color: var(--steel);
  line-height: 1.5;
}

.task-list,
.ledger-list,
.insight-list,
.route-plan,
.quote-menu,
.proof-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.task-item,
.ledger-item,
.job-card,
.insight-card,
.route-stop,
.quote-row,
.proof-check {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.command-panel {
  background:
    linear-gradient(135deg, rgba(17, 20, 25, 0.96), rgba(28, 37, 46, 0.96)),
    var(--charcoal);
  color: white;
}

.command-panel .eyebrow,
.command-panel .panel-copy,
.command-panel .task-meta,
.command-panel .insight-card p {
  color: rgba(255, 255, 255, 0.72);
}

.command-panel .status-dot {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
}

.insight-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
}

.insight-card strong,
.route-stop strong,
.quote-row strong,
.proof-check strong {
  line-height: 1.25;
}

.insight-card p,
.route-stop p,
.quote-row p,
.proof-check p {
  margin: 0;
  color: var(--steel);
  font-size: 0.9rem;
  line-height: 1.45;
}

.insight-rank,
.route-time,
.proof-state {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--steel);
  background: #eef2f7;
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.insight-rank {
  color: #ffd8d2;
  background: rgba(228, 61, 48, 0.22);
}

.route-stop {
  position: relative;
  padding-left: 42px;
}

.route-stop::before {
  content: attr(data-stop);
  position: absolute;
  left: 12px;
  top: 14px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
}

.quote-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.quote-row p {
  grid-column: 1 / -1;
}

.quote-price {
  color: var(--green);
  font-weight: 900;
}

.proof-check.is-ready {
  border-color: rgba(18, 132, 95, 0.28);
  background: #f0fbf7;
}

.proof-check.is-needed {
  border-color: rgba(169, 103, 19, 0.28);
  background: #fffaf0;
}

.proof-state.is-ready {
  color: var(--green);
  background: #dff7ed;
}

.proof-state.is-needed {
  color: var(--gold);
  background: #fff1d6;
}

.task-item strong,
.ledger-item strong,
.job-card strong {
  line-height: 1.2;
}

.task-meta,
.job-meta,
.ledger-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--steel);
  font-weight: 800;
}

.reserve-bars {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.reserve-bars.large {
  margin-top: 22px;
}

.reserve-row {
  display: grid;
  grid-template-columns: 112px minmax(110px, 1fr) 92px;
  gap: 12px;
  align-items: center;
}

.reserve-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9edf3;
}

.reserve-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.reserve-row:nth-child(2) .reserve-fill {
  background: var(--blue);
}

.reserve-row:nth-child(3) .reserve-fill {
  background: var(--gold);
}

.reserve-row:nth-child(4) .reserve-fill {
  background: var(--green);
}

.reserve-row span,
.reserve-row strong {
  font-size: 0.84rem;
}

.reserve-row span {
  color: var(--steel);
  font-weight: 760;
}

.reserve-row strong {
  text-align: right;
}

.page-band {
  display: grid;
  gap: 22px;
}

.section-title {
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.section-title h1 {
  max-width: 14ch;
  font-size: clamp(2.25rem, 4vw, 4.5rem);
}

.section-title p:last-child {
  max-width: 62ch;
  margin: 0;
  color: var(--steel);
  line-height: 1.5;
}

.tool-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.tool-form.wide {
  grid-template-columns: 1.2fr 1.2fr 0.8fr 0.7fr 0.8fr auto;
}

.tool-form.stack {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.tool-form h2 {
  margin-bottom: 4px;
}

.table-toolbar {
  align-items: end;
}

.search-box {
  width: min(480px, 100%);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

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

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 850;
  text-transform: uppercase;
  background: #f8fafc;
}

td {
  color: var(--steel);
  font-size: 0.92rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.customer-name,
.money-cell {
  color: var(--ink);
  font-weight: 850;
}

.job-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(210px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.job-column {
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.job-column h2 {
  position: sticky;
  top: var(--topbar-height);
  z-index: 1;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 0.93rem;
}

.job-column-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.finance-grid,
.data-grid,
.proof-grid {
  display: grid;
  gap: 18px;
}

.finance-grid {
  grid-template-columns: minmax(280px, 0.7fr) minmax(360px, 1fr);
}

.finance-panel {
  min-height: 100%;
}

.reserve-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.proof-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.proof-item {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.proof-item strong {
  font-size: 1.12rem;
}

.proof-item p {
  margin: 0;
  color: var(--steel);
  line-height: 1.5;
}

.proof-item.warning {
  border-color: rgba(169, 103, 19, 0.42);
  background: #fffaf0;
}

.data-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.danger-zone {
  border-color: rgba(169, 35, 28, 0.22);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 15px;
  border-radius: var(--radius);
  color: white;
  background: var(--charcoal);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state,
.not-found {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.empty-state {
  text-align: center;
  background: var(--paper);
}

.empty-state h1 {
  max-width: 16ch;
  margin-bottom: 22px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .view-tabs,
  .quick-contact {
    justify-self: start;
  }

  .booking-surface {
    grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1fr);
  }

  .intake-form {
    grid-column: 1 / -1;
  }

  .summary-grid,
  .command-grid,
  .proof-grid,
  .data-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .tool-form,
  .tool-form.wide,
  .reserve-settings {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 140px;
  }

  .topbar {
    position: static;
    gap: 12px;
  }

  .view-tabs {
    width: 100%;
  }

  .booking-surface,
  .two-column,
  .command-grid,
  .finance-grid,
  .summary-grid,
  .proof-grid,
  .data-grid {
    grid-template-columns: 1fr;
  }

  .booking-surface {
    min-height: 0;
  }

  .media-plate,
  .media-plate img {
    min-height: 320px;
  }

  .booking-copy {
    padding: 2px 0;
  }

  .booking-copy p:not(.eyebrow) {
    font-size: 1rem;
  }

  .section-title,
  .table-toolbar,
  .form-head,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-form,
  .tool-form.wide,
  .reserve-settings,
  .split-fields {
    grid-template-columns: 1fr;
  }

  .reserve-row {
    grid-template-columns: 92px minmax(82px, 1fr) 82px;
  }

  .job-board {
    grid-template-columns: repeat(6, minmax(250px, 78vw));
  }
}

@media (max-width: 520px) {
  .workbench,
  .page-band {
    padding: 16px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  h1 {
    font-size: clamp(2.12rem, 14vw, 3.4rem);
  }

  .section-title h1 {
    font-size: clamp(2rem, 13vw, 3rem);
  }

  .quick-contact a,
  .button {
    width: 100%;
  }

  .inline-actions .mini-button {
    flex: 1 1 auto;
  }
}
