:root {
  --bg: #fbf6ea; --surface: #ffffff; --text: #23211c; --muted: #6f6a5e; --border: #e6e0d2;
  --accent: #f4c430; --accent-ink: #0b3236; --link: #0a646c; --brand: #0a646c; --danger: #b3261e;
  --ok: #2e7d32; --warn: #a15c00; --info: #275a9c;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #18171a; --surface: #222125; --text: #eeeae0; --muted: #a39e92; --border: #36343a;
    --link: #5fc4cc; --danger: #ef6b62; --ok: #7ccf80; --warn: #f0a94a; --info: #8ab4f8; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--link); }
img { max-width: 100%; }
h1, h2 { line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* buttons & forms */
button, .button { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px;
  padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.small, .small button { padding: .25rem .6rem; font-size: .85rem; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem; margin-top: .25rem; }
textarea { resize: vertical; }
label { display: block; font-weight: 500; font-size: .92rem; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .75rem; }
label.check { display: inline-flex; gap: .35rem; align-items: center; margin-right: 1rem; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.stack { display: grid; gap: .8rem; }
.stack > button, .actions button { justify-self: start; min-width: 140px; }
.row { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.actions { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
form.inline { display: inline; }
.error { color: var(--danger); font-weight: 600; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* public site */
.site-header, .site-footer { max-width: 960px; margin: 0 auto; padding: 1rem; display: flex; justify-content: space-between; align-items: center; }
.site-header nav a { margin-left: 1.25rem; color: var(--text); text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); text-decoration: none; }
.site-footer { color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); margin-top: 3rem; }
.public main { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.hero-logo { width: 240px; height: 240px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: .5rem 0; }
.tagline { font-size: clamp(1.3rem, 3.5vw, 1.7rem); font-weight: 600; color: var(--text); margin: 1.25rem 0 1.5rem; }
.intro p { font-size: 1.15rem; max-width: 680px; margin: 1rem auto 2.5rem; text-align: center; }
.services { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.service { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.service h2 { font-size: 1.15rem; margin: 0 0 .4rem; color: var(--brand); }
@media (prefers-color-scheme: dark) { .service h2 { color: var(--link); } }
/* the four peels */
.section-title { text-align: center; font-size: clamp(1.6rem, 4vw, 2rem); margin: 0 0 1.25rem; }
.story-link { text-align: center; margin: 1.5rem 0 0; }
.contact { max-width: 560px; margin: 2.5rem auto 0; }
.contact h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 0 0 .25rem; }
.contact-form { display: grid; gap: .9rem; }
.about { max-width: 680px; margin: 2.5rem auto 0; font-size: 1.1rem; }
.about h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 0 0 .25rem; }
.about h2 { font-size: 1.2rem; margin: 0 0 1.5rem; color: var(--muted); font-weight: 500; }
.about .signature { margin: 2rem 0 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); display: grid; }

/* admin */
.admin-header { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.admin-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.admin-header nav a { color: var(--text); text-decoration: none; }
.admin-header nav a.muted { color: var(--muted); }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 4rem; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; }
.page-head h1 { margin: .25rem 0; }
.crumbs { margin: 0; font-size: .9rem; }
.filters { display: flex; gap: .5rem; align-items: center; }
.filters input, .filters select { margin: 0; width: auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin: 1rem 0; }
.card h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.count { color: var(--muted); font-weight: 400; font-size: .95rem; }
details.add > summary { cursor: pointer; color: var(--link); font-weight: 600; margin: .5rem 0; }
details.add[open] > summary { margin-bottom: 1rem; }
details.add form + form { margin-top: 1rem; }
.notes { white-space: pre-wrap; }
.card.notes { color: var(--text); }
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; color: var(--muted); text-decoration: none; }
.stat b { display: block; font-size: 1.8rem; color: var(--text); }
.grid2 { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
table { width: 100%; border-collapse: collapse; }
td, th { padding: .55rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
table.list { background: var(--surface); }
tr.overdue td:first-child { box-shadow: inset 3px 0 var(--danger); }
.overdue-label { color: var(--danger); font-weight: 600; }
.meeting, .inquiry { border-top: 1px solid var(--border); padding: .9rem 0; }
.meeting-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; }
.meeting p { margin: .2rem 0; }
.inquiry .notes { margin: .4rem 0; }

.pill, .pill-select { display: inline-block; font-size: .78rem; font-weight: 600; border-radius: 999px; padding: .1rem .55rem;
  border: 1px solid currentColor; text-transform: capitalize; vertical-align: middle; }
.pill-select { width: auto; margin: 0; background: transparent; padding: .15rem .4rem; }
.pill-active, .pill-delivered, .pill-converted { color: var(--ok); }
.pill-prospect, .pill-in_progress, .pill-new { color: var(--info); }
.pill-planned { color: var(--warn); }
.pill-past, .pill-cancelled, .pill-archived { color: var(--muted); }

@media (max-width: 640px) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--border); padding: .4rem 0; }
  table.list td { display: inline-block; border: 0; padding: .2rem .5rem; }
  table.list td:first-child { display: block; }
}
