:root {
  --navy: #0b3d75;
  --navy-deep: #072a52;
  --orange: #f26a1b;
  --orange-soft: #fff1e6;
  --ink: #10233a;
  --muted: #5b6b7d;
  --line: #e3e8ee;
  --bg: #f2f5f8;
  --green: #1c7a4a;
  --green-soft: #e8f5ee;
  --amber: #9a6100;
  --amber-soft: #fff5e0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 35, 58, .06), 0 8px 24px rgba(16, 35, 58, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
.wrap { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
@media (min-width: 640px) {
  body { padding: 24px 0; }
  .wrap { border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; min-height: auto; }
}
.hidden { display: none !important; }
a { color: var(--navy); }

/* ---------- login ---------- */
.login-hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 36px 24px 28px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand img { width: 44px; height: 44px; border-radius: 10px; background: #fff; }
.brand-name { font-weight: 800; letter-spacing: -.2px; font-size: 17px; line-height: 1.1; }
.brand-sub { font-size: 12px; opacity: .75; letter-spacing: .04em; text-transform: uppercase; }
.login-hero h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.5px; }
.login-hero p { margin: 0; opacity: .85; font-size: 14px; }
.panel { padding: 20px 16px 32px; }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.card h2 { font-size: 15px; margin: 0 0 4px; letter-spacing: -.1px; }
.card p.sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(11, 61, 117, .35); border-color: var(--navy); }
textarea { min-height: 84px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; border-radius: 12px; padding: 14px 16px;
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--orange); color: #fff;
  transition: transform .06s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #eef2f6; color: var(--navy); }
.btn.small { width: auto; padding: 10px 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.acct { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px;
  text-align: left; font: inherit; cursor: pointer; margin-bottom: 8px; }
.acct b { display: block; font-size: 14.5px; }
.acct span { color: var(--muted); font-size: 12.5px; }
.acct .chev { color: var(--navy); font-size: 18px; }
.note { font-size: 12px; color: var(--muted); margin: 12px 2px 0; }
.error { color: #b3261e; font-size: 13px; margin: 8px 2px 0; min-height: 18px; }

/* ---------- app header ---------- */
.topbar {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; padding: 16px 18px 22px;
}
.topbar .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .who { font-size: 13px; opacity: .8; }
.topbar .name { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.light { background: rgba(255,255,255,.14); color: #fff; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }

.hero-card {
  margin: -12px 16px 14px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; position: relative;
}
.hero-card .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.hero-card .big { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin: 4px 0 2px; }
.hero-card .meta { color: var(--muted); font-size: 13.5px; }
.hero-card .actions { display: flex; gap: 8px; margin-top: 14px; }

.tabs { display: flex; gap: 6px; padding: 0 16px 12px; }
.tab { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700;
  font-size: 14px; padding: 10px 6px; border-radius: 10px; cursor: pointer; }
.tab[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: var(--shadow); }

.section { padding: 0 16px 20px; }
.section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 4px 10px; }

.visit { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.visit .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.visit .date { font-weight: 800; font-size: 15px; }
.visit .svc { color: var(--muted); font-size: 12.5px; }
.visit ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.visit li { display: flex; gap: 8px; font-size: 13.5px; color: #2b3d51; }
.tick { color: var(--green); font-weight: 800; }
.cross { color: #b3261e; font-weight: 800; }
.visit .notes { margin: 12px 0 0; font-size: 13.5px; color: #33465c; background: #f7f9fb; border-radius: 10px; padding: 10px 12px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.photos a { display: block; border-radius: 10px; overflow: hidden; background: #eef2f6; aspect-ratio: 4/3; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref { font-size: 12px; color: var(--muted); margin-top: 10px; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 13px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f7f9fb; }
tr:last-child td { border-bottom: 0; }

.footer { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 16px 26px; }
.footer a { color: var(--muted); }

/* admin */
.admin-head { background: #0f1722; color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
.admin-head b { font-size: 14px; letter-spacing: .02em; }
.admin-head button { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.checklist label { display: flex; align-items: flex-start; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--ink); padding: 9px 0; border-bottom: 1px solid var(--line); }
.checklist input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--navy); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: #0f1722; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 50; }
.toast.show { opacity: 1; }
