:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-soft: #eef5f3;
  --surface-action: #e8fbf6;
  --primary: #002d2d;
  --primary-2: #0c4441;
  --accent: #74f5e5;
  --red: #e53935;
  --text: #202829;
  --muted: #677777;
  --line: #dce6e4;
  --line-strong: #bdccca;
  --shadow: 0 18px 42px rgba(0, 45, 45, 0.08);
  --radius: 7px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin: 0;
}

.app {
  min-height: 100vh;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(0, 45, 45, 0.16);
  background: var(--bg);
  box-shadow: 0 8px 18px rgba(0, 45, 45, 0.08);
}

.strip {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--primary);
  color: rgba(255, 255, 255, 0.72);
  padding: 0 18px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.strip strong {
  color: #fff;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 74px;
  padding: 10px 18px;
  background: #fff;
}

.brand {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.brand img {
  display: block;
  width: 128px;
  height: auto;
}

.headline {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.1;
}

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

.button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  padding: 0 13px;
  font-weight: 850;
}

.workload {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 7px;
  background: transparent;
  padding: 0;
}

.work-card {
  display: flex;
  min-height: 42px;
  min-width: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--primary);
  padding: 6px 9px;
  text-align: left;
}

.work-card:hover,
.work-card.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.work-card span,
.work-card small {
  display: block;
  color: inherit;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.72;
}

.work-card strong {
  display: block;
  margin-top: 0;
  color: inherit;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.work-card small {
  display: none;
}

.content {
  display: grid;
  gap: 8px;
  width: min(1880px, calc(100% - 18px));
  margin: 8px auto 24px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.tab {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  padding: 0 14px;
  font-weight: 900;
}

.tab.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.search {
  display: grid;
  grid-template-columns: auto minmax(220px, 340px);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.search input {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  font-weight: 750;
}

.search input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(24, 180, 164, 0.14);
}

.task-strip {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
  box-shadow: var(--shadow);
}

.task-strip-head {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.task-strip-head strong {
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
}

.task-strip-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 7px;
  min-width: 0;
}

.task-card {
  display: grid;
  min-height: 46px;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
}

.task-card:hover {
  border-color: var(--primary-2);
  background: var(--surface-action);
}

.task-card strong,
.task-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card strong {
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
}

.task-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.task-card.ok {
  border-color: rgba(0, 97, 84, 0.22);
  background: var(--surface-action);
}

.task-card.warn {
  border-color: rgba(154, 98, 0, 0.22);
  background: #fff8eb;
}

.panel {
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel.is-visible {
  display: block;
}

.panel-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
}

.eyebrow {
  color: var(--red);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.panel h2 {
  color: var(--primary);
  font-size: 18px;
}

.note {
  max-width: 560px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 210px);
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.request-table {
  min-width: 1120px;
}

.quote-table {
  min-width: 1060px;
}

.inbox-table,
.contractor-table {
  min-width: 1080px;
}

.request-table th:nth-child(1),
.request-table td:nth-child(1) {
  width: 8%;
}

.request-table th:nth-child(2),
.request-table td:nth-child(2) {
  width: 14%;
}

.request-table th:nth-child(3),
.request-table td:nth-child(3) {
  width: 27%;
}

.request-table th:nth-child(4),
.request-table td:nth-child(4) {
  width: 10%;
}

.request-table th:nth-child(5),
.request-table td:nth-child(5),
.request-table th:nth-child(6),
.request-table td:nth-child(6) {
  width: 7%;
}

.request-table th:nth-child(7),
.request-table td:nth-child(7) {
  width: 13%;
}

.request-table th:nth-child(8),
.request-table td:nth-child(8) {
  width: 12%;
}

.request-table th:nth-child(9),
.request-table td:nth-child(9) {
  width: 8%;
}

.quote-table th:nth-child(1),
.quote-table td:nth-child(1),
.quote-table th:nth-child(2),
.quote-table td:nth-child(2),
.quote-table th:nth-child(5),
.quote-table td:nth-child(5),
.quote-table th:nth-child(6),
.quote-table td:nth-child(6),
.quote-table th:nth-child(7),
.quote-table td:nth-child(7) {
  width: 9%;
}

.quote-table th:nth-child(3),
.quote-table td:nth-child(3) {
  width: 20%;
}

.quote-table th:nth-child(4),
.quote-table td:nth-child(4) {
  width: 11%;
}

.quote-table th:nth-child(8),
.quote-table td:nth-child(8) {
  width: 32%;
}

.inbox-table th:nth-child(1),
.inbox-table td:nth-child(1),
.inbox-table th:nth-child(2),
.inbox-table td:nth-child(2),
.inbox-table th:nth-child(4),
.inbox-table td:nth-child(4),
.inbox-table th:nth-child(6),
.inbox-table td:nth-child(6) {
  width: 11%;
}

.inbox-table th:nth-child(3),
.inbox-table td:nth-child(3) {
  width: 18%;
}

.inbox-table th:nth-child(5),
.inbox-table td:nth-child(5) {
  width: 39%;
}

.contractor-table th:nth-child(1),
.contractor-table td:nth-child(1) {
  width: 28%;
}

.contractor-table th:nth-child(2),
.contractor-table td:nth-child(2),
.contractor-table th:nth-child(3),
.contractor-table td:nth-child(3),
.contractor-table th:nth-child(4),
.contractor-table td:nth-child(4),
.contractor-table th:nth-child(5),
.contractor-table td:nth-child(5) {
  width: 10%;
}

.contractor-table th:nth-child(6),
.contractor-table td:nth-child(6) {
  width: 14%;
}

.contractor-table th:nth-child(7),
.contractor-table td:nth-child(7) {
  width: 18%;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  overflow-wrap: anywhere;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

td {
  font-size: 12px;
  font-weight: 700;
}

tr:nth-child(even) td {
  background: #fbfdfc;
}

.click-row td {
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.click-row:hover td {
  background: var(--surface-action);
}

.click-row.is-selected td {
  background: #e9f8f5;
  box-shadow: inset 0 1px 0 rgba(0, 97, 84, 0.18), inset 0 -1px 0 rgba(0, 97, 84, 0.18);
}

.table-action {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 97, 84, 0.16);
  border-radius: 999px;
  background: var(--surface-action);
  color: var(--primary);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
  white-space: normal;
}

.table-action:hover {
  border-color: var(--primary);
}

.main-cell strong {
  display: block;
  color: var(--primary);
  font-size: 13px;
  text-align: center;
}

.main-cell span,
.muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
  max-width: 100%;
  text-align: center;
  white-space: normal;
}

.pill.warn {
  background: #fff2dd;
  color: #9a6200;
}

.pill.ok {
  background: var(--surface-action);
  color: #006154;
}

.pill.wait {
  background: #eef2f1;
  color: #526463;
}

.pill.muted {
  background: #f2f4f4;
  color: #788383;
}

.pill.red {
  background: #fff5f4;
  color: #9b1f1b;
}

.subject {
  overflow-wrap: anywhere;
  text-align: center;
}

.route-cell {
  text-align: center;
}

.route-cell strong {
  display: inline-flex;
  justify-content: center;
  margin-bottom: 4px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 950;
}

.route-cell span {
  display: block;
  overflow-wrap: anywhere;
  text-align: center;
}

.count-cell {
  min-width: 0;
}

.count-cell strong {
  display: block;
  color: var(--primary);
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.count-cell span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.offer-cell {
  min-width: 0;
}

.offer strong,
.offer span,
.offer em {
  display: block;
  overflow-wrap: anywhere;
  text-align: center;
}

.offer strong {
  color: var(--primary);
  font-size: 14px;
  font-weight: 950;
}

.offer span {
  margin-top: 2px;
  color: var(--text);
}

.offer em {
  margin-top: 4px;
  color: #006154;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

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

.drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 720px);
  pointer-events: none;
}

.drawer[hidden] {
  display: none;
}

.drawer.is-open {
  pointer-events: auto;
}

.drawer-scrim {
  border: 0;
  background: rgba(0, 20, 20, 0.32);
}

.drawer-card {
  display: flex;
  min-width: 0;
  height: 100vh;
  flex-direction: column;
  overflow: auto;
  border-left: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: -24px 0 48px rgba(0, 45, 45, 0.18);
}

.drawer-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 14px 18px;
}

.drawer-kicker {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.drawer-top h2 {
  color: var(--primary);
  font-size: 22px;
  line-height: 1.1;
}

.icon-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--primary);
  background: var(--surface-soft);
}

.detail {
  display: grid;
  gap: 12px;
  padding: 14px 18px 24px;
}

.recommendation {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.recommendation strong {
  color: var(--primary);
  font-size: 16px;
  font-weight: 950;
}

.recommendation span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.recommendation.ok {
  border-color: rgba(0, 97, 84, 0.22);
  background: var(--surface-action);
}

.recommendation.warn {
  border-color: rgba(154, 98, 0, 0.22);
  background: #fff8eb;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.detail-metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  padding: 10px;
  text-align: center;
}

.detail-metric strong,
.detail-metric span {
  display: block;
}

.detail-metric strong {
  color: var(--primary);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.detail-metric span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.detail-section h3 {
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 950;
}

.detail-text {
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  padding: 10px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.quote-card,
.message-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.quote-card.is-best {
  border-color: rgba(0, 97, 84, 0.26);
  background: var(--surface-action);
}

.quote-line,
.message-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.quote-line strong,
.message-line strong {
  color: var(--primary);
  font-size: 14px;
  font-weight: 950;
}

.quote-line span,
.message-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.quote-meta,
.message-text {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.risk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.risk {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  background: #fff2dd;
  color: #8a5a00;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .workload {
    flex-wrap: wrap;
  }

  .hero,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  .search {
    grid-template-columns: 1fr;
  }

  .task-strip {
    grid-template-columns: 1fr;
  }

  .task-strip-head {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 8px;
  }

  .task-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .strip,
  .hero {
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .headline {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand h1 {
    font-size: 23px;
  }

  .workload {
    width: 100%;
    flex-wrap: wrap;
  }

  .work-card {
    min-height: 38px;
    min-width: calc(50% - 4px);
  }

  .work-card strong {
    font-size: 20px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .note {
    text-align: left;
  }

  .task-list {
    grid-template-columns: 1fr;
  }

  .drawer {
    grid-template-columns: 1fr;
  }

  .drawer-scrim {
    display: none;
  }

  .drawer-card {
    width: 100%;
  }

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