/* Freedom Property Management — Cleaner Hub
   Brand: green #80B740 (logo mark), ink #030708 (wordmark), Raleway headings.
   Brand green fails contrast with white text, so filled green surfaces carry ink text. */

@font-face { font-family: 'Raleway'; font-weight: 600; font-display: swap; src: url('/vendor/raleway-600.woff2') format('woff2'); }
@font-face { font-family: 'Raleway'; font-weight: 700; font-display: swap; src: url('/vendor/raleway-700.woff2') format('woff2'); }
@font-face { font-family: 'Raleway'; font-weight: 800; font-display: swap; src: url('/vendor/raleway-800.woff2') format('woff2'); }

:root {
  --brand: #80b740;
  --brand-strong: #6a9c31;   /* pressed state */
  --brand-ink: #3f6b14;      /* green text on light backgrounds (5.9:1) */
  --brand-tint: #eef6e4;
  --brand-tint-2: #dcedc8;
  --ink: #030708;
  --ink-2: #3a4246;
  --muted: #5f686c;
  --line: #dfe3e1;
  --bg: #f5f7f3;
  --card: #ffffff;
  --on-brand: #030708;
  --urgent: #c62828;
  --urgent-tint: #fdecea;
  --today: #a35a00;
  --today-tint: #fff3e0;
  --fyi: #455a64;
  --fyi-tint: #eceff1;
  --done: #2e7d32;
  --shadow: 0 1px 2px rgba(3, 7, 8, .06), 0 2px 8px rgba(3, 7, 8, .06);
  --radius: 14px;
  --tap: 56px;
  --font-head: 'Raleway', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand-ink: #a5d36e;
    --brand-tint: #1d2a12;
    --brand-tint-2: #2a3d19;
    --ink: #eef2ee;
    --ink-2: #c9d0cc;
    --muted: #98a29d;
    --line: #2b3331;
    --bg: #0b0f10;
    --card: #151b1c;
    --urgent: #ff6b6b;
    --urgent-tint: #3a1414;
    --today: #ffb547;
    --today-tint: #352510;
    --fyi: #9fb3bd;
    --fyi-tint: #1e2629;
    --done: #7bd47f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 var(--font-body);
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3, .head { font-family: var(--font-head); font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 24px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
a { color: var(--brand-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--card); border-bottom: 3px solid var(--brand);
}
.topbar .logo { height: 30px; width: auto; }
.topbar .logo.dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .topbar .logo.light { display: none; }
  :root:not([data-theme='light']) .topbar .logo.dark { display: block; }
}
.topbar .spacer { flex: 1; }
.topbar .back { margin-left: -8px; }
.topbar .title { font-family: var(--font-head); font-weight: 700; font-size: 18px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-toggle {
  display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; flex: none;
}
.lang-toggle button { border: 0; background: none; min-width: 44px; min-height: 40px; font-weight: 800; font-family: var(--font-head); }
.lang-toggle button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1100px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 20px; border-radius: 12px;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font-family: var(--font-head); font-weight: 700; font-size: 17px; text-decoration: none;
  cursor: pointer; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:active { background: var(--brand-strong); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.danger { background: var(--urgent); border-color: var(--urgent); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.block { width: 100%; }
.btn.big { min-height: 68px; font-size: 20px; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 48px; min-height: 48px; border-radius: 12px;
  border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink);
}

/* ---------- cards & lists ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card + .card { margin-top: 12px; }
.pad { padding: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.section-label {
  font-family: var(--font-head); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 22px 4px 8px;
}

.job-card { display: block; padding: 16px; text-decoration: none; color: inherit; }
.job-card.done { opacity: .75; }
.job-card .prop { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.job-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: var(--fyi-tint); color: var(--fyi); white-space: nowrap;
}
.pill.urgent { background: var(--urgent-tint); color: var(--urgent); }
.pill.today { background: var(--today-tint); color: var(--today); }
.pill.brand { background: var(--brand-tint); color: var(--brand-ink); }
.pill.done { background: var(--brand-tint); color: var(--done); }

.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: inherit; transform-origin: left; transition: transform .25s; }

/* ---------- checklist ---------- */
.room { overflow: hidden; }
.room > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px; min-height: 64px; cursor: pointer;
}
.room > summary::-webkit-details-marker { display: none; }
.room > summary .name { font-family: var(--font-head); font-weight: 700; font-size: 18px; flex: 1; }
.room > summary .count { font-weight: 700; color: var(--muted); }
.room.complete > summary .count { color: var(--done); }
.room > summary .chev { transition: transform .2s; }
.room[open] > summary .chev { transform: rotate(90deg); }
.item {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 12px 10px 16px;
  border-top: 1px solid var(--line); cursor: pointer; user-select: none;
}
.item .box {
  flex: none; width: 34px; height: 34px; border-radius: 10px; border: 3px solid var(--ink-2);
  display: grid; place-items: center; font-size: 20px; font-weight: 900; color: var(--on-brand);
}
.item.checked .box { background: var(--brand); border-color: var(--brand); }
.item.checked .text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.item .text { flex: 1; font-size: 17px; }
.item .cam {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px;
  border: 2px dashed var(--ink-2); font-size: 22px; background: none; position: relative;
}
.item .cam.has { border-style: solid; border-color: var(--brand); background: var(--brand-tint); }
.item .cam .n { position: absolute; top: -6px; right: -6px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 800; border-radius: 999px; min-width: 20px; height: 20px; display: grid; place-items: center; }
.item.need-photo .text::after { content: ' 📷'; }

/* ---------- bottom action bar ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(3,7,8,.08);
}
.actionbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; border: 0; border-radius: 12px; background: none; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--ink);
}
.actionbar button .ico { font-size: 26px; line-height: 1; }
.actionbar button.problem { background: var(--urgent-tint); color: var(--urgent); }
.has-actionbar { padding-bottom: 110px; }

/* ---------- sheets (bottom modals) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(3,7,8,.5); z-index: 40; animation: fade .15s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow: auto;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px);
  animation: up .2s ease-out;
}
@media (min-width: 760px) { .sheet { left: 50%; width: 720px; transform: translateX(-50%); animation: none; } }
.sheet .grabber { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { margin-bottom: 12px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 12px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--card); cursor: pointer; text-align: left; font-weight: 600; font-size: 15px;
}
.chip .ico { font-size: 22px; }
.chip[aria-pressed='true'] { border-color: var(--ink); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--ink); }
.sev { display: grid; gap: 8px; }
.sev .chip[data-sev='urgent'][aria-pressed='true'] { background: var(--urgent-tint); border-color: var(--urgent); box-shadow: inset 0 0 0 1px var(--urgent); }
.sev .chip[data-sev='today'][aria-pressed='true'] { background: var(--today-tint); border-color: var(--today); box-shadow: inset 0 0 0 1px var(--today); }

textarea, input[type='text'], input[type='password'], input[type='tel'], input[type='email'], input[type='date'], input[type='time'], select {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); font-size: 17px;
}
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint-2); }
label.field { display: block; font-weight: 700; margin: 14px 0 6px; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img, .thumbs .pending {
  width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--line);
}
.thumbs .pending { display: grid; place-items: center; font-size: 12px; color: var(--muted); }

/* supplies */
.supply-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.supply { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 2px solid var(--line); border-radius: 12px; min-height: 64px; }
.supply .ico { font-size: 24px; }
.supply .name { flex: 1; font-weight: 600; }
.supply .lvl { display: flex; gap: 6px; }
.supply .lvl button { min-width: 64px; min-height: 48px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); font-weight: 800; cursor: pointer; }
.supply .lvl button[aria-pressed='true'][data-l='low'] { background: var(--today-tint); border-color: var(--today); color: var(--today); }
.supply .lvl button[aria-pressed='true'][data-l='out'] { background: var(--urgent-tint); border-color: var(--urgent); color: var(--urgent); }
.supply.requested { border-color: var(--brand); background: var(--brand-tint); }

/* status banners */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; font-size: 15px; }
.banner.offline { background: var(--today-tint); color: var(--today); }
.banner.sync { background: var(--brand-tint); color: var(--brand-ink); }
.banner.alert { background: var(--urgent-tint); color: var(--urgent); }
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 14px 20px; border-radius: 12px; font-weight: 700;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); animation: up .2s;
}

/* status timeline for reports */
.steps { display: flex; gap: 4px; margin-top: 8px; }
.steps span { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 6px 2px; border-radius: 8px; background: var(--line); color: var(--muted); }
.steps span.on { background: var(--brand); color: var(--on-brand); }
.msg { padding: 10px 12px; border-radius: 12px; background: var(--bg); margin-top: 8px; font-size: 15px; }
.msg.mgr { background: var(--brand-tint); }
.msg .who { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.tabs button {
  flex: none; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--card);
  font-family: var(--font-head); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.tabs button[aria-selected='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--urgent); color: #fff; font-size: 12px; font-weight: 800; }

/* manager tables */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-family: var(--font-head); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.gallery figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-height: 90vh; border-radius: 8px; }

.house-notes { white-space: pre-wrap; }
.notes-list { margin: 0; padding-left: 20px; }
.notes-list li + li { margin-top: 6px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 420px; padding: 28px 24px; }
.login .logo { width: 260px; margin: 0 auto 18px; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big { font-size: 44px; }

.recording { animation: pulse 1s infinite; background: var(--urgent) !important; color: #fff !important; border-color: var(--urgent) !important; }
@keyframes pulse { 50% { opacity: .65; } }

@media (min-width: 760px) {
  .supply-grid { grid-template-columns: 1fr 1fr; }
}

/* same-day turnover callout */
.sameday {
  padding: 14px 16px; font-family: var(--font-head); font-weight: 800; font-size: 18px; line-height: 1.3;
  background: var(--urgent-tint); color: var(--urgent); border: 2px solid var(--urgent); border-radius: var(--radius);
}
.card.banner { border-radius: var(--radius); }
.actionbar button[disabled] { opacity: .4; }

/* manager */
.mgrid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 640px) { .mgrid { grid-template-columns: repeat(3, 1fr); } }
.editor-section { border-top: 1px solid var(--line); padding: 12px 0; margin-top: 12px; }
.editor-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; align-items: center; margin-top: 6px; }
.editor-row input[type='text'] { min-height: 44px; padding: 8px 10px; font-size: 15px; }
.editor-row.head input[type='text'] { font-family: var(--font-head); font-weight: 700; }
.editor-row.head { grid-template-columns: 1fr 1fr auto; }
.photo-toggle { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 15px; }
.photo-toggle input { width: 20px; height: 20px; }
@media (max-width: 560px) {
  .editor-row { grid-template-columns: 1fr auto auto; }
  .editor-row input[type='text']:nth-of-type(2) { grid-column: 1; grid-row: 2; }
  .editor-row.head { grid-template-columns: 1fr auto; }
}
.table td .btn + .btn { margin-left: 6px; }
@media (max-width: 640px) {
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 10px 8px; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 3px 0; text-align: left !important; }
}
.topstick { position: sticky; top: 0; z-index: 20; }

/* room-level checklist: one big check per room; tasks inside are a reference list */
.room-check {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--ink-2); background: var(--card);
  display: grid; place-items: center; font-size: 24px; font-weight: 900; color: var(--on-brand); cursor: pointer;
}
.room-check.on { background: var(--brand); border-color: var(--brand); }
.room.complete > summary .name { color: var(--muted); }
.room > summary .count.ok { color: var(--done); }
.item.ref { cursor: default; min-height: 52px; }
.item.ref .dot { flex: none; width: 34px; text-align: center; color: var(--muted); font-size: 22px; }

/* demo site marker */
.demo-banner {
  padding: 8px 16px; text-align: center; font-weight: 700; font-size: 14px;
  background: var(--today-tint); color: var(--today); border-bottom: 1px solid var(--today);
}
