:root {
  --teal: #0e7c74;
  --teal-dark: #0a5f59;
  --teal-light: #e3f4f0;
  --ink: #14262c;
  --muted: #66797d;
  --bg: #f5f8f7;
  --card: #ffffff;
  --line: #dce5e3;
  --night: #0e161a;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #b45309;
  --red: #dc2626;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- top bar */
.top { background: var(--night); color: #fff; position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand small { font-weight: 500; color: #8fb3ad; margin-left: 2px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #b8cbc8; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: #fff; background: #1b272c; text-decoration: none; }
.nav a.on { color: #fff; background: #1f3236; }
.who { display: flex; align-items: center; gap: 12px; color: #b8cbc8; font-size: 13px; white-space: nowrap; }
.who form { margin: 0; }
.who button { background: none; border: 1px solid #33464b; color: #d5e2e0; padding: 6px 10px; border-radius: 8px; font: inherit; cursor: pointer; }
.who button:hover { background: #1b272c; }
.demo-bar { background: #fff4d6; color: #6b4a00; text-align: center; padding: 8px 16px; font-size: 13.5px; font-weight: 600; }
.demo-bar a { color: #6b4a00; text-decoration: underline; }

/* ---------- page */
.page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ---------- buttons and forms */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--teal); color: #fff; border: 1px solid var(--teal); padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--teal-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #eef3f2; }
.btn.danger { background: #fff; color: var(--red); border-color: #f1c4c4; }
.btn.danger:hover { background: #fdf0f0; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid #cbd8d6; border-radius: 10px; padding: 9px 11px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd6cf; border-color: var(--teal); }
.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg label { margin: 0; padding: 9px 16px; cursor: pointer; font-weight: 600; border-right: 1px solid var(--line); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--teal); color: #fff; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { font-weight: 500; margin: 0; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: #fff; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.checks label:has(input:checked) { border-color: var(--teal); background: var(--teal-light); }
.flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: var(--teal-light); color: var(--teal-dark); }
.flash.err { background: #fde8e8; color: #9b1c1c; }

/* ---------- tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); }
.tile:hover { text-decoration: none; border-color: #b9cfcb; }
.tile b { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; font-weight: 600; }
.tile.hot b { color: var(--amber); }

/* ---------- filters */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: #e8efee; padding: 4px; border-radius: 11px; overflow-x: auto; }
.tabs a { padding: 7px 13px; border-radius: 8px; color: var(--muted); font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.filters select, .filters input[type=search] { width: auto; min-width: 150px; padding: 7px 10px; font-size: 14px; }
.filters input[type=search] { min-width: 220px; flex: 1; max-width: 340px; }

/* ---------- job list */
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day { padding: 9px 16px; background: #f0f5f4; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.job { display: grid; grid-template-columns: 70px minmax(0, 1fr) 150px 120px; gap: 14px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.job:last-child { border-bottom: 0; }
.job:hover { background: #f8fbfa; text-decoration: none; }
.job .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.job .t small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.job .c { min-width: 0; }
.job .c b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .c span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .e { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .s { text-align: right; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.blue { background: #e6eefe; color: #1d4ed8; }
.pill.green { background: #e2f6e9; color: #15803d; }
.pill.amber { background: #fdf0dc; color: #92400e; }
.pill.red { background: #fde4e4; color: #b91c1c; }
.pill.grey { background: #edf1f1; color: #4b5d61; }
.pill.teal { background: var(--teal-light); color: var(--teal-dark); }
.type { font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; margin-right: 6px; }
.type.Survey { color: var(--teal); }
.type.Install { color: #7c3aed; }
.type.Call-out { color: var(--amber); }

/* ---------- key / value */
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 7px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-weight: 650; font-size: 12.5px; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px; border-bottom: 1px solid #edf2f1; vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

/* ---------- records and photos */
.rec { border-top: 1px solid #edf2f1; padding: 12px 0; }
.rec:first-of-type { border-top: 0; padding-top: 0; }
.rec-h { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.rec-h b { font-size: 14.5px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; margin-top: 10px; }
.photo { position: relative; display: block; border-radius: 9px; overflow: hidden; background: #e8eeed; aspect-ratio: 4 / 3; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: 11.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo.missing { display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; padding: 8px; border: 1px dashed #c6d3d1; background: #f7faf9; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid #f0f4f3; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.files a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); margin-bottom: 8px; }
.files a:hover { background: #f8fbfa; text-decoration: none; }
.files .ic { width: 34px; height: 34px; border-radius: 8px; background: #fde8e8; color: #b91c1c; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.person { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--teal-light); color: var(--teal-dark); display: grid; place-items: center; font-weight: 800; flex: none; }
.person-h { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
details summary { cursor: pointer; color: var(--teal); font-weight: 600; font-size: 14px; }
details[open] summary { margin-bottom: 10px; }

.lookup-list { border: 1px solid var(--line); border-radius: 10px; max-height: 280px; overflow: auto; margin-top: 8px; background: #fff; }
.lookup-list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eef3f2; background: none; padding: 9px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.lookup-list button:hover { background: var(--teal-light); }
.lookup-list button small { color: var(--muted); }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 50% -10%, #173a3a, var(--night)); }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand img { width: 46px; height: 46px; border-radius: 11px; }
.login-brand b { display: block; font-size: 18px; }
.login .btn { width: 100%; justify-content: center; padding: 11px; }
.login .alt { text-align: center; margin-top: 16px; font-size: 14px; }

/* ---------- phone */
@media (max-width: 900px) {
  .cols-2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .top-in { padding: 0 14px; gap: 12px; height: 54px; }
  .brand span { display: none; }
  .who .name { display: none; }
  .page { padding: 18px 14px 50px; }
  h1 { font-size: 21px; }
  .job { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .job .e { display: none; }
  .kv { grid-template-columns: 1fr; gap: 1px; }
  .kv dd { margin-bottom: 9px; }
  .filters .tabs { width: 100%; }
  .filters input[type=search] { min-width: 0; max-width: none; flex: 1 1 100%; width: 100%; }
  .filters select { flex: 1 1 40%; min-width: 0; }
  .timeline li { grid-template-columns: 74px 1fr; }
}

/* ---------- demo extras */
.demo-bar { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: center; }
.viewas { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.viewas label { margin: 0; font-size: 13px; }
.viewas select { width: auto; padding: 3px 8px; font-size: 13px; border-radius: 7px; border-color: #e0c98a; background: #fffaf0; }
.demo-app { background: #6b4a00; color: #fff !important; text-decoration: none !important; padding: 4px 11px; border-radius: 999px; font-size: 13px; }
.app-hero { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.app-hero img { border-radius: 16px; flex: none; }
.app-hero p { max-width: 720px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 42px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.steps li b { display: block; }
.steps li span { color: var(--muted); font-size: 14px; }
.tips { margin: 0; padding-left: 20px; }
.tips li { margin-bottom: 8px; }
.tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles .tile:last-child { grid-column: span 2; } }
@media (max-width: 680px) { .app-hero img { width: 54px; height: 54px; } }
