:root {
  --primary: var(--brand-primary, #2f5233);
  --accent: var(--brand-accent, #c08a3e);
  --ink: #212a20;
  --muted: #6b7566;
  --border: #e1e6da;
  --cream: #f7f6f0;
  --white: #ffffff;
  --danger: #b3441e;
  --danger-bg: #fbe9e2;
  --warn-bg: #fdf1d6;
  --warn-ink: #8a6100;
  --ok-bg: #e4f1e2;
  --ok-ink: #216633;
  --radius: 12px;
  --shadow: 0 4px 18px rgba(33, 42, 32, 0.07);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--primary); }
a:hover { color: color-mix(in srgb, var(--primary) 80%, black); }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); margin-top: 0; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; font-weight: 600; }
h2 { font-size: 1.6rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

/* ---------- Top nav ---------- */
.topnav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topnav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand .leaf { font-size: 1.5rem; }
.brand-logo { height: 34px; width: auto; border-radius: 4px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:last-child {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border-bottom: none;
}
.nav-links a:last-child:hover { opacity: 0.9; color: white; }

/* ---------- Layout ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.container.narrow { max-width: 640px; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-header p.subtitle { color: var(--muted); margin: 0.3rem 0 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
}
.card h2, .card h3 { margin-top: 0; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}
.stat-card .stat-number { font-size: 2rem; font-weight: 600; color: var(--primary); font-family: var(--serif); }
.stat-card .stat-label { color: var(--muted); font-size: 0.9rem; }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}
.section-title h2 { margin-bottom: 0; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.empty-row td { color: var(--muted); font-style: italic; text-align: center; padding: 1.75rem; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.87rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=datetime-local], input[type=number], textarea, select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.field { margin-bottom: 1.1rem; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row > .field { flex: 1; min-width: 160px; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; margin-bottom: 1.1rem; }
legend { padding: 0 0.4rem; font-weight: 600; color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:hover { opacity: 0.9; color: var(--white); }
.btn:active { transform: scale(0.98); }
.btn.btn-secondary { background: var(--white); color: var(--primary); border: 1px solid var(--primary); }
.btn.btn-secondary:hover { background: color-mix(in srgb, var(--primary) 8%, white); }
.btn.btn-danger { background: var(--danger); }
.btn.btn-danger:hover { background: #8f3616; }
.btn.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* ---------- Badges / status pills ---------- */
.pill { display: inline-block; padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.pill-pending { background: var(--warn-bg); color: var(--warn-ink); }
.pill-paid { background: var(--ok-bg); color: var(--ok-ink); }
.pill-overdue { background: var(--danger-bg); color: var(--danger); }
.pill-void { background: #ececec; color: #777; }
.pill-scheduled { background: color-mix(in srgb, var(--primary) 14%, white); color: var(--primary); }
.pill-completed { background: var(--ok-bg); color: var(--ok-ink); }
.pill-cancelled { background: #ececec; color: #777; }
.pill-new { background: var(--warn-bg); color: var(--warn-ink); }
.pill-contacted { background: color-mix(in srgb, var(--primary) 14%, white); color: var(--primary); }
.pill-converted { background: var(--ok-bg); color: var(--ok-ink); }
.pill-archived { background: #ececec; color: #777; }

/* ---------- Alerts ---------- */
.alert { padding: 0.85rem 1.1rem; border-radius: 10px; margin-bottom: 1.3rem; font-size: 0.92rem; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #eecabb; }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #bfe3c4; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card { max-width: 380px; width: 100%; }

/* ---------- Hero block ---------- */
.hero {
  background: radial-gradient(ellipse at top left, color-mix(in srgb, var(--primary) 92%, black), var(--primary) 60%);
  color: var(--white);
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-inner { max-width: 640px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { color: var(--white); font-size: 2.75rem; margin-bottom: 0.6rem; }
.hero p { color: rgba(255,255,255,0.88); font-size: 1.15rem; max-width: 560px; margin: 0 auto 1.75rem; }
.hero .btn { background: var(--accent); color: white; }
.hero .btn:hover { opacity: 0.92; }
.hero-image { max-width: 100%; border-radius: var(--radius); margin-bottom: 1.5rem; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }

/* ---------- Content blocks (public pages) ---------- */
.content-card { max-width: 760px; margin-left: auto; margin-right: auto; }
.section-heading { text-align: center; max-width: 640px; margin: 0 auto 1.75rem; }
.section-heading p.subtitle { color: var(--muted); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 0 0 1rem;
}
.service-card { text-align: center; padding: 1.75rem 1.25rem; }
.service-card .icon { font-size: 2.2rem; margin-bottom: 0.6rem; }

.cta-card { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; background: color-mix(in srgb, var(--primary) 6%, white); }

.image-block { margin: 0 0 1.75rem; text-align: center; }
.image-block img { max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.image-block.full-width { margin: 0; }
.image-block.full-width img { border-radius: 0; width: 100%; display: block; }
.image-block figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 0.6rem; }

/* ---------- Page editor (admin) ---------- */
.block-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.block-image-preview { max-width: 220px; max-height: 140px; border-radius: 8px; border: 1px solid var(--border); display: block; margin-bottom: 0.4rem; object-fit: cover; }
.service-items { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.75rem; }

/* ---------- Messages / chat ---------- */
.message-thread { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; max-height: 460px; overflow-y: auto; padding-right: 0.25rem; }
.message-bubble { max-width: 75%; padding: 0.6rem 0.9rem; border-radius: 12px; font-size: 0.93rem; }
.message-bubble .meta { font-size: 0.75rem; opacity: 0.7; margin-top: 0.3rem; }
.message-bubble.from-customer { background: color-mix(in srgb, var(--primary) 10%, white); align-self: flex-start; border-bottom-left-radius: 2px; }
.message-bubble.from-admin { background: var(--primary); color: var(--white); align-self: flex-end; border-bottom-right-radius: 2px; }
.message-bubble.from-admin .meta { color: rgba(255,255,255,0.85); }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.footer { text-align: center; padding: 2.5rem 1rem; color: var(--muted); font-size: 0.85rem; }
.invoice-box { max-width: 640px; }
.invoice-box .totals-row td { font-weight: bold; border-top: 2px solid var(--primary); }
@media print {
  .topnav, .no-print { display: none !important; }
  body { background: white; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .topnav-inner { height: auto; flex-wrap: wrap; padding: 0.75rem 0; gap: 0.5rem; }
}
