/* Premise Check web pages. Sage theme from the app; fonts are the app's (SIL OFL, see fonts/). */
@font-face { font-family: "Fraunces"; font-weight: 500; font-display: swap; src: url(fonts/Fraunces_500Medium.ttf); }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url(fonts/DMSans_400Regular.ttf); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url(fonts/DMSans_500Medium.ttf); }
@font-face { font-family: "DM Sans"; font-weight: 600; font-display: swap; src: url(fonts/DMSans_600SemiBold.ttf); }

:root {
  --bg: #F3F0E8; --surface: #FFFFFF; --ink: #1E2922; --muted: #56635A; --accent: #3E6A50;
  --soft: #E1EAE2; --line: #E0DBCF; --warn: #A8432A; --warn-soft: #F6E2D9; --fair: #8A6414; --fair-soft: #F5ECD3;
  --r: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 "DM Sans", system-ui, sans-serif; }
h1, h2 { font-family: "Fraunces", Georgia, serif; font-weight: 500; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; }
h2 { font-size: 21px; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-bottom: 56px; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 500 20px "Fraunces", Georgia, serif; }
.logo { width: 32px; height: 32px; }
.brand-sub { color: var(--muted); font: 500 13px "DM Sans", sans-serif; padding-left: 10px; border-left: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 12px; }
.who form { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font: 600 14px "DM Sans", sans-serif; text-decoration: none; cursor: pointer; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #335A43; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; margin-top: 22px; }
.btn:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.login { max-width: 420px; margin: 72px auto 0; padding: 36px; }
.login h1 { margin-bottom: 6px; }
label { display: block; margin: 18px 0 6px; font-weight: 500; font-size: 14px; }
input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); }
input:focus { border-color: var(--accent); }
.alert { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 10px; font-size: 14px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 36px 0 24px; }
.page-head p.muted { margin: 6px 0 0; }
.search input { width: 280px; }
.actions { display: flex; gap: 10px; }
.back { display: inline-block; margin-top: 28px; text-decoration: none; font-weight: 500; font-size: 14px; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 250px auto; align-items: center; gap: 20px; padding: 16px 20px; }
.check-row:hover { border-color: #C9D6CB; }
.check-main { display: flex; flex-direction: column; text-decoration: none; color: inherit; min-width: 0; }
.addr { font: 500 18px "Fraunces", Georgia, serif; }
.check-main .muted { font-size: 14px; }
.counts { display: flex; gap: 14px; justify-content: flex-end; color: var(--muted); font-size: 14px; white-space: nowrap; }
.counts b { color: var(--ink); font-weight: 600; }
.counts .warn, .counts .warn b { color: var(--warn); }
.row-actions { display: flex; gap: 8px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; }
.empty { padding: 40px; text-align: center; }
.empty p { margin: 0 0 6px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill-ok, .pill-good { background: var(--soft); color: var(--accent); }
.pill-wait, .pill-fair { background: var(--fair-soft); color: var(--fair); }
.pill-damaged { background: var(--warn-soft); color: var(--warn); }

.flash { padding: 12px 16px; border-radius: var(--r); background: var(--soft); color: var(--accent); font-weight: 500; }
.flash-error { background: var(--warn-soft); color: var(--warn); }
.kind { display: block; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.loc { margin: 0 0 14px; padding: 12px 18px; border-left: 4px solid var(--line); }
.loc b { margin-right: 8px; }
.loc-ok { border-left-color: var(--accent); background: var(--soft); }
.loc-ok b { color: var(--accent); }
.loc-bad { border-left-color: var(--warn); background: var(--warn-soft); }
.loc-bad b { color: var(--warn); }
.response, .mail { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-top: 12px; }
.mail { flex-direction: row; align-items: center; }
textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); }
.details { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 14px; padding: 0; overflow: hidden; }
.details div { padding: 14px 18px; border-right: 1px solid var(--line); }
.details div:last-child { border-right: 0; }
.details dt { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.details dd { margin: 4px 0 0; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--soft); border-radius: var(--r); padding: 16px 20px; }
.stat b { display: block; font: 500 34px/1.1 "Fraunces", Georgia, serif; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.stat-warn { background: var(--warn-soft); }
.stat-warn b { color: var(--warn); }

.space { padding: 22px; margin-bottom: 16px; }
.space-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.items { width: 100%; border-collapse: collapse; font-size: 14px; }
.items th { text-align: left; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1.5px solid var(--ink); }
.items td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.items .strong { font-weight: 600; }
.items .ph { width: 76px; }
.items td.ph img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }

@media (max-width: 760px) {
  .brand-sub, .who .muted { display: none; }
  .search, .search input { width: 100%; }
  .check-row { grid-template-columns: 1fr auto; }
  .counts { justify-content: flex-start; }
  .counts { grid-column: 1 / -1; }
  .row-actions { grid-column: 1 / -1; }
  .details { grid-template-columns: repeat(2, 1fr); }
  .details div:nth-child(2) { border-right: 0; }
  .details div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .items th:nth-child(2), .items td:nth-child(2) { display: none; }
}
@media print {
  .topbar, .actions, .back, .search, .row-actions { display: none; }
  body { background: #fff; }
  .card { break-inside: avoid; }
}
.response input:not([type]) { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); }
.msg { padding: 10px 14px; border-left: 3px solid var(--line); margin: 10px 0; }
.msg-from_landlord { border-left-color: var(--accent, #3E6A50); }
