:root {
  --brand: #1F6FEB;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
  --ink: #16202c;
  --muted: #5d6b7c;
  --line: #e3e8ef;
  --bg: #f5f7fa;
  --card: #ffffff;
  --red: #d93a3a;   --red-soft: #fdecec;
  --amber: #c27c0e; --amber-soft: #fdf4e3;
  --green: #1f8a4c; --green-soft: #e6f5ec;
  --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; height: 100%; }
body { font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 32px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card p.sub { margin: 0 0 24px; color: var(--muted); }
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 600; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #33404f; }
.field small { color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfd7e2; border-radius: 8px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 90px; resize: vertical; }
input[type=time] { padding: 7px 8px; border: 1px solid #cfd7e2; border-radius: 8px; background: #fff; }
input[type=time]:disabled { opacity: .4; }
.hours { display: grid; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 90px auto auto auto; gap: 8px; align-items: center; justify-content: start; font-size: 14px; color: var(--muted); }
.avail { font-size: 12px; margin-top: 6px; }
.avail.ok { color: var(--green); }
.avail.wait { color: var(--amber); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; background: #fff; }
.chip-check input { margin: 0; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; text-align: center; padding: 9px; border: 1px solid #cfd7e2; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.seg input { display: none; }
.seg input:checked + span { color: #fff; }
.seg label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg label.emergency:has(input:checked) { background: var(--red); border-color: var(--red); }
.seg label.urgent:has(input:checked) { background: var(--amber); border-color: var(--amber); }
.error { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.notice { background: var(--brand-soft); padding: 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; font-size: 14px; }
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.block { width: 100%; padding: 11px; }
.btn.ghost { background: #fff; color: var(--ink); border-color: #cfd7e2; }
.btn.danger { background: #fff; color: var(--red); border-color: #f1c4c4; }
.btn.small { padding: 6px 10px; font-size: 13px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand .logo { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand .name { font-weight: 700; line-height: 1.2; }
.brand .powered { font-size: 11px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: #33404f; font-weight: 500; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side .spacer { flex: 1; }
.side .me { font-size: 13px; color: var(--muted); padding: 8px 10px; border-top: 1px solid var(--line); }
.main { padding: 24px 28px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 22px; }
.topbar .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mobile-nav { display: none; }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.col { background: #eef2f6; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col h3 { margin: 2px 4px 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; justify-content: space-between; }
.card { background: var(--card); border-radius: 8px; box-shadow: var(--shadow); padding: 12px; margin-bottom: 10px; cursor: pointer; border-left: 4px solid transparent; }
.card:hover { box-shadow: 0 4px 12px rgba(16,24,40,.12); }
.card.emergency { border-left-color: var(--red); }
.card.urgent { border-left-color: var(--amber); }
.card .t { font-weight: 600; margin-bottom: 4px; }
.card .a { font-size: 13px; color: var(--muted); }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 16px 6px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef2f6; color: #33404f; white-space: nowrap; }
.pill.emergency { background: var(--red-soft); color: var(--red); }
.pill.urgent { background: var(--amber-soft); color: var(--amber); }
.pill.routine { background: var(--green-soft); color: var(--green); }
.pill.status { background: var(--brand-soft); color: var(--brand); }
.age { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ---------- Tables ---------- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td .sub { font-size: 13px; color: var(--muted); }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal header { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal header h3 { margin: 0; font-size: 18px; }
.modal .body { padding: 20px 22px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 14px 14px; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
.section { margin-bottom: 18px; }
.section h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.desc { white-space: pre-wrap; background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #16202c; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-nav { display: flex; gap: 4px; background: #fff; border-bottom: 1px solid var(--line); padding: 8px; position: sticky; top: 0; z-index: 10; overflow-x: auto; }
  .mobile-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: #33404f; font-weight: 600; font-size: 14px; white-space: nowrap; }
  .mobile-nav a.active { background: var(--brand-soft); color: var(--brand); }
  .main { padding: 16px; }
  .board { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; gap: 0; }
  .hide-sm { display: none; }
}

/* ---------- Search + filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters select { width: auto; }
.search { flex: 1 1 280px; min-width: 200px; padding-left: 34px !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235d6b7c' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center; }
.count { font-size: 13px; color: var(--muted); margin-left: auto; }
input[type=search] { width: 100%; padding: 10px 12px; border: 1px solid #cfd7e2; border-radius: 8px; background-color: #fff; outline: none; }
input[type=search]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- Property detail ---------- */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafbfc; }
.tenant { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.tenant .sub { font-size: 13px; color: var(--muted); }
.job-line { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--bg); margin-bottom: 6px; cursor: pointer; font-size: 14px; }
.job-line:hover { background: var(--brand-soft); }
.qr-box { display: flex; justify-content: center; background: var(--bg); border-radius: 10px; padding: 14px; }
.qr { width: 180px; height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 13px; background: #fff; border-radius: 8px; }
.qr img { width: 180px; height: 180px; }
input[type=date] { font: inherit; }

/* ---------- Certificates ---------- */
.cert-list { display: grid; gap: 8px; }
.cert-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; }
.cert-row.expired, .cert-row.missing { border-left-color: var(--red); }
.cert-row.expiring { border-left-color: var(--amber); }
.cert-row.valid, .cert-row.recorded { border-left-color: var(--green); }
.cert-row.not_needed { opacity: .65; }
.cert-row .sub { font-size: 13px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; box-shadow: var(--shadow); font-weight: 600; color: #33404f; }
.tile .n { font-size: 26px; font-weight: 700; }
.tile.emergency .n { color: var(--red); } .tile.urgent .n { color: var(--amber); } .tile.routine .n { color: var(--green); }
.tile:hover { border-color: var(--brand); }
.ct-table td, .ct-table th { padding: 8px 10px; }
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .cert-row { grid-template-columns: 1fr auto; }
  .cert-row .btn-row { grid-column: 1 / -1; }
}

/* ---------- Tenant report page ---------- */
.report-wrap { min-height: 100vh; display: flex; justify-content: center; padding: 20px 14px 40px; }
.report-card { width: 100%; max-width: 620px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 24px; align-self: flex-start; }
.report-card h1 { margin: 0; font-size: 22px; }
.report-card .sub { color: var(--muted); }
.report-head { display: flex; gap: 12px; align-items: center; }
.report-head .logo { width: 42px; height: 42px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.report-head .agency { font-size: 13px; color: var(--muted); font-weight: 600; }
.report-addr { margin: 14px 0 6px; padding: 10px 12px; background: var(--bg); border-radius: 8px; font-weight: 500; }
.report-sec { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.report-sec h3 { margin: 0 0 12px; font-size: 16px; }
.report-sec h3 small { font-weight: 400; color: var(--muted); font-size: 13px; }
.my-job { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.my-job .sub { font-size: 12px; }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid #cfd7e2; border-radius: 10px; cursor: pointer; text-align: center; font-size: 13px; font-weight: 600; }
.cat input { display: none; }
.cat .ic { font-size: 22px; }
.cat:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand) inset; }
.cat.gas:has(input:checked) { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 2px var(--red) inset; }
.safety { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--red-soft); color: #8a1c1c; font-size: 14px; }
.safety ul { margin: 6px 0; padding-left: 18px; }
.safety a { color: #8a1c1c; }
.urg-list { display: grid; gap: 8px; }
.urg { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #cfd7e2; border-radius: 10px; cursor: pointer; }
.urg input { margin-top: 4px; }
.urg small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.urg:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.urg.emergency:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.urg.urgent:has(input:checked) { border-color: var(--amber); background: var(--amber-soft); }
.photo-btn { cursor: pointer; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; }
.btn.big { padding: 14px; font-size: 16px; margin-top: 18px; }
.job-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.job-photos img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.photo-thumb { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; }
.photo-thumb:hover img { outline: 2px solid var(--brand); }
@media (max-width: 520px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } .report-card { padding: 18px; } }

/* Keep modal content inside the window */
.modal { overflow: hidden; }
.modal .body { overflow-wrap: anywhere; }
.modal img { max-width: 100%; }
.desc { overflow-wrap: anywhere; }

/* ---------- Photo viewer ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10,15,25,.88); display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); cursor: default; }
.lightbox button { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; opacity: .8; }

/* ---------- Certificates drop-down on property page ---------- */
.cert-drop { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.cert-drop > summary { list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; cursor: pointer; user-select: none; }
.cert-drop > summary::-webkit-details-marker { display: none; }
.cert-drop > summary:hover { background: #fafbfc; border-radius: 10px; }
.cert-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cert-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.cert-flag { font-size: 12px; font-weight: 600; color: var(--red); }
.chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.cert-drop[open] > summary .chev { transform: rotate(180deg); }
.cert-body { padding: 0 14px 14px; }
.cert-row { padding: 7px 10px; gap: 10px; }
.cert-row strong { font-size: 14px; }
.cert-row .sub { font-size: 12px; }
.cert-row .btn.small { padding: 5px 9px; font-size: 12px; }
.cert-sub { margin-top: 10px; }
.cert-sub > summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
.cert-sub .cert-list { margin-top: 8px; }
.show-sm { display: none; }
@media (max-width: 900px) { .show-sm { display: block; } }

/* ---------- Confirmation box ---------- */
.confirm-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.confirm-box { background: #fff; border-radius: 12px; padding: 20px 22px; max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.confirm-box p { margin: 0 0 18px; font-size: 15px; }
.btn.danger-solid { background: var(--red); color: #fff; }

/* ---------- Tradesperson job page + My jobs ---------- */
.banner { padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.banner.blue { background: var(--brand-soft); color: var(--brand); }
.banner.red { background: var(--red-soft); color: var(--red); }
.banner.amber { background: var(--amber-soft); color: var(--amber); }
.banner.green { background: var(--green-soft); color: var(--green); }
.banner.grey { background: var(--bg); color: var(--muted); }
.quote-amt { font-size: 22px; font-weight: 700; }
.my-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; display: flex; gap: 6px; }
.my-h span { background: var(--bg); border-radius: 999px; padding: 0 8px; }
.my-job-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.my-job-card:hover { border-color: var(--brand); }
.my-job-card.emergency { border-left-color: var(--red); }
.my-job-card.urgent { border-left-color: var(--amber); }
.my-job-card .sub { font-size: 13px; color: var(--muted); }

/* ---------- Agent job page: tradesperson + quotes ---------- */
.tp-current { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.tp-current .pill { margin-left: 6px; }
.quote-box { border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.quote-box.approved { border-left-color: var(--green); }
.quote-box.rejected { border-left-color: var(--red); opacity: .75; }
.auto-box { border: 1px dashed #cfd7e2; border-radius: 10px; padding: 12px; margin-bottom: 14px; background: #fafbfc; }
input[type=datetime-local] { font: inherit; }

/* ---------- Visit confirmation ---------- */
.visit-line { font-size: 13px; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--amber-soft); }
.visit-line.confirmed { background: var(--green-soft); }
.visit-line div { color: var(--muted); font-size: 12px; }
.my-job-wrap { margin-bottom: 8px; }
.my-job-wrap .my-job { margin-bottom: 0; }
.visit-box { margin-top: 6px; padding: 10px 12px; border-radius: 8px; background: var(--bg); font-size: 14px; }
.visit-box.proposed { background: var(--amber-soft); }
.visit-box.confirmed { background: var(--green-soft); }

/* automatic emails */
.email-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.email-opt input { margin-top: 3px; width: auto; }
.email-opt .sub { display: block; font-size: 13px; margin-top: 2px; }
.email-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.email-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.email-list li:last-child { border-bottom: 0; }
.email-st { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #eef1f4; color: var(--muted); margin-left: 4px; }
.email-st.ok { background: #dafbe1; color: #116329; }
.email-st.bad { background: #ffebe9; color: #a40e26; }

/* number on the Jobs tab */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #57606a; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.nav-badge.fresh { background: #cf222e; }
.nav-badge[hidden] { display: none; }
.mobile-nav .nav-badge { margin-left: 6px; }

/* add to calendar */
.cal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.banner + .cal-row { margin: -4px 0 12px; }
/* tenant updates */
.t-box { margin-top: 6px; }
.t-updates { margin-top: 8px; border-left: 3px solid var(--line); padding-left: 10px; }
.t-update { padding: 4px 0; font-size: 14px; }
.notice.warn { background: #fff8c5; border-color: #d4a72c; }

.tenant-cta { margin-top: 18px; padding: 12px; border-radius: 10px; background: var(--bg); font-size: 14px; text-align: center; }

/* import */
.imp-steps { padding-left: 20px; font-size: 14px; line-height: 1.7; }
.imp-drop { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; font-weight: 600; color: var(--brand); }
.imp-drop:hover { background: var(--bg); }
.imp-drop input { display: block; margin: 0 auto 8px; }
.imp-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; }
.imp-map label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.imp-map select { padding: 7px 8px; }
.imp-prev { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.imp-prev table { font-size: 12px; }
.imp-sum { font-size: 15px; line-height: 1.8; }
.esc-flag { font-size: 12px; font-weight: 700; color: #cf222e; margin: 2px 0 4px; }

/* daily report */
.rep-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.rep-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.rep-tile { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; }
.rep-tile .n { font-size: 22px; font-weight: 700; color: var(--ink); }
.rep-tile.red { background: #ffebe9; } .rep-tile.red .n { color: #cf222e; }
.rep-tile.amber { background: #fff8c5; }
.rep-h { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rep-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.rep-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.rep-reason { font-size: 12px; color: var(--amber); font-weight: 600; }
.rep-reason.red { color: #cf222e; }
.rep-people { width: 100%; font-size: 14px; }
.rep-people td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

/* filter bars: every control the same height and shape */
.filters > input[type=search], .filters > select, .filters > .chip-check {
  height: 42px; box-sizing: border-box; border: 1px solid #cfd7e2; border-radius: 8px; font-size: 14px; margin: 0; }
.filters > select { padding: 0 32px 0 12px; }
.filters > .chip-check { padding: 0 12px; background: #fff; white-space: nowrap; }
.filters > .count { white-space: nowrap; }

.rep-date { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rep-pick { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.rep-pick input { padding: 4px 6px; border: 1px solid #cfd7e2; border-radius: 6px; font-size: 13px; }
button.rep-tile { border: 1px solid transparent; text-align: left; cursor: pointer; font: inherit; font-size: 13px; }
button.rep-tile:hover:not(:disabled) { border-color: var(--brand); }
button.rep-tile:disabled { cursor: default; opacity: .7; }
button.rep-tile.on { border-color: var(--brand); background: var(--brand-soft); }
.rep-detail { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.rep-detail-h { display: flex; justify-content: space-between; align-items: center; }

details.rep-sec { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.rep-sec > summary { cursor: pointer; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; padding: 2px 0 6px; }
details.rep-sec > summary::-webkit-details-marker { display: none; }
details.rep-sec > summary::after { content: '▾'; margin-left: auto; transition: transform .15s; }
details.rep-sec[open] > summary::after { transform: rotate(180deg); }

/* ---------- phone fixes ---------- */
.shell > div { min-width: 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .panel { overflow-x: auto; }
  .filters > input[type=search] { flex: 1 1 100%; }
  .filters > select { flex: 1 1 auto; }
  .count { margin-left: 0; }
  .topbar .actions { width: 100%; }
  .topbar .actions .btn { flex: 1 1 auto; }
  .overlay { padding: 12px 8px; }
  .modal header, .modal .body { padding-left: 16px; padding-right: 16px; }
  .rep-nav { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 520px) { th, td { padding: 10px 8px; font-size: 14px; } th { font-size: 11px; } td .btn.small { padding: 5px 9px; } }

/* landlords */
.ll-access { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ll-access label { display: flex; gap: 8px; align-items: center; }
.ll-access input { width: auto; margin: 0; }
.ll-prop { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 14px; }
.ll-prop-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.ll-sec { margin-top: 12px; }
.ll-sec-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.ll-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ll-row:last-child { border-bottom: 0; }

/* settings */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.set-card { padding: 18px 20px; }
.set-card h3 { margin: 0 0 4px; font-size: 16px; }
.set-card > .sub { font-size: 13px; margin: 0 0 14px; }
.set-logo { display: flex; gap: 12px; align-items: center; }
.set-colour { display: flex; gap: 10px; align-items: center; }
.set-colour input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid #cfd7e2; border-radius: 8px; background: #fff; cursor: pointer; }
.logo.has-img { background: #fff !important; border: 1px solid var(--line); overflow: hidden; padding: 0; }
.logo.has-img img { width: 100%; height: 100%; object-fit: contain; }
.logo.big { width: 64px; height: 64px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 26px; }
@media (max-width: 520px) { .set-grid { grid-template-columns: 1fr; } }

/* settings menu in the sidebar */
.set-wrap { position: relative; margin: 0 0 6px; }
.set-btn { width: 100%; text-align: left; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; font: inherit; font-weight: 500; color: #33404f; cursor: pointer; }
.set-btn .chev { margin-left: auto; font-size: 11px; color: var(--muted); }
.set-btn:hover, .set-wrap.open .set-btn { background: var(--bg); }
.set-wrap.active .set-btn { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.set-menu { display: none; position: absolute; left: calc(100% + 6px); bottom: 0; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.15); padding: 6px; z-index: 40; }
.set-wrap.open .set-menu { display: block; }
.set-menu a { display: block; padding: 9px 12px; border-radius: 7px; text-decoration: none; color: #33404f; font-size: 14px; }
.set-menu a:hover { background: var(--bg); color: var(--brand); }
.set-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.set-tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.set-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.set-body { max-width: 680px; }
/* dashboard */
.dash-h { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.dash-tiles.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin-bottom: 8px; }
.dash-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.dash-tile .n { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.1; }
a.dash-tile:hover { border-color: var(--brand); }
.dash-tile.red { background: #ffebe9; border-color: #ffcecb; } .dash-tile.red .n { color: #cf222e; }
.dash-tile.amber { background: #fff8c5; border-color: #f0e2a0; } .dash-tile.amber .n { color: #9a6700; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.dash-card { padding: 16px 18px; }
.dash-card h3 { margin: 0 0 10px; font-size: 15px; }
.dash-bar { display: grid; grid-template-columns: 170px 1fr 30px; align-items: center; gap: 10px; padding: 6px 0; text-decoration: none; color: inherit; font-size: 14px; }
.dash-bar .b { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.dash-bar .b i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.dash-bar .n { text-align: right; font-weight: 700; }
.dash-nums { display: flex; gap: 18px; flex-wrap: wrap; }
.dash-nums a { text-decoration: none; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; }
.dash-nums .n { font-size: 22px; font-weight: 700; color: var(--ink); }
.dash-ev { font-size: 12px; }
.dash-ev .when { display: inline; margin-left: 4px; }
@media (max-width: 520px) { .dash-bar { grid-template-columns: 120px 1fr 26px; } }

/* ---------- dashboard v2: calm, neutral ---------- */
.d-section-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.d-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 22px; }
.d-tiles.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-bottom: 10px; }
.d-tile { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 18px;
  text-decoration: none; color: var(--muted); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); overflow: hidden; }
.d-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #c9d1db; }
.d-tile .n { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1; }
.d-tile .l { font-size: 13px; line-height: 1.3; }
a.d-tile:hover { border-color: #b8c2cf; }
.d-tile.crit::before { background: #e07b6f; }
.d-tile.warn::before { background: #e3b04b; }
.d-tile.info::before { background: var(--brand); }
.d-empty { padding: 16px 18px; margin-bottom: 22px; color: var(--muted); }
.d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: stretch; }
.d-grid > .d-card { display: flex; flex-direction: column; }
.d-card { padding: 16px 18px; }
.d-wide { grid-column: 1 / -1; }
.d-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.d-card-h h3 { margin: 0; font-size: 15px; }
.d-none { font-size: 14px; }
.d-sub-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 8px; }
.d-stats { display: grid; gap: 8px; }
.d-stats.three { grid-template-columns: repeat(3, 1fr); }
.d-stat { background: var(--bg); border-radius: 10px; padding: 10px 12px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent; }
.d-stat:hover { border-color: var(--line); }
.d-stat .n { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.d-stat .l { font-size: 12px; color: var(--muted); }
.d-stat.crit .n { color: #c4554a; }
.d-stat.warn .n { color: #b07d1a; }
.d-list { list-style: none; margin: 0; padding: 0; }
.d-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.d-row:last-child { border-bottom: 0; }
.d-row:hover strong { color: var(--brand); }
.d-when { flex: 0 0 auto; min-width: 46px; font-weight: 700; font-size: 13px; color: var(--ink); }
.d-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.d-main .sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.d-evs { list-style: none; margin: 0; padding: 0; }
.d-ev { display: grid; grid-template-columns: minmax(140px, 1.1fr) 2fr auto; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.d-ev:last-child { border-bottom: 0; }
.d-ev:hover .d-ev-t { color: var(--brand); }
.d-ev-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-ev-x { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-ev-w { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .d-ev { grid-template-columns: 1fr auto; } .d-ev-x { grid-column: 1 / -1; grid-row: 2; white-space: normal; } }
/* to-do */
.todo-add { display: flex; gap: 8px; margin-bottom: 8px; }
.todo-add input { flex: 1; padding: 9px 12px; border: 1px solid #cfd7e2; border-radius: 8px; font: inherit; font-size: 14px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.todo:last-child { border-bottom: 0; }
.todo label { flex: 1; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.todo input { width: auto; margin: 3px 0 0; }
.todo.done span { text-decoration: line-through; color: var(--muted); }
.todo-x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; opacity: 0; }
.todo:hover .todo-x { opacity: 1; }
@media (hover: none) { .todo-x { opacity: .6; } }

.set-wrap.open .set-btn .chev { transform: rotate(90deg); }
.set-btn .chev { transition: transform .15s; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.book-visit { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; }
.book-visit summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.book-visit[open] summary { margin-bottom: 4px; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tp-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafbfc; }
.tp-panel[hidden] { display: none; }
.timeline:not(.show-all) > li:nth-child(n+6), .email-list:not(.show-all) > li:nth-child(n+6) { display: none; }
.more-btn { margin-top: 8px; font-size: 13px; }
