:root {
  --ink: #13231f;
  --muted: #62706b;
  --paper: #f5f8f6;
  --card: #ffffff;
  --line: #dce5e0;
  --green: #14864a;
  --green-dark: #0d6738;
  --green-soft: #e7f6ed;
  --amber: #a25b00;
  --red: #b42318;
  --shadow: 0 18px 55px rgba(27, 55, 45, .11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 4%, #dff4e7 0, transparent 25rem), var(--paper); }
a { color: var(--green-dark); }
.public-shell { width: min(100% - 32px, 680px); margin: 0 auto; padding: 28px 0 56px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 750; margin-bottom: 30px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: white; font-size: 18px; box-shadow: 0 8px 20px rgba(20,134,74,.25); }
.hero { margin: 18px 0 26px; }
.eyebrow { color: var(--green-dark); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: 12px; }
h1 { font-size: clamp(32px, 9vw, 52px); line-height: 1.04; letter-spacing: -.045em; margin: 11px 0 15px; }
.lead { color: var(--muted); line-height: 1.65; font-size: 17px; margin: 0; max-width: 58ch; }
.card { background: var(--card); border: 1px solid rgba(220,229,224,.9); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(22px, 5vw, 36px); }
.form-grid { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-size: 14px; font-weight: 720; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
input, textarea, select { width: 100%; border: 1px solid #cbd8d1; background: #fbfdfc; color: var(--ink); border-radius: 12px; padding: 13px 14px; font: inherit; outline: none; transition: .18s; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(20,134,74,.11); background: white; }
textarea { resize: vertical; min-height: 100px; }
.checkbox { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; color: var(--muted); font-size: 13px; line-height: 1.5; }
.checkbox input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green); }
.button { border: 0; border-radius: 13px; background: var(--green); color: white; padding: 14px 18px; min-height: 50px; font: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; transition: .18s; }
.button:hover { background: var(--green-dark); transform: translateY(-1px); }
.button.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.button.danger { background: #fff1f0; color: var(--red); border: 1px solid #ffd1cd; }
.button.small { min-height: 36px; padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.errors { padding: 13px 15px; margin-bottom: 20px; background: #fff1f0; border: 1px solid #ffd1cd; color: var(--red); border-radius: 12px; font-size: 14px; }
.errors ul { margin: 0; padding-left: 20px; }
.privacy-note { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 20px; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.admin-body { background: #f3f6f4; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar { background: #10251d; color: white; padding: 26px 18px; display: flex; flex-direction: column; }
.sidebar .brand { margin: 0 8px 30px; }
.nav { display: grid; gap: 6px; }
.nav a { color: #b9cbc3; text-decoration: none; padding: 11px 13px; border-radius: 10px; font-size: 14px; font-weight: 650; }
.nav a:hover, .nav a.active { color: white; background: rgba(255,255,255,.1); }
.sidebar-bottom { margin-top: auto; }
.admin-main { min-width: 0; padding: 30px clamp(18px, 4vw, 46px) 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-head h1 { font-size: clamp(26px, 4vw, 36px); margin: 0; letter-spacing: -.03em; }
.admin-head p { color: var(--muted); margin: 6px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { display: block; font-size: 31px; font-weight: 850; letter-spacing: -.03em; margin-top: 8px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 17px; margin-bottom: 20px; overflow: hidden; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { font-size: 17px; margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .055em; padding: 12px 16px; background: #fafcfb; }
td { padding: 14px 16px; border-top: 1px solid #edf1ef; vertical-align: middle; }
tbody tr:hover { background: #fbfdfc; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; background: #edf2ef; color: #41534b; white-space: nowrap; }
.badge.new { background: #e9f2ff; color: #175cd3; }
.badge.whatsapp_received, .badge.in_conversation { background: #fff5df; color: var(--amber); }
.badge.won { background: var(--green-soft); color: var(--green-dark); }
.badge.lost, .badge.duplicate { background: #fff0ef; color: var(--red); }
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters .field { min-width: 145px; flex: 1; }
.filters input, .filters select { padding: 9px 10px; border-radius: 9px; }
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 20px; }
.detail-list { display: grid; grid-template-columns: 160px 1fr; gap: 12px 18px; padding: 20px; margin: 0; }
.detail-list dt { color: var(--muted); font-size: 13px; }
.detail-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.stack { display: grid; gap: 14px; padding: 20px; }
.inline-form { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 170px; }
.note { padding: 13px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border: 0; }
.note p { margin: 5px 0; white-space: pre-wrap; }
.muted { color: var(--muted); font-size: 12px; }
.match-warning { background: #fff8e8; color: #7a4700; border: 1px solid #f4d38b; border-radius: 12px; padding: 13px; }
.login-shell { width: min(100% - 32px, 430px); margin: 0 auto; padding: 11vh 0 50px; }
.empty { text-align: center; padding: 38px; color: var(--muted); }
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .admin-layout { display: block; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; position: sticky; top: 0; z-index: 20; background: #10251d; padding: 10px 14px; gap: 8px; overflow-x: auto; }
  .mobile-nav a { color: #dbe8e2; white-space: nowrap; padding: 8px 10px; text-decoration: none; font-size: 13px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
  .public-shell { width: min(100% - 24px, 680px); padding-top: 18px; }
  .card { border-radius: 19px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 26px; }
  .admin-main { padding: 21px 12px 50px; }
  .admin-head { align-items: flex-start; }
  .detail-list { grid-template-columns: 1fr; gap: 4px; }
  .detail-list dd { margin-bottom: 9px; }
}
