/* ─── INW shared theme — tokens + primitives from rep.inwmarketing.com (rep-dashboard-ref/styles.css) ───
   Every CRM page links this FIRST, then adds page-specific styles on top.
   Map pin colors are DATA SEMANTICS (dispositions) — they live in map.html, never here. */

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

:root {
  --green: #22C55E;
  --yellow: #EAB308;
  --red: #EF4444;
  --blue: #3B82F6;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  /* aliases so existing pages keep working while they migrate */
  --bg: #fff; --surface: #fff; --surface2: var(--gray-50);
  --line: var(--gray-200); --ink: var(--gray-900); --text: var(--gray-900); --muted: var(--gray-500);
}

html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fff;
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header: fixed 56px white, logo chip (logo-white.png on a dark chip — only logo asset we ship) ─── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  z-index: 100;
}
.logo-chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-900); border-radius: 8px;
  height: 34px; padding: 0 8px;
}
.logo-chip img { height: 22px; width: auto; }
.app-header .title { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; color: var(--gray-900); }
.app-header .sub { color: var(--gray-500); font-size: 12px; margin-left: auto; }
.app-header a { color: var(--gray-500); text-decoration: none; font-size: 13px; }

/* ─── Bottom tab bar: 64px, safe-area, stroke SVG icons ─── */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  padding: 8px 4px; min-width: 52px;
  color: var(--gray-400);
  font-family: inherit; font-size: 10px; font-weight: 500;
  transition: color 0.2s;
}
.tab-btn.active { color: var(--blue); }
.tab-btn svg { display: block; }

/* ─── Cards / surfaces ─── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-label {
  font-size: 11px; font-weight: 600; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 0 0 6px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 10px 16px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn:hover { background: #2563EB; }
.btn.ghost { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn.ghost:hover { background: var(--gray-50); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; }
.btn.danger { background: var(--red); color: #fff; }

/* ─── Inputs ─── */
input, select, textarea {
  width: 100%;
  background: var(--gray-50);
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: inherit; font-size: 14px;
  margin: 4px 0 10px;
  outline: none; transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
label {
  font-size: 11px; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}

/* ─── Status badges (CRM statuses mapped to the reference palette) ─── */
.pill, .badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 12px; font-size: 11px; font-weight: 600;
  line-height: 1.6; white-space: nowrap;
}
.pill.new      { background: #DBEAFE; color: #1E40AF; }
.pill.quoted   { background: #F3E8FF; color: #6B21A8; }
.pill.scheduled{ background: #DBEAFE; color: #1E3A8A; }
.pill.sold     { background: #DCFCE7; color: #166534; }
.pill.not-interested { background: #FEE2E2; color: #991B1B; }
.pill.neutral, .badge { background: var(--gray-100); color: var(--gray-700); }

/* ─── Tables ─── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--gray-100); }
th { color: var(--gray-500); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── Lists ─── */
.list-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 12px 4px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item .who b { display: block; color: var(--gray-800); font-weight: 600; }
.list-item .who span { color: var(--gray-500); font-size: 12px; }

/* ─── Text helpers ─── */
.muted { color: var(--gray-500); }
.err { color: var(--red); font-size: 13px; min-height: 1.2em; }
.ok { color: var(--green); }
a { color: var(--blue); }

/* ─── Toasts / banners ─── */
.banner {
  background: #FEF2F2; color: #991B1B; text-align: center;
  padding: 6px 12px; font-size: 12px;
  border-bottom: 1px solid #FECACA;
}

/* ─── Responsive: phone-first, centered column on desktop ─── */
@media (min-width: 768px) {
  .app-header, .tab-bar { max-width: 768px; left: 50%; transform: translateX(-50%); }
}
