.lead-sheet-root {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.lead-sheet-toolbar,
.lead-sheet-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-sheet-search {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px);
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 12px;
  font-weight: 800;
}

.lead-sheet-search input,
.lead-sheet-filters input,
.lead-sheet-filters select,
.lead-sheet-footer select {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.lead-sheet-search input {
  width: min(360px, 48vw);
  padding: 7px 10px;
}

.lead-sheet-count {
  color: var(--muted);
  font-size: 12px;
}

.lead-sheet-count strong {
  color: var(--ink);
}

.lead-sheet-columns {
  position: relative;
}

.lead-sheet-columns summary,
.lead-sheet-footer button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.lead-sheet-columns summary {
  list-style: none;
}

.lead-sheet-columns summary::-webkit-details-marker {
  display: none;
}

.lead-sheet-columns > div {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 4px;
  width: 310px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 20, 20, 0.16);
}

.lead-sheet-columns label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 700;
}

.lead-sheet-scroll {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.lead-sheet-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}

.lead-sheet-table th,
.lead-sheet-table td {
  min-width: 110px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.lead-sheet-table th {
  position: sticky;
  z-index: 7;
  top: 0;
  background: #f4f3f0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.lead-sheet-table thead tr:first-child th {
  height: 38px;
}

.lead-sheet-table thead tr:nth-child(2) th {
  top: 38px;
  padding-top: 4px;
  padding-bottom: 6px;
  background: #faf9f7;
}

.lead-sheet-table th button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.lead-sheet-table th button i {
  color: var(--ink);
  font-size: 14px;
  font-style: normal;
}

.lead-sheet-table td[data-column="name"] strong,
.lead-sheet-table td[data-column="name"] small {
  display: block;
}

.lead-sheet-table td[data-column="name"] small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.lead-sheet-table th[data-column="name"],
.lead-sheet-table td[data-column="name"] {
  min-width: 230px;
  width: 230px;
}

.lead-sheet-table th[data-column="actions"],
.lead-sheet-table td[data-column="actions"] {
  min-width: 190px;
  width: 190px;
}

.lead-sheet-table th[data-column="score"],
.lead-sheet-table td[data-column="score"] {
  min-width: 80px;
  width: 80px;
}

.lead-sheet-select {
  min-width: 38px !important;
  width: 38px;
  text-align: center !important;
}

.lead-sheet-table .sticky-left {
  position: sticky;
  z-index: 4;
  left: 38px;
  box-shadow: 1px 0 0 var(--border);
}

.lead-sheet-table .sticky-right {
  position: sticky;
  z-index: 4;
  right: 0;
  box-shadow: -1px 0 0 var(--border);
}

.lead-sheet-table thead .sticky-left,
.lead-sheet-table thead .sticky-right {
  z-index: 9;
}

.lead-sheet-table tbody tr:hover td,
.lead-sheet-table tbody tr:hover .sticky-left,
.lead-sheet-table tbody tr:hover .sticky-right,
.lead-sheet-table tbody tr.expanded td {
  background: #fff5f1;
}

.lead-sheet-filters input,
.lead-sheet-filters select {
  width: 100%;
  min-width: 0;
  padding: 5px 6px;
  font-size: 11px;
  text-transform: none;
}

.lead-sheet-source,
.lead-sheet-contact,
.lead-sheet-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f4f3f0;
  font-size: 11px;
  font-weight: 800;
}

.lead-sheet-source.local_service_gap,
.lead-sheet-contact.email_phone,
.lead-sheet-contact.email,
.lead-sheet-status.won,
.lead-sheet-status.qualified {
  border-color: #9fd8c1;
  background: #edf9f3;
  color: #087448;
}

.lead-sheet-source.active_build_intent {
  border-color: #a9c9ee;
  background: #eff6ff;
  color: #285f9d;
}

.lead-sheet-contact.locked,
.lead-sheet-status.rejected {
  border-color: #f1b3a4;
  background: #fff0eb;
  color: #a52d15;
}

.lead-sheet-score {
  font-size: 14px;
}

.lead-sheet-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.lead-sheet-actions a,
.lead-sheet-actions button {
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.lead-sheet-actions a:first-child {
  border-color: #111;
  background: #111;
  color: #fff;
}

.lead-sheet-detail-row td {
  position: static !important;
  padding: 14px 18px;
  background: #faf9f7 !important;
}

.lead-sheet-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 16px;
}

.lead-sheet-detail p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.lead-sheet-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.lead-sheet-detail-facts span {
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
}

.lead-sheet-empty {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 140px;
  color: var(--muted);
}

.lead-sheet-footer {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.lead-sheet-footer label,
.lead-sheet-footer div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.lead-sheet-footer button:disabled {
  cursor: default;
  opacity: 0.45;
}

@media (max-width: 760px) {
  .lead-sheet-search {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .lead-sheet-search input {
    width: 100%;
  }

  .lead-sheet-columns > div {
    right: auto;
    left: 0;
    width: min(310px, calc(100vw - 52px));
  }

  .lead-sheet-detail {
    grid-template-columns: 1fr;
  }

  .lead-sheet-footer {
    align-items: flex-start;
  }
}
