/* SnowCue - mobile-first. Big tap targets, high contrast for gloves-and-sunlight.
   Palette: Elite Lawncare & Landscaping greens (lime #b5d334 -> green #3fae49) on a deep green header. */
:root {
  --bg: #f2f6f0; --card: #ffffff; --ink: #14261b; --muted: #5f7266; --line: #dbe5d8;
  --brand: #143524; --brand-2: #1d4d33;        /* header gradient */
  --accent: #2f9e44; --accent-2: #3fae49;      /* buttons, active states */
  --lime: #b5d334; --link: #1f7a31;            /* lime highlight; darker green for readable text links */
  --accent-soft: #e6f4e4;                      /* light green tint: active nav, "complete" badges */
  --ok: #2f9e44; --warn: #d97706; --bad: #dc2626;
  --radius: 14px; --tap: 56px;
  --shadow: 0 1px 2px rgba(20, 38, 27, .05), 0 4px 14px rgba(20, 38, 27, .05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c1510; --card: #142019; --ink: #e7f0e8; --muted: #9db3a3; --line: #27402f;
    --brand: #0a1a10; --brand-2: #143524; --link: #7cd46a; --accent-soft: #1b3324;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--link); text-decoration: none; }
h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: .6rem; }

/* top bar: deep green with the Elite leaf, lime-to-green rule underneath */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; padding: .55rem 1rem;
  padding-top: calc(.55rem + env(safe-area-inset-top)); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--lime), var(--accent-2)); }
.topbar a { color: #fff; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.topnav { display: none; gap: .25rem; flex: 1; }
.topnav a { padding: .4rem .8rem; border-radius: 8px; opacity: .85; font-weight: 500; }
.topnav a.on, .topnav a:hover { background: rgba(255, 255, 255, .12); opacity: 1; color: var(--lime); }
.topright { margin-left: auto; display: flex; gap: .75rem; align-items: center; font-size: .9rem; }
.who { opacity: .85; display: none; }
.net { color: var(--lime); } .net.off { color: #f59e0b; }

/* page */
.page { padding: 1rem; padding-bottom: calc(80px + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: .75rem; }
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: .75rem; font-weight: 500; }
.flash.ok { background: #e3f3df; color: #1b5e2a; border-left: 4px solid var(--accent); }
.flash.error { background: #fee2e2; color: #7f1d1d; border-left: 4px solid var(--bad); }
.flash.warn { background: #fef3c7; color: #78350f; border-left: 4px solid var(--warn); }

/* bottom nav (mobile) */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(20, 38, 27, .06); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: .5rem 0 .4rem;
  color: var(--muted); font-size: .72rem; font-weight: 600; border-top: 3px solid transparent; margin-top: -1px; }
.bottomnav a span { font-size: 1.35rem; line-height: 1.2; }
.bottomnav a.on { color: var(--link); border-top-color: var(--accent); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px;
  padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary, .btn.ok { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: var(--accent);
  color: #fff; box-shadow: 0 2px 8px rgba(47, 158, 68, .3); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; }

/* big service buttons on the site screen */
.svc-btn { display: flex; align-items: center; gap: 1rem; width: 100%; min-height: 84px; padding: 1rem 1.1rem;
  border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink);
  text-align: left; font-size: 1.15rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.svc-btn .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.svc-btn .sub { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-top: .15rem; }
.svc-btn.done { border-color: var(--accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--lime) 18%, var(--card)), color-mix(in srgb, var(--accent) 12%, var(--card))); }
.svc-btn.done .check { margin-left: auto; color: var(--accent); font-size: 1.6rem; }
.svc-btn.notmine { opacity: .55; }
.svc-btn:active { transform: scale(.99); }

/* site list */
.site-list { display: grid; gap: .6rem; }
.site { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); min-height: var(--tap); box-shadow: var(--shadow); }
.site:active { border-color: var(--accent); }
.site .name { font-weight: 700; }
.site .addr { color: var(--muted); font-size: .85rem; }
.site .chips { margin-left: auto; display: flex; gap: .35rem; flex: none; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 .5rem;
  border-radius: 999px; font-size: .75rem; font-weight: 700; border: 2px solid var(--line); color: var(--muted); }
.chip.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.pending { border-style: dashed; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.open { background: #fef3c7; color: #78350f; } .badge.complete { background: var(--accent-soft); color: var(--link); }
.badge.incomplete { background: #fee2e2; color: #7f1d1d; }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: .7rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search],
input[type=date], input[type=datetime-local], input[type=color], select, textarea {
  width: 100%; min-height: 46px; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font-size: 1rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 174, 73, .2); }
textarea { min-height: 80px; }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; min-height: 40px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.grid2 { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg a, .seg button { flex: 1; text-align: center; padding: .6rem; background: var(--card); color: var(--ink); font-weight: 600; border: 0; }
.seg .on { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .92rem; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--link);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--card)); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-wrap table { border-radius: 0; }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.tl li:last-child { border-bottom: 0; }
.tl .t { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 70px; }
.photo { max-width: 100%; border-radius: 10px; margin-top: .5rem; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; vertical-align: middle; margin-left: .5rem;
  border: 2px solid var(--line); }

/* stat tiles */
.stats { display: grid; gap: .6rem; grid-template-columns: repeat(2, 1fr); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem;
  box-shadow: var(--shadow); border-top: 3px solid var(--accent); }
.stat .n { font-size: 1.6rem; font-weight: 800; color: var(--link); }
.stat .l { color: var(--muted); font-size: .8rem; }

/* login */
.login { max-width: 400px; margin: 7vh auto; padding: 1.5rem; }
.login-logo { display: block; width: min(260px, 75%); margin: 0 auto .4rem; }
.login .app { text-align: center; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  font-size: .78rem; margin-bottom: .75rem; }

/* desktop */
@media (min-width: 820px) {
  .topnav { display: flex; }
  .who { display: inline; }
  .bottomnav { display: none; }
  .page { padding: 1.5rem; padding-bottom: 2rem; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .site-list.cols { grid-template-columns: 1fr 1fr; }
  .admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
  .sidenav { position: sticky; top: 72px; align-self: start; display: flex; flex-direction: column; gap: .15rem; }
  .sidenav a { padding: .55rem .8rem; border-radius: 8px; color: var(--ink); font-weight: 500; }
  .sidenav a:hover { background: var(--card); }
  .sidenav a.on { background: var(--accent-soft); color: var(--link); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
  .grid3 { display: grid; gap: .6rem; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 819px) {
  .sidenav { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .5rem; }
  .sidenav a { white-space: nowrap; padding: .4rem .7rem; border-radius: 999px; background: var(--card);
    border: 1px solid var(--line); color: var(--ink); font-size: .85rem; }
  .sidenav a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
}
