/* RentRoll — Expansive teal + amber (the K8lyn palette), on a light working
   surface because the pages are dense tables people read for a long time. */
:root {
  --teal: #005A7D;
  --teal-deep: #013C53;
  --teal-soft: #E6F0F4;
  --amber: #FFB548;
  --amber-deep: #F0A330;
  --amber-soft: #FFF3DF;
  --bg: #F5F7F8;
  --card: #FFFFFF;
  --ink: #16242C;
  --muted: #5F7480;
  --rule: #DCE3E7;
  --gap: #FDECEC;
  --gap-edge: #E8A0A0;
  --ok: #2F6B45;
  --warn: #9A6200;
  --danger: #9B2C2C;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body); }
a { color: var(--teal); }
h1, h2, h3 { margin: 0 0 10px; font-weight: 600; }
h1.display, .display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.center { text-align: center; }
.eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* ── Chrome ── */
.masthead { background: var(--teal-deep); color: #EAF4F8; display: flex; align-items: center; gap: 28px;
  padding: 0 24px; height: 54px; border-bottom: 3px solid var(--amber); }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
/* The mark's white background was removed, so the masthead navy shows through
   rather than a white tile. Sized to the wordmark beside it. */
.brand-mark { height: 22px; width: auto; display: block; }
.brand-title { font-family: var(--font-display); font-size: 20px; }
.brand-sub { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #9CC4D4; }
.masthead nav { display: flex; gap: 4px; flex: 1; }
.masthead nav a { color: #CFE3EB; text-decoration: none; padding: 6px 12px; border-radius: 3px; }
.masthead nav a.active, .masthead nav a:hover { background: var(--teal); color: #fff; }
.who { font-size: 12px; color: #9CC4D4; }
.who a { color: var(--amber); }
main { padding: 20px 24px 60px; max-width: 1800px; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 16px 18px; margin-bottom: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

.flash { margin: 12px 24px 0; padding: 10px 14px; border-radius: 3px; background: var(--teal-soft); border-left: 4px solid var(--teal); }
main .flash { margin: 0 0 16px; }
.flash-warn { background: var(--amber-soft); border-color: var(--amber-deep); }
.flash-error { background: var(--gap); border-color: var(--danger); color: var(--danger); }

/* ── Controls ── */
.btn { display: inline-block; padding: 7px 14px; border: 1px solid var(--rule); background: #fff; color: var(--ink);
  border-radius: 3px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--teal); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-quiet { background: transparent; color: var(--muted); }
/* Expansive amber — the call to action inside a map pin's popup, where teal
   on teal would disappear. */
.btn-accent { background: var(--amber); border-color: var(--amber-deep); color: var(--teal-deep); font-weight: 600; }
.btn-accent:hover { background: var(--amber-deep); border-color: var(--amber-deep); color: var(--teal-deep); }
input[type=text], input[type=date], select, textarea { font: inherit; padding: 5px 7px; border: 1px solid var(--rule);
  border-radius: 3px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
form.inline, .actions, .upload { display: flex; gap: 8px; align-items: center; }
.actions { flex-wrap: wrap; }
.upload input[type=file] { font-size: 12px; }

/* ── Review queue ── */
.queue-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--amber-soft); border: 1px solid var(--amber); border-radius: 3px; padding: 8px 14px; margin-bottom: 16px; }
.queue-actions { display: flex; gap: 8px; }
.pill { background: var(--amber); color: var(--teal-deep); border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 600; }

/* ── Map ── */
.map-card { padding: 12px; }
.map-hint { background: rgba(255,255,255,0.9); border: 1px solid var(--rule); border-radius: 3px;
  padding: 3px 8px; font-size: 11px; color: var(--muted); }
#map.wheel-on .map-hint { display: none; }
#map { height: 56vh; min-height: 340px; width: 100%; border: 1px solid var(--rule); border-radius: 3px; background: var(--teal-soft); }
.map-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.map-bar label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.map-bar label.grow { flex: 1; min-width: 260px; }
.map-bar select { width: auto; }
.map-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.leaflet-popup-content .pin { min-width: 190px; }
.pin-stat { font-family: var(--font-display); font-size: 20px; margin: 6px 0 2px; color: var(--teal); }
.pin-stat span { font-family: var(--font-body); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.leaflet-popup-content .btn { margin-top: 8px; padding: 4px 10px; }
.leaflet-popup-content a { color: var(--teal); }

/* ── Search ── */
.search-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.search-row label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.search-row input, .search-row select { width: auto; min-width: 90px; }
.w-zip { width: 80px !important; min-width: 0 !important; }
.w-state { width: 50px !important; min-width: 0 !important; }
.w-sf { width: 80px !important; min-width: 0 !important; }
.or { color: var(--muted); padding-bottom: 7px; }
.more { margin-top: 12px; }
.more summary { cursor: pointer; color: var(--teal); font-size: 13px; }
.more .search-row { margin-top: 10px; align-items: flex-start; }
fieldset.checks { border: 1px solid var(--rule); border-radius: 3px; padding: 6px 10px; }
/* The filter boxes hold different numbers of options, so left alone they are
   ragged. Stretch makes every box as tall as the tallest. */
.filter-boxes { align-items: stretch; }
.filter-boxes fieldset.checks { flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px; }
.filter-boxes fieldset.checks legend { margin-bottom: 2px; }
fieldset.checks legend { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
fieldset.checks label { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; }
fieldset.checks input { width: auto; }

/* ── Tables ── */
.scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  font-weight: 600; padding: 7px 8px; border-bottom: 2px solid var(--rule); background: #FAFBFC; white-space: nowrap; }
table.data td { padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data tr:hover td { background: #FAFCFD; }
table.data.narrow { width: auto; }
.r { text-align: right; }
.c { text-align: center; }
table.stats td { white-space: nowrap; }
table.stats tr.total td { border-top: 2px solid var(--rule); font-weight: 600; }
table.comps tr.asking td { color: var(--muted); font-style: italic; }

/* The units editor: dense, every cell an input. */
table.units td { padding: 2px 3px; }
table.units input, table.units select { padding: 3px 5px; font-size: 13px; border-color: transparent; background: transparent; }
table.units input:hover, table.units select:hover { border-color: var(--rule); }
table.units input:focus, table.units select:focus { background: #fff; }
table.units tr.vacant td { background: #FAFAFA; }
table.units tr.new-row td { background: var(--teal-soft); }
table.units .c-suite input { min-width: 90px; }
table.units .c-tenant input, table.units .c-notes input, table.units .c-escalation input, table.units .c-address input { min-width: 180px; }
table.units .c-sf input { min-width: 70px; }
table.units .c-lease_type select { min-width: 120px; }
table.units input[type=date] { min-width: 130px; }
table.units .readonly { display: block; padding: 3px 5px; color: var(--muted); }
td.p-manual { box-shadow: inset 3px 0 0 var(--amber); }
td.p-derived input, td.p-inherited select, td.p-derived select { color: var(--teal); font-style: italic; }
td.gap, label.field.gap input, label.field.gap select, label.field.gap textarea { background: var(--gap) !important; }
td.gap { box-shadow: inset 0 0 0 1px var(--gap-edge); }

/* ── Field grid (property / document forms) ── */
fieldset { border: none; padding: 0; margin: 0 0 14px; }
fieldset legend { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
label.field { display: flex; flex-direction: column; gap: 3px; }
label.field.wide { grid-column: span 2; }
.field-label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.readonly { padding: 5px 0; color: var(--muted); }

/* ── Provenance badges ── */
.prov { font-size: 10px; padding: 0 5px; border-radius: 8px; border: 1px solid; line-height: 15px; cursor: help; white-space: nowrap; }
.prov-extracted { color: var(--muted); border-color: var(--rule); }
.prov-derived, .prov-inherited, .prov-geocoded { color: var(--teal); border-color: #A9CAD8; background: var(--teal-soft); }
.prov-manual { color: var(--warn); border-color: var(--amber); background: var(--amber-soft); }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.gap-swatch { display: inline-block; width: 14px; height: 12px; background: var(--gap); border: 1px solid var(--gap-edge); }

/* ── Status, age, meters ── */
.status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 3px; background: var(--rule); white-space: nowrap; }
.status-published { background: #DDEFE3; color: var(--ok); }
.status-review { background: var(--amber-soft); color: var(--warn); }
.status-failed, .status-unsupported { background: var(--gap); color: var(--danger); }
.status-queued, .status-extracting { background: var(--teal-soft); color: var(--teal); }
.age { white-space: nowrap; font-size: 12px; padding: 1px 6px; border-radius: 3px; }
.age-fresh { background: #DDEFE3; color: var(--ok); }
.age-aging { background: var(--amber-soft); color: var(--warn); }
.age-stale { background: var(--gap); color: var(--danger); }
.age-unknown { background: var(--rule); color: var(--muted); }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: var(--rule); color: var(--muted); white-space: nowrap; }
.tag-warn { background: var(--amber-soft); color: var(--warn); }
.meter { width: 90px; height: 7px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--teal); }
.meter.big { width: 160px; height: 9px; margin: 8px 0 2px auto; }
.tabs { display: flex; gap: 4px; margin: 6px 0 12px; flex-wrap: wrap; }
.tabs a { padding: 4px 10px; border-radius: 3px; text-decoration: none; color: var(--muted); }
.tabs a.active { background: var(--teal-soft); color: var(--teal); }
.count { font-size: 11px; opacity: 0.7; }

/* ── Document page ── */
.doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.doc-status { text-align: right; }
.status-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; align-items: center; }
ul.warnings, ul.gaps { margin: 0; padding-left: 18px; }
ul.warnings li { margin-bottom: 4px; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary h2 { display: inline; }
details.card > summary::before { content: "▸ "; color: var(--muted); }
details.card[open] > summary::before { content: "▾ "; }
.source iframe { width: 100%; height: 75vh; border: 1px solid var(--rule); margin-top: 10px; }
.source-img { max-width: 100%; margin-top: 10px; }
.source-text { max-height: 60vh; overflow: auto; background: #FAFBFC; border: 1px solid var(--rule); padding: 10px; font-size: 12px; }
.sheet { margin-top: 12px; }
.sheet-name { font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); background: var(--teal-soft); border: 1px solid var(--rule); border-bottom: none;
  display: inline-block; padding: 3px 10px; border-radius: 3px 3px 0 0; }
.sheet-preamble { background: #FAFBFC; border: 1px solid var(--rule); border-bottom: none; padding: 6px 10px;
  font-size: 12px; color: var(--muted); }
.sheet-scroll { max-height: 60vh; overflow: auto; border: 1px solid var(--rule); background: #fff; }
table.sheet-table { font-size: 12px; }
table.sheet-table th { position: sticky; top: 0; z-index: 1; }
table.sheet-table td { white-space: nowrap; border-right: 1px solid var(--rule); padding: 3px 8px; }
table.sheet-table td.num { text-align: right; }
table.sheet-table .rownum { position: sticky; left: 0; background: #FAFBFC; color: var(--muted); text-align: right;
  font-size: 10px; padding: 3px 6px; border-right: 1px solid var(--rule); }

/* ── Public pages (privacy) ── */
main.public { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
main.public h2 { font-size: 15px; margin-top: 22px; }
body.public-page { background: var(--bg); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--rule); margin-top: 8px; padding: 16px 24px 24px;
  text-align: center; font-size: 12px; color: var(--muted); }
body.login-page .site-footer { position: fixed; bottom: 0; left: 0; right: 0; border-top: none; color: #9CC4D4; }

/* ── Login ── */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--teal-deep); }
.login-card { background: #fff; padding: 36px 40px; border-radius: 4px; border-top: 4px solid var(--amber); width: 360px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { font-size: 36px; margin: 0; }

@media (max-width: 720px) {
  main { padding: 12px; }
  .masthead { gap: 12px; padding: 0 12px; }
  .brand-sub, .who { display: none; }
  label.field.wide { grid-column: auto; }
}
