/* ===== Hearthline Property Management ===== */
:root {
  --accent: #0d6e6e;
  --brass: #b9862c;
  --link: var(--accent);
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --ink: #1a2230;
  --ink-2: #3c4555;
  --muted: #6c7381;
  --line: #e3e0d8;
  --side: #fbfaf7;
  --side-line: #e7e4dc;
  --shadow: 0 1px 2px rgba(26, 34, 48, .05), 0 3px 12px rgba(26, 34, 48, .05);
  --radius: 12px;
  --green: #1f7a4d; --green-bg: #e1f2e8;
  --blue: #2457a6;  --blue-bg: #e3ecfa;
  --orange: #b4521a; --orange-bg: #fbe9db;
  --amber: #8a6106; --amber-bg: #fbf0d4;
  --red: #b42d2d;   --red-bg: #f9e1e0;
  --violet: #6545a8; --violet-bg: #ece6f8;
  --teal: #0d6e6e;  --teal-bg: #dcf0ef;
  --gray: #59606c;  --gray-bg: #e9e7e1;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Archivo", "Public Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151b; --surface: #181e26; --surface-2: #1f2630; --ink: #e5e8ec; --ink-2: #c4cad3; --muted: #8e97a4; --line: #2a323d;
    --side: #141a21; --side-line: #252d37; --shadow: 0 1px 2px rgba(0,0,0,.4); --link: #5cc6c2;
    --green-bg: #15301f; --green: #77d39f; --blue-bg: #18273f; --blue: #9dbcf2; --orange-bg: #382215; --orange: #f2a46e;
    --amber-bg: #342910; --amber: #e8c565; --red-bg: #3a1818; --red: #f2a19c; --violet-bg: #272040; --violet: #c3b2ee;
    --teal-bg: #143433; --teal: #7fd6d2; --gray-bg: #29313b; --gray: #c4cad3; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151b; --surface: #181e26; --surface-2: #1f2630; --ink: #e5e8ec; --ink-2: #c4cad3; --muted: #8e97a4; --line: #2a323d;
  --side: #141a21; --side-line: #252d37; --shadow: 0 1px 2px rgba(0,0,0,.4); --link: #5cc6c2;
  --green-bg: #15301f; --green: #77d39f; --blue-bg: #18273f; --blue: #9dbcf2; --orange-bg: #382215; --orange: #f2a46e;
  --amber-bg: #342910; --amber: #e8c565; --red-bg: #3a1818; --red: #f2a19c; --violet-bg: #272040; --violet: #c3b2ee;
  --teal-bg: #143433; --teal: #7fd6d2; --gray-bg: #29313b; --gray: #c4cad3; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; font-stretch: 108%; margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .88em; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .75rem; }
.center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pos { color: var(--green); } .neg { color: var(--red); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--surface); padding: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* ----- Shell ----- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--side); border-right: 1px solid var(--side-line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 56px; width: auto; background: #fff; border-radius: 8px; padding: 3px 6px; color: transparent; }
.portal-top .brand-logo, .masthead .brand-logo { height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--font-head); font-size: 1.22rem; font-weight: 800; font-stretch: 112%; letter-spacing: -.02em; }
.brand-text small { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; margin-top: 3px; }
.nav { padding: 4px 10px 24px; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.nav-group { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 5px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.nav a .ico { width: 17px; height: 17px; color: var(--muted); }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--teal-bg); color: var(--accent); font-weight: 650; }
.nav a.active .ico { color: var(--accent); }
.nav-count { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: 1px 7px; }
.sidebar-scrim { display: none; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topsearch { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.topsearch .ico { position: absolute; left: 12px; color: var(--muted); }
.topsearch input { width: 100%; padding: 9px 12px 9px 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; position: relative; }
.icon-btn:hover { border-color: var(--accent); text-decoration: none; }
.bell { margin-left: auto; }
.bell-dot { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: .66rem; font-weight: 700; border-radius: 999px; padding: 1px 5px; border: 2px solid var(--bg); }
.menu-btn { display: none; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary span:last-child { display: flex; flex-direction: column; line-height: 1.1; font-size: .82rem; }
.usermenu summary small { color: var(--muted); font-size: .7rem; }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 8px; min-width: 250px; z-index: 50; }
.usermenu-pop > div { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.usermenu-pop a { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 8px; color: var(--ink); }
.usermenu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); font-weight: 700; font-size: .95rem; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.content { padding: 22px 26px 40px; width: 100%; max-width: 1480px; }
.foot { padding: 14px 26px 90px; }
.tabbar { display: none; }

/* ----- Demo banner ----- */
.demo-banner { background: var(--amber-bg); color: var(--amber); border-bottom: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); font-size: .86rem; }
.demo-banner-in { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 7px 26px; }
.demo-banner .btn { background: var(--surface); }

/* ----- Page header ----- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

/* ----- Cards & grids ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 16px 18px 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split-r { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; display: flex; flex-direction: column; gap: 1px; box-shadow: var(--shadow); color: var(--ink); position: relative; }
a.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat::before { content: ""; position: absolute; left: 15px; right: 15px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: transparent; }
.stat.accent::before { background: var(--accent); } .stat.good::before { background: var(--green); } .stat.warn::before { background: #d39b1a; } .stat.bad::before { background: var(--red); } .stat.info::before { background: var(--blue); }
.stat-label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.stat-value { font-family: var(--font-head); font-size: clamp(1.3rem, .9rem + .8vw, 1.7rem); font-weight: 700; font-stretch: 105%; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.stat-sub { font-size: .78rem; color: var(--muted); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-dark { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: .86rem; } .btn-xs { padding: 3px 9px; font-size: .78rem; border-radius: 7px; }
.btn-block { width: 100%; } .btn .ico { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; }

/* ----- Forms ----- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .86rem; color: var(--ink-2); }
label .lbl .req { color: var(--red); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; width: 100%; min-width: 0; }
select[multiple] { padding: 4px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; padding: 0; }
input[type=file] { padding: 6px; background: var(--surface-2); }
input[type=color] { padding: 2px; height: 40px; width: 60px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
textarea { min-height: 76px; resize: vertical; }
.hint { font-weight: 400; color: var(--muted); font-size: .78rem; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--link); font-weight: 600; cursor: pointer; padding: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label { flex: 1 1 150px; font-size: .78rem; }
.filters .grow2 { flex: 3 1 240px; }
.filters .btn { flex: none; }
.card.filters { background: var(--surface-2); box-shadow: none; padding: 12px 14px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; font-family: var(--font-head); font-size: .95rem; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ----- Pills / tabs ----- */
.pills { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.pill { padding: 8px 12px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pill:hover { color: var(--ink); text-decoration: none; }
.pill.active { color: var(--accent); border-bottom-color: var(--accent); }
.pill .count { margin-left: 5px; background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 0 7px; font-size: .75rem; }

/* ----- Badges & tags ----- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); } .badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-orange { background: var(--orange-bg); color: var(--orange); } .badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); } .badge-gray { background: var(--gray-bg); color: var(--gray); }
.badge-violet { background: var(--violet-bg); color: var(--violet); } .badge-teal { background: var(--teal-bg); color: var(--teal); }
.tag { display: inline-block; padding: 1px 8px; margin: 2px 3px 2px 0; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: .76rem; font-weight: 500; color: var(--ink-2); }
.stars { color: #d39b1a; letter-spacing: 1px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.sev-3 { border-left: 4px solid var(--red); } .sev-2 { border-left: 4px solid #d39b1a; } .sev-1 { border-left: 4px solid var(--blue); }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .89rem; }
.t th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.t tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.t td.sub { padding-left: 28px; color: var(--muted); }
.t tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.row-link { cursor: pointer; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ----- Lists, key-values ----- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ----- Alerts ----- */
.alert { position: relative; padding: 11px 38px 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.alert ul { margin: 6px 0 0 18px; padding: 0; font-weight: 400; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert-error { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-warn { background: var(--amber-bg); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.alert-info { background: var(--blue-bg); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.alert-x { position: absolute; right: 8px; top: 7px; border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* ----- Attention list (Today) ----- */
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); margin-bottom: 6px; }
.attn li a { color: var(--ink); flex: 1; }
.attn .grp { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); width: 92px; flex: none; }

/* ----- Media ----- */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 120px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 10 / 7; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: block; }
.plan img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.filechip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: .85rem; max-width: 100%; }
.filechip img { width: 34px; height: 26px; object-fit: cover; border-radius: 4px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare figure { margin: 0; }
.compare img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.compare figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ----- Bars / charts ----- */
.hbar { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: .86rem; }
.hbar .track { height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .fill.warn { background: #d39b1a; } .hbar .fill.bad { background: var(--red); }
.meter { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; min-width: 80px; }
.meter > span { display: block; height: 100%; background: var(--green); }
.meter > span.warn { background: #d39b1a; } .meter > span.bad { background: var(--red); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--accent); } .chart .bar2 { fill: var(--brass); } .chart .bar:hover, .chart .bar2:hover { opacity: .8; }
.chart .axis { stroke: var(--line); } .chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ----- Kanban (work orders, pipeline) ----- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--surface-2); border-radius: 12px; padding: 10px; min-height: 120px; }
.col h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; margin: 2px 4px 10px; }
.kcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; color: var(--ink); box-shadow: var(--shadow); }
.kcard:hover { text-decoration: none; border-color: var(--accent); }
.kcard .t1 { font-weight: 650; margin-bottom: 2px; }
.kcard .meta { font-size: .78rem; color: var(--muted); }

/* ----- Calendar ----- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-head { text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 4px; }
.month-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 110px; padding: 5px; font-size: .74rem; overflow: hidden; }
.month-cell.other { opacity: .45; } .month-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.month-cell .d { font-weight: 700; font-size: .8rem; margin-bottom: 3px; }
.ev { display: block; padding: 2px 5px; border-radius: 5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.ev:hover { text-decoration: none; filter: brightness(.96); }
.ev-violet { background: var(--violet-bg); } .ev-blue { background: var(--blue-bg); } .ev-orange { background: var(--orange-bg); } .ev-amber { background: var(--amber-bg); }
.ev-green { background: var(--green-bg); } .ev-teal { background: var(--teal-bg); } .ev-gray { background: var(--gray-bg); } .ev-red { background: var(--red-bg); }

/* ----- Map ----- */
#map { height: 440px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); z-index: 1; }
.leaflet-popup-content { font-family: var(--font); }

/* ----- Auth ----- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px 140px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, var(--bg)) 0%, var(--bg) 60%); position: relative; overflow-x: hidden; }
.auth-skyline { position: fixed; left: 0; right: 0; bottom: 0; color: color-mix(in srgb, var(--accent) 16%, var(--bg)); pointer-events: none; }
.auth-skyline svg { width: 100%; height: 200px; display: block; }
.auth-wrap { width: 100%; max-width: 480px; position: relative; z-index: 1; }
.auth-brand { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; margin-bottom: 18px; }
.auth-logo { display: block; width: 300px; max-width: 80%; height: auto; background: #fff; border-radius: 14px; padding: 8px 14px; color: transparent; }
.auth-brand h1 { margin: 0; font-size: 1.6rem; }
.auth-brand p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: 0 10px 40px rgba(26, 34, 48, .08); }
.auth-title { font-size: 1.4rem; }
.auth-foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 14px; }
.demo-accounts { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 6px; }
.demo-accounts td { padding: 4px 6px; border-top: 1px solid color-mix(in srgb, var(--blue) 20%, transparent); }
.demo-accounts button { font: inherit; font-size: .78rem; padding: 2px 8px; border-radius: 6px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }

/* ----- Tenant portal ----- */
.portal-body { background: var(--bg); }
.portal-top { display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.portal-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.portal-nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; }
.portal-nav a.active { background: var(--teal-bg); color: var(--accent); }
.portal-out { margin-left: auto; }
.portal-content { max-width: 1000px; margin: 0 auto; }
.paybox { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; }

/* ----- Print ----- */
@media print {
  .sidebar, .topbar, .tabbar, .foot, .no-print, .demo-banner, .pills, .filters, .actions, .portal-top { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .content { padding: 0; max-width: none; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  a { color: #000; }
}

/* ----- Responsive ----- */
@media (max-width: 1150px) {
  .split, .split-r { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .content { padding: 16px 12px 30px; }
  .demo-banner-in { padding: 7px 12px; }
  .hide-sm { display: none !important; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .68rem; font-weight: 600; padding: 4px 8px; }
  .tabbar a:hover { text-decoration: none; color: var(--accent); }
  .tabbar .tab-new { background: var(--accent); color: #fff; border-radius: 14px; width: 50px; height: 42px; justify-content: center; padding: 0; }
  .tabbar .tab-new .ico { width: 22px; height: 22px; }
  .portal-top { padding: 8px 12px; gap: 8px; }
  .portal-out { margin-left: 0; }
  #map { height: 320px; }
}
@media (max-width: 700px) {
  h1 { font-size: 1.45rem; }
  .topsearch input::placeholder { color: transparent; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .attn .grp { display: none; }
  table.t.stack thead { display: none; }
  table.t.stack, .t.stack tbody, .t.stack tr, .t.stack td, .t.stack tfoot { display: block; width: 100%; }
  .t.stack tr { border-bottom: 1px solid var(--line); padding: 9px 14px; }
  .t.stack td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .t.stack td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; text-align: left; flex: none; padding-top: 2px; }
  .t.stack td[data-label=""]::before { content: none; }
  .hbar { grid-template-columns: 1fr auto; }
  .hbar .track { grid-column: 1 / -1; grid-row: 2; }
  .month-cell { min-height: 64px; font-size: .62rem; padding: 3px; }
  .ev { padding: 1px 3px; }
  .compare { grid-template-columns: 1fr; }
  .usermenu summary { padding: 3px; }
}
.chart .bar.neg { fill: var(--red); }
.spark { vertical-align: middle; }
.attn .when { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.attn li.sev-3 .dot { background: var(--red); } .attn li.sev-2 .dot { background: #d39b1a; } .attn li.sev-1 .dot { background: var(--blue); }
.greet { font-family: var(--font-head); font-size: 1rem; color: var(--muted); margin: -6px 0 16px; }
.mini-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: .85rem; } .mini-stats b { display: block; font-size: 1.15rem; font-family: var(--font-head); }
.checklist { list-style: none; padding: 0; margin: 0; } .checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.checklist li.done .ck-t { text-decoration: line-through; color: var(--muted); } .checklist .ck-t { flex: 1; } .checklist form { margin: 0; }
.ck-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line-2, #bbb); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: #fff; }
.checklist li.done .ck-box { background: var(--green); border-color: var(--green); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); } .timeline li { position: relative; padding: 0 0 14px 6px; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.timeline li.future::before { background: var(--surface-2); border-color: var(--line); }
.notice-body { white-space: pre-wrap; font-family: Georgia, serif; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 18px; line-height: 1.55; }
.callout { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.big-num { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.listing-card { display: grid; grid-template-columns: 220px 1fr; gap: 16px; } .listing-card img { width: 100%; border-radius: 10px; aspect-ratio: 10/7; object-fit: cover; }
.channel { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .78rem; margin: 2px; }
@media (max-width: 700px) { .listing-card { grid-template-columns: 1fr; } }
.neg { color: var(--red); }

/* ---- Demo sign-in picker ---- */
.demo-pick { margin: 0 0 6px; }
.demo-pick h3 { margin: 0 0 4px; font-size: 1.15rem; }
.demo-pick > p { margin: 0 0 14px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.demo-pick form { margin: 0 0 10px; }
.demo-go { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border: 2px solid var(--accent); border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); color: inherit; font: inherit; cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s; }
.demo-go:hover, .demo-go:focus-visible { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent); transform: translateY(-1px); outline: none; }
.demo-go .av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; flex: none; }
.demo-go .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.demo-go .txt strong { font-size: 1rem; }
.demo-go .txt span { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.demo-go .go { flex: none; font-weight: 700; font-size: .9rem; color: var(--accent); white-space: nowrap; }
.demo-manual { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.demo-manual > summary { cursor: pointer; color: var(--muted); font-size: .85rem; text-align: center; list-style: none; padding: 4px; }
.demo-manual > summary::-webkit-details-marker { display: none; }
.demo-manual[open] > summary { margin-bottom: 12px; }
@media (max-width: 420px) { .demo-go .go { display: none; } }

/* Merged sections (Rent, Leasing, Compliance…): segmented switcher above the page title */
.section-pills { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.section-pills .pill { border: 0; margin: 0; border-radius: 9px; padding: 7px 14px; }
.section-pills .pill.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
@media print { .section-pills { display: none !important; } }
