/* ═══════════════════════════════════════════════════════════════════════════
   Mark's Lead Database — Styles
   Clean professional light theme, mobile-first
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

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

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --green: #16a34a;
  --green-light: #dcfce7;
  --yellow: #ca8a04;
  --yellow-light: #fef9c3;
  --red: #dc2626;
  --red-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 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);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.4;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }

.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-outline:hover { background: var(--blue-light); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover { background: var(--red-light); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-full { width: 100%; }

/* ── Public Header ────────────────────────────────────────────────────────── */

.pub-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gray-900);
}
.logo:hover { color: var(--blue); }

.phone-link {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--blue);
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
}
.phone-link:hover { background: var(--blue); color: var(--white); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: var(--white);
  padding: 5rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-sub {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero .btn { margin: 0.5rem; }
.hero .btn-outline { color: var(--white); border-color: var(--white); }
.hero .btn-outline:hover { background: rgba(255,255,255,0.15); }

/* ── Services ─────────────────────────────────────────────────────────────── */

.services, .why-us, .service-area, .quote-section {
  padding: 4rem 0;
}

.services { background: var(--gray-50); }

.services h2, .why-us h2, .service-area h2, .quote-section h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-sub {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 2rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: box-shadow 0.2s;
}
.service-card:hover { box-shadow: var(--shadow-md); }

.service-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.service-card h3 { margin-bottom: 0.5rem; color: var(--gray-900); }
.service-card p { color: var(--gray-600); font-size: 0.9rem; }

/* ── Why Us ───────────────────────────────────────────────────────────────── */

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.why-item {
  text-align: center;
  padding: 1.5rem;
}

.why-item strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--gray-900);
}

.why-item p { color: var(--gray-600); font-size: 0.9rem; }

/* ── Quote Form ───────────────────────────────────────────────────────────── */

.quote-section { background: var(--gray-50); }

.quote-form {
  max-width: 700px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}

.form-group textarea { resize: vertical; }

.form-error {
  color: var(--red);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* ── Service Area ─────────────────────────────────────────────────────────── */

.service-area { text-align: center; }
.service-area p { color: var(--gray-600); }

.area-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.area-list span {
  padding: 0.4rem 1rem;
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.area-note { margin-top: 1rem; font-style: italic; color: var(--gray-500); }

/* ── Thank You ────────────────────────────────────────────────────────────── */

.thankyou {
  padding: 5rem 0;
  text-align: center;
}

.thankyou-card {
  max-width: 500px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
}

.thankyou-icon {
  width: 64px;
  height: 64px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
}

.thankyou h1 { margin-bottom: 1rem; }
.thankyou p { color: var(--gray-600); margin-bottom: 0.5rem; }

/* ── Public Footer ────────────────────────────────────────────────────────── */

.pub-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.admin-body { background: var(--gray-50); }

/* ── Admin Header ─────────────────────────────────────────────────────────── */

.admin-header {
  background: var(--gray-900);
  color: var(--white);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-header .header-inner { display: flex; align-items: center; gap: 1.5rem; }
.admin-header .logo { color: var(--white); font-size: 1rem; margin-right: auto; }

.admin-nav { display: flex; gap: 0.25rem; }

.nav-link {
  color: var(--gray-400);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.nav-link.active { color: var(--white); background: var(--blue); }

.logout-link { color: var(--gray-500); }
.logout-link:hover { color: var(--red-light); }

/* ── Admin Main ───────────────────────────────────────────────────────────── */

.admin-main {
  padding: 1.5rem 1.25rem;
  min-height: calc(100vh - 56px);
}

.admin-main h1 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.count { color: var(--gray-400); font-weight: 400; font-size: 1rem; }

/* ── Stats Grid ───────────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* ── Dashboard Grid ───────────────────────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dash-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.dash-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.dash-section-header h2 { font-size: 1rem; margin: 0; }

.followup-item {
  display: block;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  color: var(--gray-800);
  transition: background 0.1s;
}
.followup-item:hover { background: var(--gray-50); color: var(--gray-800); }

.followup-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.2rem;
}

.empty-state {
  text-align: center;
  color: var(--gray-400);
  padding: 1.5rem 0;
  font-size: 0.9rem;
}

.quick-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
}

/* ── Page Header ──────────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header h1 { margin-bottom: 0; }

/* ── Filter Bar ───────────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-search {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}

.filter-bar select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--white);
}

.filter-search:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}

/* ── Data Table ───────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table thead { background: var(--gray-50); }

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-200);
}

.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}

.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.clickable-row { cursor: pointer; }

/* ── Badges ───────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-new { background: var(--blue-light); color: var(--blue); }
.badge-contacted { background: var(--yellow-light); color: var(--yellow); }
.badge-quoted { background: #fae8ff; color: #a855f7; }
.badge-booked { background: var(--green-light); color: var(--green); }
.badge-completed { background: var(--gray-100); color: var(--gray-600); }
.badge-lost { background: var(--red-light); color: var(--red); }

.badge-prospect { background: var(--blue-light); color: var(--blue); }
.badge-active { background: var(--green-light); color: var(--green); }
.badge-warm { background: var(--yellow-light); color: var(--yellow); }
.badge-cold { background: var(--gray-100); color: var(--gray-500); }

/* ── Detail Form ──────────────────────────────────────────────────────────── */

.detail-form {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.meta-info {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* ── Login ────────────────────────────────────────────────────────────────── */

.login-container {
  max-width: 360px;
  margin: 10vh auto;
  padding: 2.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login-container h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.login-container p { color: var(--gray-500); margin-bottom: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 1rem; }
  .hero { padding: 3rem 0; }

  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }

  .hide-mobile { display: none; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .admin-header .header-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .admin-nav { order: 3; width: 100%; justify-content: center; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .filter-bar { flex-direction: column; }
  .filter-bar select, .filter-search { width: 100%; }

  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }

  .quick-actions { flex-direction: column; }
  .quick-actions .btn { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .hero .btn { display: block; margin: 0.5rem auto; max-width: 280px; }

  .service-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }

  .phone-link { font-size: 0.9rem; padding: 0.3rem 0.6rem; }
}
