:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #1e2528;
  --muted: #657074;
  --line: #d9dfda;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #a16207;
  --danger: #b42318;
  --soft: #edf6f4;
  font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1080px;
  background: var(--bg);
  color: var(--ink);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 760;
}

h2 {
  font-size: 15px;
  font-weight: 740;
}

p,
span,
label,
td,
th,
button,
input,
select,
pre,
dd,
dt {
  font-size: 13px;
}

#generatedAt {
  margin-top: 5px;
  color: var(--muted);
}

button,
select,
input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

button {
  cursor: pointer;
  padding: 0 12px;
  font-weight: 650;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.header-actions {
  display: flex;
  gap: 10px;
}

main {
  padding: 22px 28px 30px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.metrics span {
  display: block;
  color: var(--muted);
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(220px, 1.2fr);
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 650;
}

.filters select,
.filters input {
  width: 100%;
  padding: 0 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.lead-list,
.preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.section-heading span {
  color: var(--muted);
}

.table-wrap {
  max-height: 620px;
  overflow: auto;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9faf8;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr {
  cursor: pointer;
}

tr:hover {
  background: var(--soft);
}

tr.selected {
  background: #e3f3f0;
}

.company-cell {
  min-width: 190px;
}

.company-cell strong {
  display: block;
  margin-bottom: 4px;
}

.company-cell span,
.muted {
  color: var(--muted);
}

.risk {
  color: var(--warn);
  max-width: 170px;
  word-break: break-word;
}

.risk.blocked {
  color: var(--danger);
}

.decision-actions {
  display: flex;
  gap: 6px;
}

.decision-actions button {
  width: 34px;
  padding: 0;
}

.approved {
  color: var(--accent-strong);
  font-weight: 760;
}

.rejected {
  color: var(--danger);
  font-weight: 760;
}

.preview {
  min-height: 620px;
}

#leadDetails {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 8px 10px;
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  word-break: break-word;
}

pre {
  margin: 0;
  min-height: 360px;
  padding: 14px;
  white-space: pre-wrap;
  line-height: 1.48;
  color: #253033;
}
