/* Property Platform - technician app. Self-contained: no web fonts, no external files.
   Brand colours come from /brand.css (--brand, --brand-dark, --brand-soft, --on-brand). */
:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #d5dce6;
  --ok: #15803d;
  --ok-dark: #116632;
  --ok-soft: #e3f4e8;
  --warn: #b45309;
  --warn-soft: #fdf1e2;
  /* Priority: only High stands out (red). Normal and Low are calm. */
  --high: #b91c1c;
  --normal: #94a3b8;
  --low: #cbd5e1;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 18px rgba(15, 23, 42, .07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
svg { flex: none; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
:focus-visible { outline: 4px solid var(--brand); outline-offset: 3px; border-radius: 10px; }

/* Top bar: white, so the coloured logo shows; a thin line in the brand colour underneath */
.top {
  position: sticky; top: 0; z-index: 10;
  background: #fff; color: var(--ink);
  padding-top: env(safe-area-inset-top);
  box-shadow: inset 0 -3px 0 var(--brand), 0 2px 12px rgba(15, 23, 42, .08);
}
.top-inner {
  max-width: 680px; margin: 0 auto; padding: 12px 18px 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px;
}
.brand { display: flex; align-items: center; color: inherit; text-decoration: none; border-radius: 6px; }
.brand-logo { display: block; height: 32px; width: auto; }
.logout { margin: 0; }
.link-btn {
  font: inherit; font-weight: 700; font-size: 1rem; color: var(--brand-dark); background: #fff;
  border: 2px solid var(--brand); border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer;
}
.link-btn:hover { background: var(--brand-soft); }
.offline-note {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: #1e293b; color: #fff; padding: 10px 16px; font-weight: 600; font-size: 1rem;
}
.offline-note svg { width: 22px; height: 22px; }

.wrap { max-width: 680px; margin: 0 auto; padding: 20px 16px 48px; }

/* Greeting */
.hello { margin: 6px 4px 18px; }
.hello h1 { font-size: 1.9rem; font-weight: 800; }
.lead { color: var(--muted); font-size: 1.1rem; margin: 6px 0 0; }
.lead strong { color: var(--ink); }

/* Groups and cards */
.group { margin-top: 22px; }
.group-title {
  font-size: 1.2rem; color: var(--ink);
  margin: 0 4px 10px; display: flex; align-items: center; gap: 8px; font-weight: 800;
}
.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .9rem; letter-spacing: 0;
}
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.card {
  position: relative; display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 56px 18px 26px; overflow: hidden;
  transition: transform .08s ease, box-shadow .15s ease;
}
.card::before, .job::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; background: var(--normal);
}
.prio-high::before { background: var(--high); }
.prio-low::before { background: var(--low); }
.card:active { transform: scale(.985); }
.card.is-done { opacity: .78; }
.card-title { font-size: 1.3rem; font-weight: 800; margin: 10px 0 8px; }
.row { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 0; color: #1e293b; }
.row svg { width: 22px; height: 22px; margin-top: 2px; color: var(--muted); }
.card-go {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
}
.card-go svg { width: 22px; height: 22px; }

/* Pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  font-size: .9rem; font-weight: 800; color: #1e293b; background: #e2e8f0;
}
.pill-high { background: var(--high); color: #fff; }
.pill-normal { background: #e2e8f0; color: #1e293b; }
.pill-low { background: #fff; color: #334155; box-shadow: inset 0 0 0 2px #cbd5e1; }
.pill-status { background: #e0ecfb; color: #1d4f7a; }
.pill-status.pill-in_progress { background: var(--brand-soft); color: var(--brand-dark); }
.pill-status.pill-done { background: var(--ok-soft); color: var(--ok-dark); }
.pill-resident { background: #fff1db; color: #7a4300; }
.due { font-weight: 700; color: var(--muted); font-size: .95rem; }
.due.late { color: var(--high); }

.empty {
  text-align: center; background: var(--card); border-radius: var(--radius); padding: 34px 22px;
  box-shadow: var(--shadow); color: var(--muted); font-size: 1.1rem;
}
.empty svg { width: 88px; height: 88px; }
.empty-bg { fill: var(--brand-soft); }
.empty-check { stroke: var(--brand); }

/* Job page */
.back {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: none;
  color: var(--brand-dark); min-height: 48px; padding: 4px 8px 4px 0; font-size: 1.1rem;
}
.back svg { width: 24px; height: 24px; }
.job {
  position: relative; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 20px 20px 20px 28px; margin-top: 8px; overflow: hidden;
}
.job-title { font-size: 1.7rem; font-weight: 800; margin: 12px 0 14px; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 700; }
.todo { margin-top: 16px; background: var(--brand-soft); border-radius: 14px; padding: 14px 16px; }
.todo h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-dark); }
.todo p { margin: 6px 0 0; }
.dd-light { font-weight: 600; color: #1e293b; }
.tel { color: var(--brand-dark); text-underline-offset: 3px; white-space: nowrap; }
.access { margin-top: 16px; background: var(--warn-soft); border-radius: 14px; padding: 14px 16px; }
.access h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: #7c2d12; }
.access p { margin: 6px 0 0; font-weight: 600; }

.actions { display: grid; gap: 14px; margin: 22px 0; }
.actions form { margin: 0; }
.actions .hint { margin: -4px 4px 0; color: var(--muted); font-size: 1rem; }
/* Done stands apart from the other buttons: a line and room above it, so it is not pressed by mistake */
.finish { margin-top: 18px; padding-top: 22px; border-top: 2px dashed var(--line); display: grid; gap: 10px; }
.finish .hint { margin: 0 4px; text-align: center; }

/* Buttons: big, one hand, high contrast */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  min-height: 64px; padding: 14px 20px; border-radius: 16px; border: 3px solid transparent;
  font: inherit; font-size: 1.25rem; font-weight: 800; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn svg { width: 28px; height: 28px; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 12px rgba(15, 23, 42, .18); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-done { background: var(--ok); color: #fff; box-shadow: 0 4px 12px rgba(21, 128, 61, .28); }
.btn-done:hover { background: var(--ok-dark); }
.btn-light { background: var(--card); color: var(--brand-dark); border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); margin-top: 10px; }
.btn[disabled], .btn.is-busy { opacity: .65; cursor: progress; }
.btn-file { position: relative; }
.js .no-js-only { display: none; }
.photo-form { display: grid; gap: 10px; }
.progress { margin: 0; font-weight: 700; color: var(--brand-dark); text-align: center; }
.done-flag {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0;
  background: var(--ok-soft); color: var(--ok-dark); border-radius: 16px; min-height: 64px; font-weight: 800; font-size: 1.2rem;
}
.done-flag svg { width: 28px; height: 28px; }

/* Notices */
.notice {
  display: flex; gap: 12px; align-items: center; border-radius: 14px; padding: 14px 16px; margin: 8px 0 14px;
  font-weight: 700; font-size: 1.1rem;
}
.notice svg { width: 28px; height: 28px; }
.notice-ok { background: var(--ok-soft); color: var(--ok-dark); border: 2px solid #9fd7b1; }
.notice-warn { background: var(--warn-soft); color: #7c2d12; border: 2px solid #f3c48d; }

/* Photos and history */
.block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 18px; }
.block h2 { font-size: 1.2rem; font-weight: 800; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.photos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos a { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #e2e8f0; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 10px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; padding-top: 0; }
.history time { display: block; color: var(--muted); font-size: .95rem; font-weight: 600; }
.history .what { font-weight: 700; }
.note-text { margin: 4px 0 0; background: #f8fafc; border-radius: 10px; padding: 8px 12px; }

/* Forms */
.panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; margin-top: 8px;
}
.panel h1 { font-size: 1.7rem; font-weight: 800; }
.panel form { margin-top: 16px; }
.panel-center { text-align: center; margin-top: 28px; }
.panel-center form { text-align: left; }
.panel-center .btn { margin-top: 18px; }
.hero-mark {
  width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 14px; background: var(--brand); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}
.hero-mark svg { width: 44px; height: 44px; }
.hero-warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.field-label { display: block; font-weight: 800; margin: 16px 0 8px; }
.optional { color: var(--muted); font-weight: 500; }
input[type=text], input[type=password], textarea {
  display: block; width: 100%; font: inherit; font-size: 1.2rem; color: var(--ink);
  background: #fff; border: 3px solid #94a3b8; border-radius: 14px; padding: 14px 16px; min-height: 60px;
}
textarea { resize: vertical; min-height: 140px; }
input:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.panel form .btn { margin-top: 20px; }
.panel form .btn-ghost { margin-top: 10px; }
.hint { color: var(--muted); margin: 14px 0 0; font-size: 1rem; text-align: center; }
.panel form .hint { text-align: left; margin-top: 8px; }
.username-box { background: var(--brand-soft); color: var(--brand-dark); border-radius: 12px; padding: 12px; margin: 16px 0 0; font-size: 1.1rem; }

@media (min-width: 560px) {
  .photos { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
