* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f3;
  color: #1a1a1a;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Topbar ── */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.logo span { color: #2563eb; }
.user-info { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #666; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.btn-signout { background: none; border: 1px solid #e5e5e5; border-radius: 6px; padding: 4px 10px; font-size: 12px; color: #666; cursor: pointer; }
.btn-signout:hover { background: #f5f5f3; }

/* ── Main ── */
.main { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* ── Cards ── */
.card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 16px;
}

/* ── Stat row ── */
.summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: #f9f9f8; border-radius: 8px; padding: 14px; }
.stat-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 600; color: #1a1a1a; }
.stat-sub { font-size: 11px; color: #aaa; margin-top: 2px; }

/* ── Toolbar ── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select, .toolbar input {
  font-size: 13px; padding: 6px 10px; border-radius: 6px;
  border: 1px solid #e5e5e5; background: #fff; color: #1a1a1a;
  height: 34px;
}
.section-label { font-size: 13px; color: #888; margin-bottom: 10px; }

/* ── Buttons ── */
.btn-primary { background: #2563eb; color: #fff; border: none; border-radius: 6px; padding: 7px 16px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #444; border: 1px solid #e5e5e5; border-radius: 6px; padding: 7px 16px; font-size: 13px; cursor: pointer; }
.btn-secondary:hover { background: #f5f5f3; }
.btn-success { background: #16a34a; color: #fff; border: none; border-radius: 6px; padding: 7px 16px; font-size: 13px; font-weight: 500; cursor: pointer; width: 100%; }
.btn-success:hover { background: #15803d; }
.btn-skip { background: #fff; color: #666; border: 1px solid #e5e5e5; border-radius: 6px; padding: 7px 16px; font-size: 13px; cursor: pointer; width: 100%; }
.btn-skip:hover { background: #f5f5f3; }
.btn-export { margin-left: auto; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.badge-asphalt { background: #dbeafe; color: #1d4ed8; }
.badge-concrete { background: #dcfce7; color: #15803d; }
.badge-mixed { background: #fef9c3; color: #854d0e; }
.badge-absentee { background: #fee2e2; color: #b91c1c; font-size: 10px; }
.badge-owner { background: #f5f5f3; color: #666; border: 1px solid #e5e5e5; }
.badge-approved { background: #dcfce7; color: #15803d; }

/* ── Table ── */
.lead-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lead-table th { font-size: 11px; font-weight: 500; color: #aaa; text-align: left; padding: 0 12px 10px; border-bottom: 1px solid #e5e5e5; text-transform: uppercase; letter-spacing: 0.04em; }
.lead-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #1a1a1a; vertical-align: middle; }
.lead-table tr:hover td { background: #f9f9f8; cursor: pointer; }
.lead-table .addr { font-weight: 500; }
.lead-table .muted { color: #888; }
.action-btns { display: flex; gap: 6px; }
.btn-mail-it { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.btn-skip-it { background: #f5f5f3; color: #888; border: 1px solid #e5e5e5; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.btn-mailed { background: #16a34a; color: #fff; border: none; border-radius: 6px; padding: 4px 10px; font-size: 12px; }

/* ── Detail page ── */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #888; margin-bottom: 18px; cursor: pointer; text-decoration: none; }
.back-link:hover { color: #1a1a1a; }
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.detail-left { display: flex; flex-direction: column; gap: 12px; }
.detail-right { display: flex; flex-direction: column; gap: 12px; }
.map-container { border-radius: 12px; overflow: hidden; border: 1px solid #e5e5e5; height: 260px; }
.chip-container { border-radius: 12px; overflow: hidden; border: 1px solid #e5e5e5; background: #111; height: 200px; display: flex; align-items: center; justify-content: center; }
.chip-container img { width: 100%; height: 100%; object-fit: contain; }
.future-slot { border: 1px dashed #e5e5e5; border-radius: 12px; height: 60px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #bbb; gap: 8px; }
.card-title { font-size: 11px; font-weight: 600; color: #aaa; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.prop-name { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.prop-addr { font-size: 13px; color: #888; margin-bottom: 12px; }
.field-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.field-row:last-child { border-bottom: none; }
.field-label { font-size: 12px; color: #888; }
.field-value { font-size: 13px; font-weight: 500; text-align: right; }
.mail-addr { font-size: 13px; line-height: 1.7; margin-top: 4px; }
.nav-row { display: flex; justify-content: space-between; margin-top: 4px; }
.nav-btn { font-size: 12px; color: #2563eb; cursor: pointer; background: none; border: none; }

/* ── Login page ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 16px; padding: 40px; width: 360px; }
.login-logo { font-size: 22px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; }
.login-logo span { color: #2563eb; }
.login-sub { font-size: 13px; color: #888; margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 500; color: #444; margin-bottom: 6px; display: block; }
.form-input { width: 100%; padding: 9px 12px; border: 1px solid #e5e5e5; border-radius: 8px; font-size: 14px; color: #1a1a1a; outline: none; }
.form-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px #dbeafe; }
.btn-login { width: 100%; background: #2563eb; color: #fff; border: none; border-radius: 8px; padding: 10px; font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 8px; }
.btn-login:hover { background: #1d4ed8; }
.login-error { font-size: 13px; color: #b91c1c; margin-top: 12px; text-align: center; display: none; }