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

:root {
  --green: #2d5a27;
  --green-light: #3d7a35;
  --green-dark: #1a3a16;
  --slate: #3a4a3f;
  --cream: #f5f2eb;
  --white: #ffffff;
  --border: #d4d9d0;
  --text: #1e2820;
  --text-muted: #5a6b5e;
  --featured: #c8860a;
  --pro: #7b4fcf;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-light); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 560px; }

/* ===== HEADER ===== */
header {
  background: var(--green-dark);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  letter-spacing: -0.3px;
}

header nav { display: flex; gap: 24px; }
header nav a { color: rgba(255,255,255,0.85); font-size: 0.9rem; text-decoration: none; }
header nav a:hover { color: white; }

/* ===== FOOTER ===== */
footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.7);
  padding: 32px 0;
  margin-top: 64px;
  font-size: 0.9rem;
  text-align: center;
}

footer a { color: rgba(255,255,255,0.8); }
footer p + p { margin-top: 8px; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  color: white;
  padding: 64px 0;
  text-align: center;
}

.hero h1 { font-size: 2.4rem; margin-bottom: 12px; }
.hero p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 32px; }

.search-bar {
  display: flex;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.search-bar input, .search-bar select {
  flex: 1;
  min-width: 160px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  background: white;
  color: var(--text);
}

.search-bar button {
  padding: 12px 28px;
  background: var(--featured);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.search-bar button:hover { background: #a87008; }

/* ===== SECTIONS ===== */
section { padding: 48px 0; }
section h2 { margin-bottom: 24px; }

/* ===== CATEGORY GRID ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate);
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.category-card:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.category-card .icon { font-size: 1.8rem; }

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

.listing-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.listing-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}

.listing-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.listing-card h3 { font-size: 1rem; margin-bottom: 4px; }
.listing-card .town { font-size: 0.85rem; color: var(--text-muted); }
.listing-card .category { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.featured-card { border-left: 3px solid var(--featured); }
.pro-card { border-left: 3px solid var(--pro); }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 4px;
  margin-top: 4px;
}

.badge.verified { background: #e8f5e9; color: #2e7d32; }
.badge.insured { background: #e3f2fd; color: #1565c0; }
.badge.featured { background: #fff3e0; color: #e65100; }
.badge.pro { background: #ede7f6; color: #4527a0; }

.plan-free { background: #f5f5f5; color: #555; }
.plan-featured { background: #fff3e0; color: #e65100; }
.plan-pro { background: #ede7f6; color: #4527a0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
  width: 100%;
  margin-bottom: 8px;
}

.btn:hover { background: var(--green-light); color: white; text-decoration: none; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
}

.btn-outline:hover { background: var(--green); color: white; }

.btn-phone { background: var(--green-dark); font-size: 1.1rem; }
.btn-pro { background: var(--pro); }
.btn-pro:hover { background: #6a3db5; }

.btn-sm { padding: 5px 12px; font-size: 0.82rem; width: auto; margin-bottom: 0; }

/* ===== FORMS ===== */
label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 14px 0 4px;
  color: var(--slate);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: white;
  color: var(--text);
  transition: border 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45,90,39,0.1);
}

textarea { resize: vertical; }

.checkbox-row { display: flex; gap: 20px; margin: 14px 0; flex-wrap: wrap; }
.checkbox-row label { margin: 0; font-weight: 400; display: flex; align-items: center; gap: 6px; }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 600;
}
.alert.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert.error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* ===== CARDS ===== */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ===== LISTING DETAIL ===== */
.listing-detail {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding-top: 32px;
}

.listing-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.listing-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.listing-main h1 { margin-bottom: 4px; }
.description { margin: 16px 0; color: var(--slate); line-height: 1.7; }

.services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.services li {
  background: #f0f4f0;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.88rem;
  color: var(--slate);
}

.contact-card { text-align: center; }

.lead-form input,
.lead-form textarea { margin-bottom: 8px; }

.review {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.review strong { margin-right: 8px; }

/* ===== DASHBOARD ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  padding-top: 24px;
}

.plan-badge {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 12px;
}

.lead-item { font-size: 0.88rem; margin-bottom: 8px; }

/* ===== ADMIN ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-num { display: block; font-size: 2.4rem; font-weight: 700; color: var(--green); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

.admin-nav { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.admin-nav .btn { width: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.admin-table th {
  background: var(--green-dark);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f9fbf9; }
.row-pending td { background: #fffde7; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0;
}

.page-header .btn { width: auto; }

.status-pending { background: #fff3e0; color: #e65100; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }

/* ===== CATEGORIES NAV ===== */
.categories-nav {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.categories-nav h3 { margin-bottom: 12px; }

.categories-nav a {
  display: inline-block;
  padding: 4px 12px;
  margin: 4px;
  border-radius: 20px;
  font-size: 0.85rem;
  background: white;
  border: 1px solid var(--border);
  color: var(--slate);
}

.categories-nav a:hover, .categories-nav a.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
  text-decoration: none;
}

/* ===== CTA SECTION ===== */
.cta {
  background: var(--green-dark);
  color: white;
  text-align: center;
  padding: 48px 0;
}

.cta h2 { color: white; margin-bottom: 8px; }
.cta p { opacity: 0.85; margin-bottom: 20px; }
.cta .btn { width: auto; background: var(--featured); font-size: 1.1rem; padding: 14px 32px; }

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.badges { margin-top: 8px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.7rem; }
  .listing-detail, .dashboard-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  header nav { gap: 12px; }
  .admin-table { font-size: 0.8rem; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
}
