:root {
  --bg: #0d1418;
  --bg-soft: #152329;
  --card: #f7f5ef;
  --text: #102027;
  --accent: #ea6f2d;
  --accent-2: #20a39e;
  --ink-light: #f5f5f5;
  --muted: #5e6b70;
  --ok: #2f9e44;
  --warn: #f08c00;
  --bad: #c92a2a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 8% 10%, #23414f 0, transparent 40%),
              radial-gradient(circle at 90% 20%, #4f2a19 0, transparent 45%),
              linear-gradient(145deg, var(--bg), #090d10 60%);
  color: var(--ink-light);
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.26;
  z-index: -1;
}

.bg-glow-a {
  width: 340px;
  height: 340px;
  background: #20a39e;
  left: -120px;
  top: 90px;
}

.bg-glow-b {
  width: 420px;
  height: 420px;
  background: #ea6f2d;
  right: -150px;
  top: 200px;
}

.container {
  width: min(1140px, 92vw);
  margin: 0 auto;
}

.hero {
  padding: 3.5rem 0 2rem;
  animation: rise .6s ease-out;
}

.hero-topline {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  padding: .35rem .8rem;
  backdrop-filter: blur(4px);
}

.dot {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: #83f28f;
  box-shadow: 0 0 12px #83f28f;
}

h1 {
  font-family: "Fraunces", serif;
  font-weight: 800;
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 1.05;
  margin: .9rem 0 .7rem;
  max-width: 14ch;
}

h1 em {
  color: #ffd8a8;
  font-style: normal;
}

.subtitle {
  max-width: 68ch;
  color: #d4d7da;
}

.search-panel {
  margin-top: 1.3rem;
  display: grid;
  gap: .85rem;
  grid-template-columns: 1.6fr .6fr .6fr auto;
  background: rgba(255,255,255,.06);
  padding: .9rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.13);
}

label {
  display: grid;
  gap: .35rem;
  font-size: .88rem;
  color: #d6dee1;
}

input {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: .72rem .8rem;
  font-size: .96rem;
  font-family: inherit;
  background: rgba(255,255,255,.95);
}

button {
  border: none;
  border-radius: 9px;
  padding: .75rem 1rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease, filter .2s ease;
}

button:hover { transform: translateY(-1px); filter: brightness(1.06); }
button.secondary { background: #2a3e4a; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  padding-bottom: 2.5rem;
}

.card {
  background: var(--card);
  color: var(--text);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}

h2 {
  margin: .2rem 0 .7rem;
  font-size: 1.08rem;
}

.metrics .metric-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .6rem;
}

.metrics article {
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  padding: .7rem;
}

.metrics article p {
  margin: 0 0 .2rem;
  font-size: .8rem;
  color: var(--muted);
}

.metrics article strong {
  font-size: 1.35rem;
}

.muted { color: var(--muted); }

.terminal {
  background: #0d1117;
  color: #8eed96;
  border-radius: 12px;
  padding: .8rem;
  min-height: 220px;
  white-space: pre-wrap;
  overflow: auto;
}

.span-2 { grid-column: 1 / -1; }

.lead-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}

.actions {
  display: flex;
  gap: .6rem;
}

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}

th, td {
  text-align: left;
  border-bottom: 1px solid #e7e7e7;
  padding: .65rem .4rem;
  vertical-align: top;
}

tbody tr {
  opacity: 0;
  animation: fadeIn .45s ease forwards;
}

.tier {
  font-weight: 800;
}

.tier.tier-A { color: var(--ok); }
.tier.tier-B { color: var(--warn); }
.tier.tier-C { color: var(--bad); }

.show-mail {
  font-size: .8rem;
  padding: .4rem .7rem;
  background: var(--accent-2);
}

dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(750px, 92vw);
}

dialog form {
  margin: 0;
  padding: 1rem;
}

textarea {
  width: 100%;
  margin-top: .6rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: .8rem;
  resize: vertical;
}

@keyframes rise {
  from { transform: translateY(8px); opacity: .25; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .search-panel { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .metrics .metric-list { grid-template-columns: 1fr 1fr; }
}
