:root {
  --paper: #efe9e0;
  --canvas: #e8e1d6;
  --card: #fffdf8;
  --ink: #14110e;
  --muted: #5a534b;
  --line: #d4cbc0;
  --accent: #b33f24;
  --accent-dark: #8a2e1a;
  --ok: #1f4d38;
  --ok-bg: #dceee4;
  --warn: #7a4e0a;
  --warn-bg: #f4e6c8;
  --bad: #8f2416;
  --bad-bg: #f6ddd7;
  --stamp: #6d2e22;
  --banner: #f3e8d4;
  --shadow: 0 8px 24px rgba(27, 23, 19, 0.08);
  --radius: 14px;
  --radius-sm: 12px;
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Figtree", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(179, 63, 36, 0.06), transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, .wordmark {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.45em;
  color: var(--ink);
}

h1 { font-size: 2.15rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.05rem; }

.wrap {
  width: min(44rem, calc(100% - 2.4rem));
  margin: 0 auto;
}

.wrap-wide {
  width: min(72rem, calc(100% - 2.4rem));
  margin: 0 auto;
}

header.appbar {
  border-bottom: 1px solid rgba(27, 23, 19, 0.06);
  background: rgba(239, 233, 224, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  position: sticky;
  top: 0;
  z-index: 20;
}

header.appbar .inner {
  width: min(72rem, calc(100% - 2.4rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}
.brand:hover { color: var(--ink); text-decoration: none; }

.brand small {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

nav,
.nav-pills {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}

nav a,
.nav-pill {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
}
nav a:hover,
.nav-pill:hover {
  background: rgba(255, 253, 248, 0.8);
  text-decoration: none;
  color: var(--ink);
}
nav a[aria-current="page"],
.nav-pill[aria-current="page"] {
  background: var(--card);
  box-shadow: var(--shadow);
  border-color: rgba(27, 23, 19, 0.05);
}

button.nav-pill {
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}

.logout-form {
  margin: 0;
  display: inline;
}

.login-card {
  max-width: 26rem;
  margin: 1.5rem auto 0;
}

.login-card .landing-lockup {
  margin-bottom: 0.4rem;
}

.login-card .landing-logo {
  height: 72px;
}

main {
  flex: 1;
  padding: 2rem 0 3.5rem;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 1.6rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.landing {
  padding: 4.5rem 0 2.5rem;
  text-align: center;
}
.landing .landing-lockup { justify-content: center; }
.landing .btn-row { justify-content: center; }

.landing-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.8rem;
}
.landing-logo {
  height: 128px;
  width: auto;
  max-width: min(340px, 70vw);
  object-fit: contain;
  display: block;
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fffdf8;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(179, 63, 36, 0.22);
}
.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}
.btn-ghost:hover { background: #f6f1e8; color: var(--ink); }

.btn-danger {
  background: transparent;
  color: var(--bad);
  border-color: #e3b6ad;
  box-shadow: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.1rem 0;
}

.banner {
  background: var(--banner);
  border: 1px solid #e4d4b6;
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.example-stamp {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stamp);
  background: #f6e8e2;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.35rem;
}

/* Metric cards: label over big number */
.metric-grid,
.counts,
.portfolio {
  display: grid;
  gap: 0.85rem;
  margin: 0.4rem 0 1.4rem;
}

.metric-grid,
.counts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid-5,
.portfolio {
  grid-template-columns: repeat(5, minmax(10.5rem, 1fr));
}

.metric-card,
.count {
  background: var(--card);
  border: 1px solid rgba(27, 23, 19, 0.06);
  padding: 1.05rem 1.15rem 1rem;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 6.2rem;
  text-decoration: none;
  color: inherit;
}
a.metric-card:hover,
a.count:hover {
  text-decoration: none;
  color: inherit;
  transform: translateY(-1px);
}

.metric-label,
.count .muted {
  order: -1;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.metric-value,
.count .n {
  font-family: var(--serif);
  font-size: 1.85rem;
  line-height: 1.05;
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.metric-card.expired,
.count.expired { border-top: 4px solid var(--bad); }
.metric-card.due,
.count.due { border-top: 4px solid var(--warn); }
.metric-card.fine,
.count.fine { border-top: 4px solid var(--ok); }
.metric-card.net,
.count.net { border-top: 4px solid var(--accent); }

.pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}
.pill-expired { background: var(--bad-bg); color: var(--bad); }
.pill-due { background: var(--warn-bg); color: var(--warn); }
.pill-fine { background: var(--ok-bg); color: var(--ok); }
.pill-handled { background: #ece8e1; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid rgba(27, 23, 19, 0.06);
  padding: 1.15rem 1.2rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.card:hover { color: inherit; background: #faf6ef; text-decoration: none; }
a.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card h3 { margin-bottom: 0.25rem; }
.card .meta { color: var(--muted); font-size: 0.9rem; }

.form-error {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: var(--accent-dark);
}

.card-muted { opacity: 0.88; background: #f5f1ea; }

.chip-muted {
  color: var(--muted) !important;
  background: #ece8e1 !important;
  border-color: var(--line) !important;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 2.1rem 0 0.85rem;
}

.prop-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.form,
.settings-panel {
  background: var(--card);
  border: 1px solid rgba(27, 23, 19, 0.06);
  padding: 1.4rem 1.45rem 1.3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.settings-panel .form {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

label {
  display: block;
  font-weight: 650;
  font-size: 0.86rem;
  margin: 0.95rem 0 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
}
textarea { min-height: 5.5rem; resize: vertical; }

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  font-weight: 500;
  min-height: 44px;
}
.check input { width: auto; }

.hint { font-size: 0.82rem; color: var(--muted); margin: 0.2rem 0 0; font-weight: 400; }

.quiet-list { list-style: none; padding: 0; margin: 0; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.75rem;
}
.row-actions form { display: inline; }

.section-note {
  color: var(--muted);
  margin: -0.15rem 0 1.15rem;
}

.timeline-date {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.empty,
.empty-state {
  color: var(--muted);
  padding: 1.25rem 1.15rem;
  border: 1px dashed var(--line);
  background: #f7f3ea;
  margin: 0 0 1rem;
  border-radius: var(--radius);
}

.empty-state p { margin: 0.2rem 0; }
.empty-state .cta { margin-top: 0.85rem; }
.empty-state .btn { color: #fffdf8; }

.two-col { display: grid; gap: 0.9rem; }

@media (min-width: 640px) {
  .two-col { grid-template-columns: 1fr 1fr; }
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.muted-section {
  margin: 1.8rem 0 0.4rem;
  padding: 0.85rem 1.15rem 1.1rem;
  background: rgba(27, 23, 19, 0.04);
  border-radius: var(--radius);
}

.cert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cert-row-main { flex: 1; min-width: 0; }
a.cert-row, article.cert-row { cursor: pointer; }
article.cert-row:hover,
a.cert-row:hover,
.cert-row:hover {
  background: #faf6ef;
}

.status-mark {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  align-self: center;
}
.status-ok { color: var(--ok); background: var(--ok-bg); }
.status-bad { color: var(--bad); background: var(--bad-bg); }

.missing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
}
.missing-row:hover { background: #faf6ef; }

.prop-card { display: flex; gap: 0.95rem; align-items: center; }
.prop-card-body { flex: 1; min-width: 0; }
.prop-thumb {
  width: 104px;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
  flex: 0 0 auto;
  background: #ece8e1;
}

.hero-photo,
.prop-hero {
  width: 100%;
  max-width: 42rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  margin: 0.7rem 0 1.3rem;
  box-shadow: var(--shadow);
  background: #ece8e1;
}

input[type="file"] { width: 100%; font: inherit; margin-top: 0.35rem; }

.digest-preview {
  white-space: pre-wrap;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.95rem 1rem;
  overflow: auto;
  max-height: 22rem;
  border-radius: 12px;
}

table.ledger {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  margin: 0.6rem 0 1.2rem;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.ledger th, table.ledger td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.ledger th.num, table.ledger td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.ledger tfoot th { background: #f7f2ea; }

.list-head[id] { scroll-margin-top: 5.5rem; }
.acct-block { scroll-margin-top: 5.5rem; }

.inline-del { display: inline; }

@media (max-width: 1100px) {
  .metric-grid-5,
  .portfolio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .metric-grid-5,
  .portfolio,
  .metric-grid,
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-logo { height: 38px; }
  .landing-logo { height: 92px; }
  h1 { font-size: 1.75rem; }
}
@media (max-width: 480px) {
  .metric-grid-5,
  .portfolio { grid-template-columns: 1fr; }
}

.wrap { width: min(40rem, calc(100% - 2.8rem)); }

.legal-foot {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
  letter-spacing: 0.01em;
}
.footer p { margin: 0; }

.one-line { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.2rem; }

/* Calendar job rows */
.job-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  background: var(--card);
  border: 1px solid rgba(27, 23, 19, 0.06);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem 0.55rem 0.45rem;
  margin-bottom: 0.55rem;
  text-decoration: none;
  color: inherit;
  min-height: 4.4rem;
  overflow: hidden;
}
a.job-row:hover { background: #faf6ef; text-decoration: none; color: inherit; }
.job-row.is-muted { opacity: 0.72; }
.job-bar {
  width: 5px;
  align-self: stretch;
  border-radius: 99px;
  flex: 0 0 5px;
}
.bar-expired { background: var(--bad); }
.bar-due, .bar-open { background: var(--warn); }
.bar-fine { background: var(--ok); }
.bar-handled { background: #b8b0a6; }

.job-thumb {
  display: block;
  width: 4.4rem;
  height: 3.3rem;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 4.4rem;
  background: #d9d0c4;
  color: #6d6258;
}
.job-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.job-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(160deg, #c9ddd3 0%, #e4d6c4 55%, #d7c4b2 100%);
}
.house-ico { width: 1.7rem; height: 1.7rem; }

.job-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.job-title {
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-meta {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-row .pill { margin: 0; flex: 0 0 auto; }

.status-ring {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  flex: 0 0 1.35rem;
  background:
    conic-gradient(var(--ring) var(--arc), #e6e0d7 0);
  box-shadow: inset 0 0 0 4px var(--card);
}
.ring-expired { --ring: var(--bad); --arc: 100%; }
.ring-due, .ring-open { --ring: var(--warn); --arc: 55%; }
.ring-fine { --ring: var(--ok); --arc: 100%; }
.ring-handled { --ring: #b8b0a6; --arc: 100%; }

.nag-pips {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1.5rem;
}
.nag-pip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.55rem 0.35rem 0.3rem;
  border-radius: 999px;
  background: rgba(255,253,248,0.7);
}
.nag-pip:hover { text-decoration: none; color: var(--ink); background: var(--card); }
.nag-pip strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }

/* Photo-led property cards */
.prop-grid {
  grid-template-columns: 1fr;
  gap: 1.15rem;
}
.photo-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.45rem 0.7rem;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(27, 23, 19, 0.06);
  box-shadow: var(--shadow);
  padding: 0 0 0.85rem;
}
a.photo-card:hover { color: inherit; text-decoration: none; transform: none; }
.photo-card .photo-frame {
  grid-column: 1 / -1;
  display: block;
  height: 11.5rem;
  background: #d9d0c4;
}
.photo-card .job-thumb,
.photo-card .job-thumb-ph {
  width: 100%;
  height: 11.5rem;
  flex: none;
  border-radius: 0;
}
.photo-card .house-ico { width: 4.2rem; height: 4.2rem; color: #5a6d62; }
.photo-caption {
  padding: 0 1rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.25;
}
.cap-addr {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.photo-status {
  padding: 0 1rem 0 0;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

/* Property page — house feel */
.house-page { padding-top: 0.2rem; }
.house-hero {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.1rem;
  padding: 0.9rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
.house-mark {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 14px;
  background: linear-gradient(160deg, #c9ddd3, #e4d6c4);
  color: #4a5c52;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 3.2rem;
}
.house-mark .house-ico { width: 1.8rem; height: 1.8rem; }
.house-hero h1 { margin: 0 0 0.15rem; font-size: 1.85rem; }
.house-hero .cap-addr { margin: 0; }

.money-strip {
  display: flex;
  gap: 0.7rem;
  margin: 0 0 0.55rem;
}
.money-fig {
  flex: 1;
  padding: 0.7rem 0.85rem 0.65rem;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(27, 23, 19, 0.06);
  min-width: 0;
}
.money-fig.tax-shaped {
  background: #f6f1e8;
}
.money-n {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.1;
}
.money-l {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-top: 0.25rem;
}
.money-note { margin: 0 0 1.1rem; }
.photo-collapse {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.photo-collapse summary { cursor: pointer; font-weight: 600; }
.house-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 9rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #c9ddd3, #e4d6c4);
  color: #4a5c52;
  margin: 0.6rem 0;
}
.house-placeholder .house-ico { width: 3rem; height: 3rem; }
.house-placeholder span { font-size: 0.8rem; font-weight: 650; }

.job-row .row-actions { margin-top: 0.25rem; }
.list-head { margin: 1.6rem 0 0.7rem; }

@media (max-width: 560px) {
  .job-row .pill { display: none; }
  .money-n { font-size: 1.15rem; }
}
