:root {
  /* Sela brand — matches the Site Travel Time Monitoring app */
  --navy: #0b2a5b; --navy-2: #0a6fb8; --brand: #0b5cad; --green: #2f9e44; --lime: #8dc63f;
  --accent: #0b5cad; --accent-2: #094a8c;
  --hero-img: url("../img/bg.jpg");
  --bg: #f3f5f8; --card: #ffffff; --ink: #2b3038; --muted: #5f6b7a; --line: #e2e6eb;
  --ok: #2f9e44; --warn: #e67700; --err: #c92a2a; --info: #1971c2;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); font-size: 15px; line-height: 1.45;
  /* Photo backdrop, softened so cards and text stay readable (falls back to plain background) */
  background: linear-gradient(rgba(243,245,248,.86), rgba(243,245,248,.92)), var(--hero-img) center 30% / cover fixed no-repeat, var(--bg); }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; }
@media (max-width: 760px) { body { background-attachment: scroll; } }
a { color: var(--info); }
header.top { background: #fff; color: var(--ink); padding: .55rem 20px; min-height: 60px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 1200; border-bottom: 3px solid; border-image: linear-gradient(90deg, var(--navy), #0a8fd6, var(--green), var(--lime)) 1; }
header.top .brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
header.top .logo { height: 42px; width: auto; display: block; }
header.top .logo-text { font-weight: 900; font-size: 26px; letter-spacing: 1px; color: #2a333d; }
header.top .product { font-size: .85rem; color: var(--muted); padding-left: .75rem; border-left: 1px solid #d5dae1; }
header.top .spacer { flex: 1; }
header.top .who { font-size: 13px; color: var(--muted); }
header.top .who a { color: var(--brand); font-weight: 600; }
@media (max-width: 560px) { header.top .logo { height: 34px; } header.top .product, header.top .who { display: none; } }
main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 80px; }
h1 { font-size: 24px; margin: 4px 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.btn { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { background: #f1f3f5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.ghost { background: transparent; border-color: transparent; color: inherit; }
.btn.danger { color: var(--err); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
header.top .btn.ghost { border-color: #d5dae1; background: #fff; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }
label.f { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13.5px; }
label.f .req { color: var(--err); }
label.f .hint, .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=search], select, textarea {
  font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid #c8ced6; border-radius: 7px; background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(11,92,173,.3); border-color: var(--accent); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; background: #f8f9fa; border: 1px solid var(--line); padding: 6px 10px; border-radius: 20px; cursor: pointer; font-size: 13.5px; }
.opts label:has(input:checked) { background: #e7f1fb; border-color: var(--accent); }
.opts input { margin: 0; accent-color: var(--accent); }

/* Stepper */
.steps { display: flex; gap: 6px; margin: 0 0 18px; overflow-x: auto; padding-bottom: 4px; }
.steps button { flex: 1; min-width: 120px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; color: var(--muted); }
.steps button b { display: block; color: var(--ink); font-size: 13.5px; }
.steps button.active { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); color: var(--ink); }
.steps button.done b::after { content: " ✓"; color: var(--ok); }
.stepnav { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.savestate { font-size: 12.5px; color: var(--muted); }

/* Pills / tables */
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.pill.info { background: #e7f1fb; color: var(--info); }
.pill.ok { background: #e6f6ea; color: var(--ok); }
.pill.warn { background: #fff3e0; color: var(--warn); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #fafbfc; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Map step */
.mapwrap { display: grid; grid-template-columns: 340px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; min-height: 620px; }
.mapwrap .side { border-right: 1px solid var(--line); display: flex; flex-direction: column; max-height: 720px; }
.mapwrap .side .head { padding: 14px; border-bottom: 1px solid var(--line); }
.mapwrap .side .stages { overflow-y: auto; flex: 1; padding: 10px; }
.mapwrap #map, .mapwrap .map { height: 100%; min-height: 620px; }
@media (max-width: 900px) { .mapwrap { grid-template-columns: 1fr; } .mapwrap .side { max-height: none; border-right: 0; border-bottom: 1px solid var(--line); } .mapwrap #map { min-height: 460px; } }
.search { position: relative; }
.search .results { position: absolute; z-index: 1100; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); margin-top: 4px; max-height: 260px; overflow: auto; }
.search .results div { padding: 8px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f1f3f5; }
.search .results div:hover { background: #e7f1fb; }
.stage { border: 1px solid var(--line); border-left: 5px solid var(--c, #999); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.stage.active { box-shadow: 0 0 0 2px var(--c); }
.stage .t { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.stage .t .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }
.stage .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.stage .body { margin-top: 10px; display: none; gap: 10px; flex-direction: column; cursor: default; }
.stage.active .body { display: flex; }
.stage .body label.f { font-size: 12.5px; }
.stage .body input, .stage .body select, .stage .body textarea { padding: 7px 9px; font-size: 13.5px; }
.stage .body textarea { min-height: 60px; }
.stage .body .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawhelp { background: #fff8ec; border: 1px solid #ffe0a8; border-radius: 8px; padding: 9px 11px; font-size: 12.5px; color: #6b4a00; margin-top: 10px; }
.leaflet-tooltip.stage-label { background: rgba(20,33,61,.88); color: #fff; border: 0; font-weight: 700; font-size: 12px; box-shadow: none; }
.leaflet-tooltip.stage-label::before { display: none; }

/* Review */
.kv { display: grid; grid-template-columns: 260px 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 700px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; } }
.issues { background: #fff5f5; border: 1px solid #ffc9c9; border-radius: 8px; padding: 12px 14px; }
.issues li { margin: 3px 0; }
.issues a { cursor: pointer; }
.banner { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.banner.warn { background: #fff3e0; border: 1px solid #ffd8a8; }
.banner.info { background: #e7f1fb; border: 1px solid #a5d8ff; }
.banner.err { background: #fff5f5; border: 1px solid #ffc9c9; }

/* Auth */
.auth { max-width: 460px; margin: 60px auto; }
.auth .card { padding: 28px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 3000; font-size: 14px; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--err); }
.hidden { display: none !important; }

/* Admin */
.adminlayout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .adminlayout { grid-template-columns: 1fr; } }
.notes .note { border-bottom: 1px solid var(--line); padding: 8px 0; font-size: 13.5px; }
.notes .note small { color: var(--muted); display: block; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
@media print {
  header.top, .noprint, .steps, .stepnav { display: none !important; }
  main { padding: 0; max-width: none; } .card { box-shadow: none; break-inside: avoid; }
  .adminlayout { grid-template-columns: 1fr; }
}

/* ---------- Brand hero (sign-in) and banners — same look as the travel-time app ---------- */
body.landing main { max-width: none; padding: 0; }
.hero-landing { min-height: calc(100vh - 63px); display: grid; place-items: center; padding: 2rem 1rem;
  background: linear-gradient(180deg, rgba(11,42,91,.35), rgba(11,42,91,.65)), var(--hero-img) center 40% / cover no-repeat,
  linear-gradient(135deg, #0b2a5b 0%, #0a6fb8 55%, #2f9e44 100%); }
.hero-card { background: #fff; color: var(--ink); border-radius: 16px; padding: 2rem 1.75rem; max-width: 470px; width: 100%;
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.hero-logo { width: 100%; max-width: 320px; height: auto; margin: 0 auto 1rem; display: block; }
.hero-card h1 { font-size: 1.35rem; margin-bottom: .5rem; }
.hero-card form { text-align: left; margin-top: 1rem; }
.hero-card .btn.primary { width: 100%; justify-content: center; padding: .7rem 1.4rem; font-size: 1rem; margin-top: .6rem; }
.hero-foot { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); font-size: .8rem; text-align: center; margin-top: 1rem; }
.hero-foot a { color: #fff; }
.hero-banner { position: relative; border-radius: 14px; overflow: hidden; color: #fff; padding: 1.5rem 1.25rem; margin-bottom: 1rem; min-height: 130px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(11,42,91,.9) 0%, rgba(11,42,91,.55) 55%, rgba(11,42,91,.15) 100%), var(--hero-img) center 55% / cover no-repeat,
  linear-gradient(135deg, #0b2a5b 0%, #0a6fb8 60%, #2f9e44 100%); }
.hero-banner h1 { font-size: 1.4rem; margin: .1rem 0 .25rem; color: #fff; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: var(--lime); }
.banner-sub { margin: 0; font-size: .9rem; opacity: .9; max-width: 36rem; }
.hero-banner .btn { background: #fff; color: var(--navy); border-color: #fff; }
.hero-banner .btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.hero-banner input[type=search] { max-width: 300px; }
@media (max-width: 560px) { .hero-banner { padding: 1rem; min-height: 96px; } .hero-banner h1 { font-size: 1.15rem; } }
footer.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2rem; }
body.landing footer.foot { display: none; }
