:root {
  --ink: #15251f;
  --muted: #617069;
  --paper: #f5f7f4;
  --surface: #ffffff;
  --line: #dce3de;
  --forest: #123f32;
  --forest-2: #1f5b49;
  --gold: #c8a04d;
  --gold-soft: #f5ecd7;
  --danger: #9e3838;
  --danger-soft: #fbe8e8;
  --success: #267052;
  --shadow: 0 18px 50px rgba(20, 45, 35, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 92%, rgba(200,160,77,.22), transparent 34%),
    var(--forest);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 32px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}

.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-family: Georgia, serif; font-size: 17px; }
.brand-copy span { color: rgba(255,255,255,.66); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.nav { display: grid; gap: 7px; }
.nav a {
  padding: 11px 13px;
  border-radius: 11px;
  color: rgba(255,255,255,.76);
  font-size: 14px;
  text-decoration: none;
}
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.1); }

.sidebar-foot {
  position: absolute;
  right: 20px;
  bottom: 22px;
  left: 20px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
}

.main { min-width: 0; padding: 32px clamp(20px, 4vw, 56px) 64px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}

.eyebrow { margin: 0 0 4px; color: var(--forest-2); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.12; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 4vw, 42px); font-weight: 500; }
h2 { font-size: 24px; font-weight: 500; }
h3 { font-size: 18px; font-weight: 600; }
.subtle { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 750;
  font-size: 13px;
  text-decoration: none;
}
.btn-primary { color: #fff; background: var(--forest); }
.btn-primary:hover { background: var(--forest-2); }
.btn-secondary { color: var(--forest); background: var(--surface); border-color: var(--line); }
.btn-danger { color: var(--danger); background: var(--danger-soft); }
.btn-small { min-height: 34px; padding: 6px 11px; font-size: 12px; }

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(20,45,35,.02);
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 18px; }

.stat { position: relative; overflow: hidden; }
.stat::after {
  position: absolute;
  right: -20px;
  bottom: -36px;
  width: 90px;
  height: 90px;
  border: 18px solid var(--gold-soft);
  border-radius: 50%;
  content: "";
}
.stat-label { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.stat-value { margin-top: 8px; font-family: Georgia, serif; font-size: 34px; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 { margin-bottom: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbf9; }
.entity-link { color: var(--forest); font-weight: 800; text-decoration: none; }
.entity-link:hover { text-decoration: underline; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1ee;
  color: #536159;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}
.badge-new, .badge-completed, .badge-qualified { background: #dff2e8; color: #236344; }
.badge-contacted, .badge-running { background: #e4eff9; color: #315d82; }
.badge-follow_up, .badge-paused { background: var(--gold-soft); color: #7b5d1f; }
.badge-not_a_fit, .badge-failed { background: var(--danger-soft); color: var(--danger); }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 16px;
}

.field { display: grid; gap: 6px; }
.field label { color: #435148; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd8d1;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.field textarea { min-height: 104px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(31,91,73,.1);
}
.field-help { color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }

.alert { margin-bottom: 18px; padding: 12px 15px; border-radius: 11px; font-size: 13px; }
.alert-success { color: #205b43; background: #def1e7; border: 1px solid #b8ddc9; }
.alert-error { color: #7f3030; background: #f9e4e4; border: 1px solid #ebc3c3; }

.empty {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}
.empty strong { display: block; margin-bottom: 5px; color: var(--ink); font-family: Georgia, serif; font-size: 20px; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; color: var(--muted); font-size: 12px; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e8ede9; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--forest-2), var(--gold)); }

.radar {
  position: relative;
  display: grid;
  min-height: 285px;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff;
  background: var(--forest);
}
.radar::before, .radar::after {
  position: absolute;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  content: "";
}
.radar::after { width: 150px; height: 150px; }
.radar-sweep {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: conic-gradient(from 10deg, transparent 0 78%, rgba(200,160,77,.45) 100%);
}
.radar-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(200,160,77,.15); }
.radar-dot.one { transform: translate(64px, -52px); }
.radar-dot.two { transform: translate(-78px, 38px); }
.radar-copy { z-index: 2; max-width: 270px; padding-top: 175px; text-align: center; }
.radar-copy strong { display: block; font-family: Georgia, serif; font-size: 20px; }
.radar-copy span { color: rgba(255,255,255,.65); font-size: 12px; }

.meta-list { display: grid; gap: 0; margin: 0; }
.meta-list div { display: grid; grid-template-columns: 145px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.meta-list div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--muted); font-size: 12px; }
.meta-list dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }

.note { padding: 13px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note p { margin-bottom: 5px; white-space: pre-wrap; }
.note small { color: var(--muted); }

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 18% 16%, rgba(200,160,77,.13), transparent 28%),
    var(--forest);
}
.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 32px; }
.login-card .brand { color: var(--forest); margin-bottom: 28px; }
.login-card .brand-mark { border-color: var(--line); }
.login-card .brand-copy span { color: var(--muted); }

.mobile-toggle { display: none; }

@media (max-width: 1050px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 20; width: 250px; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 20px 16px 48px; }
  .mobile-toggle { display: inline-flex; }
  .topbar { align-items: flex-start; }
  .topbar > .actions { justify-content: flex-end; }
  .grid-2, .grid-3, .grid-4, .form-grid, .filters { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .meta-list div { grid-template-columns: 105px 1fr; }
}

