:root {
  --bg: #f6f7f5; --surface: #ffffff; --ink: #1f2933; --muted: #6b7280; --line: #e5e7eb;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #e6f4f1;
  --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2; --ok: #15803d; --ok-soft: #dcfce7;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }

.demo-banner { background: #134e4a; color: #ecfdf5; font-size: .85rem; padding: .45rem 16px; text-align: center; }
.demo-banner .link-button { color: #a7f3d0; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1.5rem; padding: .6rem 24px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand span { background: var(--accent); color: var(--accent-ink); border-radius: 5px; padding: 1px 6px; font-size: .75rem; margin-left: 2px; vertical-align: 2px; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.nav-link { color: var(--muted); text-decoration: none; padding: .35rem .7rem; border-radius: 7px; font-weight: 500; }
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.who { color: var(--muted); font-size: .85rem; }

.page { max-width: 1080px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.flash { border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; }
.flash-notice { background: var(--ok-soft); color: #14532d; }
.flash-alert { background: var(--bad-soft); color: #7f1d1d; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: inherit; display: block; }
.stat:hover { border-color: var(--accent); }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .85rem; color: var(--muted); }
.stat.attention .value { color: var(--warn); }
.stat.bad .value { color: var(--bad); }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.list td { padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill-draft, .pill-needs_review { background: #f3f4f6; color: #374151; }
.pill-awaiting, .pill-ready { background: var(--accent-soft); color: var(--accent); }
.pill-overdue { background: var(--warn-soft); color: var(--warn); }
.pill-paid, .pill-invoiced, .pill-confirmed { background: var(--ok-soft); color: var(--ok); }
.pill-void, .pill-excluded { background: #f3f4f6; color: var(--muted); text-decoration: line-through; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tab { padding: .5rem .8rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab.active { color: var(--accent); border-color: var(--accent); }
.tab .count { background: var(--bg); border-radius: 999px; padding: 0 7px; font-size: .78rem; margin-left: 3px; }

.btn, button.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: .5rem .95rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--surface); color: var(--bad); border: 1px solid #fecaca; }
.btn-small { padding: .3rem .65rem; font-size: .85rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
form.inline, .inline { display: inline; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: .45rem .6rem; border: 1px solid #d1d5db; border-radius: 7px; background: #fff; color: var(--ink);
}
textarea { min-height: 4.5rem; }
.field { margin-bottom: .85rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.errors { background: var(--bad-soft); color: #7f1d1d; border-radius: 8px; padding: .6rem .9rem; margin-bottom: 1rem; }
details.inline-form summary { cursor: pointer; color: var(--accent); font-weight: 500; }
details.inline-form[open] { background: var(--bg); border-radius: 8px; padding: .75rem; margin-top: .4rem; }

.walk { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 1rem; overflow: hidden; }
.walk-head { padding: .7rem 1rem; background: #fafaf9; border-bottom: 1px solid var(--line); display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.walk-head strong { font-size: 1rem; }
.proposal { padding: .85rem 1rem; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(150px, 1fr) 2.4fr; gap: 1rem; align-items: start; }
.proposal:last-child { border-bottom: 0; }
.proposal .who { color: var(--ink); font-size: 1rem; }
.proposal form .row { align-items: flex-end; }
.proposal form .field { margin-bottom: .5rem; }
.done-line { color: var(--muted); font-size: .9rem; }
.dogs { color: var(--muted); }

.link-box { display: flex; gap: .5rem; }
.link-box input { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
.map { height: 280px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--accent-soft); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.photo-pick { position: relative; }
.photo-pick input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.timeline li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.empty { color: var(--muted); padding: 1.5rem; text-align: center; }

/* Landing */
.hero { max-width: 760px; margin: 3rem auto; text-align: center; }
.hero h1 { font-size: 2.3rem; margin-bottom: .75rem; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); margin: 0 auto 1.75rem; max-width: 560px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: left; margin-top: 3rem; }
.steps .card h3 { color: var(--accent); }

/* Client-facing pages */
body.public { background: #f4f6f4; }
.public-page { max-width: 640px; margin: 0 auto; padding: 24px 16px; }
.public-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 16px 2rem; }
.report-head { text-align: center; margin-bottom: 1.25rem; }
.report-head .biz { color: var(--accent); font-weight: 600; }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.report-stats .value { font-size: 1.35rem; font-weight: 700; }
.report-stats .label { color: var(--muted); font-size: .8rem; }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: .9rem 1rem; font-size: 1rem; }
.invoice-doc .head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.invoice-doc .total { font-size: 1.4rem; font-weight: 700; }
.banner-void { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: .6rem .9rem; font-weight: 600; text-align: center; margin-bottom: 1rem; }
.banner-paid { background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: .6rem .9rem; font-weight: 600; text-align: center; margin-bottom: 1rem; }

@media (max-width: 760px) {
  .page { padding: 16px; }
  .topbar { padding: .6rem 16px; gap: .5rem; }
  .who { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .steps { grid-template-columns: 1fr; }
  .proposal { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  table.list th, table.list td { padding: .5rem .35rem; }
  .hero h1 { font-size: 1.8rem; }
}

/* Photos, logos, route sketches */
.avatar { border-radius: 50%; object-fit: cover; vertical-align: middle; flex: none; }
.avatar-letter { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.dog-cell { display: flex; align-items: center; gap: .6rem; }
.logo { border-radius: 6px; object-fit: contain; vertical-align: middle; }
.brand-logo { display: flex; align-items: center; gap: .5rem; }
.route-sketch { color: var(--accent); background: var(--accent-soft); border-radius: 8px; flex: none; display: block; }
.empty-sketch { background: var(--bg); }
.walk-row { display: flex; gap: .9rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.walk-row:last-child { border-bottom: 0; }
.walk-row:hover .walk-when { color: var(--accent); }
.walk-row .grow { flex: 1; min-width: 0; }
.walk-when { font-weight: 600; }
.walk-tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .2rem; }
.report-dogs { display: flex; justify-content: center; gap: .5rem; margin: .5rem 0; }
