:root {
  /* COCOWEL palette — forest green + cream beige */
  --brown:        #264821;   /* leaf-800 dark green (header) */
  --brown-mid:    #345f2e;   /* forest green */
  --copper:       #8ca760;   /* leaf green (accent) */
  --copper-light: #a8bf80;   /* leaf-300 */
  --copper-pale:  #f2f5e9;   /* leaf-50 */
  --cream:        #fffef0;   /* COCOWEL cream beige */
  --cream-dark:   #f6f1d9;   /* cream-200 */
  --white:        #FFFFFF;
  --text:         #1a3318;   /* leaf-900 */
  --text-mid:     #345f2e;   /* forest */
  --text-light:   #5a6b48;   /* fg-muted */
  --border:       #d9d4b8;   /* COCOWEL border */
  --border-focus: #8ca760;   /* leaf */
  --success:      #345f2e;
  --success-bg:   #e3ebd0;
  --error:        #C62828;
  --error-bg:     #FFEBEE;
  --shadow-sm:    0 1px 3px rgba(38,72,33,.10);
  --shadow-md:    0 4px 16px rgba(38,72,33,.12);
  --shadow-lg:    0 8px 32px rgba(38,72,33,.16);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-pill:  999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ───────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--cream-dark);
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.logo { display: flex; align-items: center; }
.logo-img { height: 42px; width: auto; display: block; }
.logo-fallback {
  display: none;
  flex-direction: column;
  line-height: 1;
  gap: 1px;
}
.logo-tropical  { font-size: 18px; font-weight: 800; color: var(--brown); letter-spacing: .06em; }
.logo-nutrition { font-size: 11px; font-weight: 600; color: var(--copper); letter-spacing: .20em; text-transform: uppercase; }

.site-nav { display: flex; gap: 8px; }
.nav-link {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--copper-pale); color: var(--brown-mid); }
.nav-link.active { background: var(--brown-mid); color: var(--white); }

/* ── CONTAINER ────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── PAGE TITLE ───────────────────────────────────────── */
.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 32px;
}

/* ── FORM CARD ────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.form-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-child { border-bottom: none; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--copper);
  margin-bottom: 20px;
}

/* ── FORM GRID ────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: 1; }
  .form-section { padding: 20px 16px; }
}

/* ── FORM ELEMENTS ────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: .01em;
}
label .required { color: var(--copper); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea,
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(196,122,42,.15);
}
input.error { border-color: var(--error); }

/* ── INTERESTS ────────────────────────────────────────── */
.interests-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.interest-chip {
  position: relative;
  cursor: pointer;
}
.interest-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.interest-chip span {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--cream);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-mid);
  transition: all .15s;
  user-select: none;
}
.interest-chip input:checked + span {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(196,122,42,.35);
}
.interest-chip:hover span {
  border-color: var(--copper-light);
  color: var(--brown);
}

/* ── BUSINESS CARD UPLOAD ─────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 500px) { .card-grid { grid-template-columns: 1fr; } }

.card-upload { display: flex; flex-direction: column; gap: 10px; }

.card-preview {
  width: 100%;
  aspect-ratio: 1.75;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color .15s;
  cursor: pointer;
}
.card-preview:hover { border-color: var(--copper-light); }
.card-preview.has-image { border-style: solid; border-color: var(--copper); }
.card-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius) - 2px); }

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
}
.upload-icon { width: 36px; height: 36px; display: block; }
.upload-placeholder span { font-size: 14px; font-weight: 500; }
.upload-label { font-size: 12px; color: var(--text-light); }

.btn-camera {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--copper);
  background: transparent;
  color: var(--copper);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-camera:hover { background: var(--copper); color: var(--white); }
.btn-camera:active { transform: scale(.97); }

/* ── FORM ACTIONS ─────────────────────────────────────── */
.form-actions {
  padding: 24px 32px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
}

/* ── BUTTONS ──────────────────────────────────────────── */
.btn-primary {
  padding: 14px 36px;
  background: var(--copper);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
  letter-spacing: .02em;
}
.btn-primary:hover { background: var(--brown-mid); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary {
  padding: 14px 28px;
  background: transparent;
  color: var(--brown);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: border-color .15s, background .15s;
  font-family: inherit;
}
.btn-secondary:hover { border-color: var(--brown); background: var(--cream); }

.btn-icon {
  padding: 10px 20px;
  background: var(--cream);
  color: var(--brown-mid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-icon:hover { border-color: var(--copper); color: var(--copper); background: var(--white); }

.btn-danger {
  padding: 10px 20px;
  background: transparent;
  color: var(--error);
  border: 1.5px solid var(--error);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn-danger:hover { background: var(--error-bg); }

/* ── SUCCESS OVERLAY ──────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(74,26,8,.60);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn .2s ease;
}
.overlay.hidden { display: none; }

.overlay-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 48px 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-weight: 700;
}
.overlay-card h2 { font-size: 24px; color: var(--brown); margin-bottom: 8px; }
.overlay-card p  { font-size: 15px; color: var(--text-light); margin-bottom: 28px; }
.overlay-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── STATS BAR ────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 700px) { .stats-row { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.stat-card-main { display: flex; align-items: center; gap: 16px; }
.stat-number { font-size: 52px; font-weight: 800; color: var(--brown); line-height: 1; }
.stat-label  { font-size: 13px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .08em; }
.stat-card h3 { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}
.stat-item-label { flex: 1; color: var(--text); font-weight: 500; }
.stat-item-count { font-weight: 700; color: var(--brown); min-width: 24px; text-align: right; }
.stat-bar-wrap { flex: 2; height: 6px; background: var(--cream-dark); border-radius: 3px; overflow: hidden; }
.stat-bar      { height: 100%; background: var(--copper); border-radius: 3px; transition: width .3s ease; }

/* ── FILTERS ──────────────────────────────────────────── */
.filters-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap input { background: var(--white); padding-left: 40px; }
.search-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.filters-row select { width: auto; padding: 0 36px 0 12px; min-width: 160px; background: var(--white); }

/* ── LEADS GRID ───────────────────────────────────────── */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.lead-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s, border-color .15s, transform .1s;
  box-shadow: var(--shadow-sm);
}
.lead-card:hover {
  border-color: var(--copper-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.lead-card-header { display: flex; align-items: center; gap: 12px; }
.lead-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--copper-pale);
  color: var(--brown);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.lead-name    { font-size: 16px; font-weight: 700; color: var(--brown); }
.lead-company { font-size: 14px; color: var(--text-mid); font-weight: 500; }
.lead-meta    { font-size: 13px; color: var(--text-light); display: flex; gap: 12px; flex-wrap: wrap; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--copper-pale);
  color: var(--brown-mid);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.tag-lg {
  padding: 7px 16px;
  font-size: 14px;
}

/* ── LEAD DETAIL PAGE ─────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  transition: color .15s;
}
.back-link:hover { color: var(--brown); }

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.detail-name    { font-size: 30px; font-weight: 800; color: var(--brown); }
.detail-company { font-size: 18px; color: var(--text-mid); font-weight: 500; margin-top: 2px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 680px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.detail-card.span-2 { grid-column: 1 / -1; }
.detail-card h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--copper);
  margin-bottom: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--cream-dark);
  font-size: 15px;
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-key   { font-weight: 600; color: var(--text-mid); flex-shrink: 0; }
.info-value { color: var(--text); text-align: right; word-break: break-all; }
.info-value a { color: var(--copper); text-decoration: none; }
.info-value a:hover { text-decoration: underline; }

.business-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 500px) { .business-cards { grid-template-columns: 1fr; } }

.biz-card-wrap { display: flex; flex-direction: column; gap: 8px; }
.biz-card-label { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.biz-card-img {
  width: 100%;
  aspect-ratio: 1.75;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity .15s;
}
.biz-card-img:hover { opacity: .9; }
.biz-card-empty {
  width: 100%;
  aspect-ratio: 1.75;
  background: var(--cream);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-light);
}

/* ── EMAIL DRAFT ──────────────────────────────────────── */
.email-draft {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.email-field { display: flex; flex-direction: column; gap: 6px; }
.email-field label { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .08em; }
.email-field input  { height: 44px; font-size: 15px; }
.email-field textarea {
  font-size: 14px;
  line-height: 1.7;
  min-height: 260px;
  font-family: inherit;
}
.email-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ── TOAST ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--brown);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 300;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }

/* ── EMPTY STATE ──────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--text-light);
  font-size: 16px;
}
.empty-state p { margin-top: 8px; font-size: 14px; }

/* ── IMAGE LIGHTBOX ───────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  cursor: zoom-out;
  animation: fadeIn .15s ease;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* ── ANIMATIONS ───────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── TRADE SHOW BADGE ─────────────────────────────────── */
.show-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--brown);
  color: var(--white);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.count-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--cream-dark);
  color: var(--text-mid);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

/* ── SPINNER ──────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOADING STATE ────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
  color: var(--text-light);
  font-size: 15px;
  gap: 12px;
}
.loading-spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
