/* ═══════════════════════════════════════════════
   TENANCE — POLISH LAYER (loaded last)
   Dashboard fit + scroll, neutral stat tiles, portfolio panel,
   skeleton placeholders, motion, add-modals, sidebar rail,
   landing + auth redesign. Transform/opacity animations only.
═══════════════════════════════════════════════ */
:root {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --card-ring: 0 0 0 1px rgba(255,255,255,.05);
}
html { scroll-behavior: smooth; }

/* ── Weight: the display face is heavy; step everything down one notch ── */
[style*="font-weight:900"], [style*="font-weight: 900"] { font-weight: 700 !important; }
[style*="font-weight:800"], [style*="font-weight: 800"] { font-weight: 700 !important; }
[style*="font-weight:700"], [style*="font-weight: 700"] { font-weight: 600 !important; }
.ph-t, .ant, .st, .rpt, .r-head, .chlbl, .mt2, .a-title, .lc-t, .tn, .uname, .mit-t { font-weight: 600; }
.sc-val { font-weight: 600; }
.sc-chg { font-weight: 500; }
.bg, .abtn, .ni.on { font-weight: 600; }
.gr-hello b { font-weight: 600; }

/* ── Scrolling ── */
.csc, .rcol, .abox, .modal, .af-modal.on { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.csc { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.csc::-webkit-scrollbar { width: 6px; }
.csc::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.rcol { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
.rcol::-webkit-scrollbar { display: block; width: 4px; }
.rcol::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* ── Dashboard: always fits the viewport on desktop (compact, no page scroll) ── */
.csc:has(#p-dashboard.on) { display: flex; flex-direction: column; }
#p-dashboard.on { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
#p-dashboard .anbox { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; }
#p-dashboard .anbody { flex: 1; min-height: 0; }
#p-dashboard .chbx { display: flex; flex-direction: column; min-height: 0; }
#p-dashboard .chtop { flex-shrink: 0; }
#p-dashboard .chwrap { flex: 1; height: auto; min-height: 0; }
#p-dashboard .ubx { flex-shrink: 0; }

/* ── Stat tiles: one neutral set, no pastel, no overlap ── */
.sccol { gap: 9px; }
.sc, .sc.sc-b, .sc.sc-u, .sc.sc-p, .sc.sc-c {
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 16px; padding: 14px; position: relative; overflow: hidden;
  flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.sc:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.22); box-shadow: 0 12px 28px rgba(0,0,0,.35); }
.sc-lbl { color: var(--t2); font-weight: 500; font-size: 12px; letter-spacing: .3px; padding-right: 38px; margin-bottom: 4px; }
.sc-val { color: var(--t1); font-size: 21px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.sc-chg { color: var(--t3); font-size: 12px; margin-top: 4px; }
.up { color: #6ecf7e !important; }
.dn { color: #e8837e !important; }
.sc-ico { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.sc-ico svg { stroke: var(--t2); }

/* ── Portfolio Overview: one panel, sections spread evenly, nothing trailing ── */
.rcol {
  background: var(--panel); border-radius: var(--r); padding: 20px 16px;
  display: flex; flex-direction: column; overflow-y: auto;
}
.r-head { font-size: 15px; padding: 2px 2px 14px; flex-shrink: 0; }
.rcol-body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.rcard { background: transparent; padding: 0; border-radius: 0; flex-shrink: 0; }
.rcard + .rcard { padding-top: 16px; border-top: 1px solid var(--border); }
.sk-rowl { display: flex; flex-direction: column; gap: 7px; padding: 8px 0; }
.ti-sk { pointer-events: none; }
.occ-bar { height: 10px; background: rgba(255,255,255,.07); border-radius: 6px; overflow: hidden; }
.occ-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #c8923a, #e09b6b); transform-origin: left; animation: barGrow .9s var(--ease) both; }
.occ-meta { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12px; color: var(--t2); }
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa {
  display: flex; align-items: center; gap: 8px; padding: 10px 11px; border-radius: 11px;
  background: var(--card2); border: 1px solid var(--border2); color: var(--t1);
  font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--font);
  transition: transform .18s var(--ease), border-color .18s, background .18s;
}
.qa:hover { transform: translateY(-2px); border-color: var(--goldd); background: rgba(200,146,58,.08); }
.qa:active { transform: scale(.97); }
.qa-i { width: 22px; height: 22px; border-radius: 7px; background: rgba(200,146,58,.16); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; flex-shrink: 0; }

/* ── Skeleton polish ── */
.uc-sk { pointer-events: none; }
.sk { position: relative; overflow: hidden; }
.pgrid > .pc .sk:first-child { border-radius: 0; }

/* ── Sidebar rail (collapsed) is wider, active item is a real pill ── */
#s-dash.sb-collapsed .sb { width: 76px; }
#s-dash.sb-collapsed .sb .ni { padding: 11px 0; margin: 0 10px; border-radius: 14px; }
#s-dash.sb-collapsed .sb .ni.on { background: var(--goldd); box-shadow: 0 6px 18px rgba(200,146,58,.28); }
.ni { transition: background .18s, color .18s, transform .18s var(--ease); }
.ni:not(.on):hover { transform: translateX(3px); }
.ni.on { box-shadow: 0 6px 18px rgba(200,146,58,.22); }
.ni .ni-ico { transition: transform .2s var(--ease); }
.ni:hover .ni-ico { transform: scale(1.1); }

/* ── Motion ── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes orbA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,40px) scale(1.12); } }
@keyframes orbB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-70px,-30px) scale(1.18); } }
@keyframes shine { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }
.pg.on > * { animation: rise .42s var(--ease) both; }
.pg.on > *:nth-child(2) { animation-delay: .05s; }
.pg.on > *:nth-child(3) { animation-delay: .1s; }
.pg.on > *:nth-child(4) { animation-delay: .15s; }
.pg.on > *:nth-child(n+5) { animation-delay: .2s; }
.pgrid > .pc, .tgrid > .ti, .urow > .uc, .mrow, .mit, .rcard { animation: rise .45s var(--ease) both; }
.pgrid > .pc:nth-child(2), .urow > .uc:nth-child(2), .rcard:nth-child(2) { animation-delay: .06s; }
.pgrid > .pc:nth-child(3), .urow > .uc:nth-child(3), .rcard:nth-child(3) { animation-delay: .12s; }
.pgrid > .pc:nth-child(n+4), .rcard:nth-child(n+4) { animation-delay: .18s; }
.sccol > .sc { animation: rise .45s var(--ease) both; }
.sccol > .sc:nth-child(2) { animation-delay: .06s; }
.sccol > .sc:nth-child(3) { animation-delay: .12s; }
.sccol > .sc:nth-child(4) { animation-delay: .18s; }
.bg, .bo, .abtn, .lc, .dlbtn, .ib, .qa, .vt-btn, .ptab { transition: transform .16s var(--ease), background .16s, border-color .16s, box-shadow .16s, color .16s; }
.bg:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(200,146,58,.28); }
.bg:active, .bo:active, .abtn:active, .ib:active, .dlbtn:active { transform: scale(.97); }
.tbl tr, tbody tr { transition: background .15s; }
.pc { transition: transform .22s var(--ease), border-color .2s, box-shadow .22s; }
.pc:hover { box-shadow: 0 16px 36px rgba(0,0,0,.4); }
.dash-chart-pillbar { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
#af-backdrop.on { animation: fadeIn .18s ease both; }
.ptab.on, .vt-btn.on { box-shadow: 0 4px 14px rgba(200,146,58,.28); }

/* ── "Add" forms as designed modals ── */
#af-backdrop { display: none; position: fixed; inset: 0; background: rgba(6,10,7,.68); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 1999; }
#af-backdrop.on { display: block; }
.af-modal.on {
  display: block; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 2000; width: 580px; max-width: 94vw; max-height: 88vh; overflow-y: auto;
  padding: 0; margin: 0; border-radius: 22px;
  background: linear-gradient(180deg, #1d241e 0%, #171d18 100%);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 100px rgba(0,0,0,.65), 0 0 0 1px rgba(200,146,58,.06);
  animation: modalIn .28s var(--ease) both;
}
@keyframes modalIn { from { opacity: 0; transform: translate(-50%,-47%) scale(.96); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
.af-modal.on > :first-child {
  position: relative; margin: 0 !important; padding: 26px 30px 20px 84px !important;
  font-size: 19px !important; font-weight: 600 !important; letter-spacing: -.2px; color: var(--t1);
  background: radial-gradient(120% 200% at 0% 0%, rgba(200,146,58,.16), transparent 60%);
  border-bottom: 1px solid var(--border);
}
.af-modal.on > :first-child::before {
  content: "+"; position: absolute; left: 28px; top: 22px; width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, #e0a94a, #c8923a); color: #1a0e00; font-size: 26px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(200,146,58,.35);
}
.af-modal.on > :first-child::after { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 400; color: var(--t2); letter-spacing: 0; }
#af-prop > :first-child::after { content: "Add a building to your portfolio — you can add units and tenants next."; }
#af-ten > :first-child::after { content: "Invite or record a tenant and link them to a unit."; }
#af-maint > :first-child::after { content: "Log an issue, set its priority and assign someone to fix it."; }
#af-tmaint > :first-child::after { content: "Describe the problem and your landlord is notified right away."; }
.af-modal.on > :not(:first-child):not(:last-child):not(.af-x) { margin-left: 30px; margin-right: 30px; }
.af-modal.on > .fg, .af-modal.on > .fg2 { margin-top: 22px; margin-bottom: 8px; gap: 16px; }
.af-modal.on .sl { font-size: 11.5px; letter-spacing: .06em; color: var(--t2); margin-bottom: 7px; }
.af-modal.on .si { height: 44px; border-radius: 11px; padding: 0 14px; font-size: 13.5px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.1); transition: border-color .15s, box-shadow .15s, background .15s; }
.af-modal.on textarea.si { height: auto; padding: 12px 14px; }
.af-modal.on .si:hover { border-color: rgba(255,255,255,.2); }
.af-modal.on .si:focus { border-color: var(--gold); background: rgba(0,0,0,.4); box-shadow: 0 0 0 4px rgba(224,155,107,.14); outline: none; }
.af-modal.on > :last-child {
  position: sticky; bottom: 0; margin: 12px 0 0 !important; padding: 16px 30px !important;
  display: flex; justify-content: flex-end; gap: 10px; flex-direction: row-reverse;
  background: rgba(23,29,24,.92); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
}
.af-modal.on > :last-child .bg { padding: 11px 26px; font-size: 13.5px; border-radius: 11px; }
.af-modal.on > :last-child .bo { padding: 11px 20px; font-size: 13.5px; border-radius: 11px; }
.af-x {
  display: none; position: absolute; top: 20px; right: 20px; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: var(--t2);
  font-size: 20px; line-height: 1; cursor: pointer; z-index: 2; transition: background .15s, color .15s, transform .15s var(--ease);
}
.af-modal.on > .af-x { display: block; }
.af-x:hover { background: rgba(255,255,255,.14); color: var(--t1); transform: rotate(90deg); }

/* ══════════ LANDING ══════════ */
#s-land::after, #s-ll::after, #s-tl::after, #s-setup::after, #s-tsignup::after, #s-fp::after, #s-rs::after, #s-tfp::after, #s-trs::after {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -120px; top: -140px;
  background: radial-gradient(circle, rgba(224,155,107,.22), transparent 65%); filter: blur(10px);
  animation: orbA 16s ease-in-out infinite; pointer-events: none;
}
#s-ll, #s-tl, #s-setup, #s-tsignup, #s-fp, #s-rs, #s-tfp, #s-trs { position: relative; overflow: hidden; }
#s-land .land-wrap::before {
  content: ""; position: fixed; width: 620px; height: 620px; border-radius: 50%; left: -180px; bottom: -220px;
  background: radial-gradient(circle, rgba(90,200,106,.16), transparent 65%); animation: orbB 19s ease-in-out infinite; pointer-events: none; z-index: -1;
}
.land-wrap > * { animation: rise .7s var(--ease) both; }
.land-wrap > *:nth-child(2) { animation-delay: .08s; }
.land-wrap > *:nth-child(3) { animation-delay: .16s; }
.land-wrap > *:nth-child(4) { animation-delay: .26s; }
.land-wrap > *:nth-child(5) { animation-delay: .34s; }
.land-wrap > *:nth-child(6) { animation-delay: .42s; }
.land-logo-ico { background: rgba(255,255,255,.1); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.land-logo-name { font-weight: 600; letter-spacing: -.6px; }
.land-h1 { font-size: 60px; font-weight: 600; letter-spacing: -2.2px; line-height: 1.02; }
.land-h1 em { color: #f0b979; }
.land-sub { font-size: 17px; max-width: 520px; color: rgba(255,255,255,.66); }
.lc {
  width: 300px; padding: 30px 26px; border-radius: 24px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.lc::after { content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); transform: translateX(-120%) skewX(-18deg); pointer-events: none; }
.lc:hover::after { animation: shine .9s var(--ease); }
.lc:hover { border-color: rgba(224,155,107,.7); transform: translateY(-6px); box-shadow: 0 30px 70px rgba(0,0,0,.42), 0 0 0 1px rgba(224,155,107,.25); }
.lc-ico { width: 52px; height: 52px; border-radius: 15px; }
.lc-t { font-size: 18px; }
.lc-d { font-size: 13px; color: rgba(255,255,255,.62); }
.lc-cta { font-size: 13px; transition: gap .2s var(--ease); }
.lc:hover .lc-cta { gap: 11px; }
.land-trust { font-size: 12.5px; color: rgba(255,255,255,.5); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.land-demo { font-size: 14px; }

/* ══════════ AUTH + SIGN-UP ══════════ */
.abox {
  position: relative; width: 440px; padding: 40px 38px; border-radius: 26px;
  background: linear-gradient(170deg, rgba(30,38,31,.94), rgba(20,26,21,.96));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 40px 100px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: rise .55s var(--ease) both;
}
.abox::before { content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #e09b6b, transparent); }
.a-title { font-size: 27px; font-weight: 600; letter-spacing: -.8px; margin-bottom: 6px; }
.a-sub { font-size: 13.5px; line-height: 1.6; color: var(--t2); margin-bottom: 24px; }
.a-back { transition: color .15s, transform .18s var(--ease); }
.a-back:hover { transform: translateX(-3px); }
.a-badge { background: rgba(224,155,107,.12); }
.fld label { font-size: 11.5px; letter-spacing: .07em; margin-bottom: 7px; }
.fld input, .fld select, .fld textarea {
  height: 48px; border-radius: 13px; padding: 0 15px; font-size: 14.5px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.11);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.fld textarea { height: auto; padding: 12px 15px; }
.fld input:hover, .fld select:hover { border-color: rgba(255,255,255,.22); }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--gold); background: rgba(0,0,0,.42); box-shadow: 0 0 0 4px rgba(224,155,107,.15); outline: none; }
.abtn {
  position: relative; overflow: hidden; height: 50px; border-radius: 14px; font-size: 15px; font-weight: 600;
  background: linear-gradient(135deg, #e0a94a, #c8923a); color: #1a0e00; border: none;
  box-shadow: 0 12px 28px rgba(200,146,58,.32);
}
.abtn::after { content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-120%) skewX(-18deg); }
.abtn:hover:not(:disabled)::after { animation: shine .8s var(--ease); }
.abtn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(200,146,58,.42); }
.abtn.green { background: linear-gradient(135deg, #3a8a48, #2d7a3a); color: #fff; box-shadow: 0 12px 28px rgba(58,138,72,.3); }
.google-btn, .apple-btn { height: 48px; border-radius: 13px; transition: transform .16s var(--ease), border-color .16s, background .16s; }
.google-btn:hover, .apple-btn:hover { transform: translateY(-2px); }
.wdots { margin-bottom: 26px; }
.wdot { width: 32px; height: 32px; font-size: 13px; font-weight: 600; transition: background .3s, border-color .3s, box-shadow .3s, transform .3s var(--ease); }
.wdot.active { box-shadow: 0 0 0 5px rgba(224,155,107,.18), 0 8px 20px rgba(200,146,58,.35); transform: scale(1.06); }
.wdot.done { box-shadow: 0 0 0 4px rgba(90,200,106,.1); }
.wdot-lbl { font-size: 11.5px; font-weight: 500; }
.wline { height: 3px; border-radius: 2px; margin-top: 15px; background: rgba(255,255,255,.1); }

/* ══════════ MOBILE ══════════ */
@media (max-width: 768px) {
  #p-dashboard.on, .csc:has(#p-dashboard.on) { display: block !important; }
  #p-dashboard .anbox { min-height: 0; display: block; }
  #p-dashboard .chbx { display: block; }
  #p-dashboard .chwrap { height: 180px; }
  .sc, .sc.sc-b, .sc.sc-u, .sc.sc-p, .sc.sc-c { display: block; }
  .sc-lbl { padding-right: 34px !important; }
  .sc-ico { width: 28px !important; height: 28px !important; top: 10px !important; right: 10px !important; }
  .sc-ico svg { width: 12px !important; height: 12px !important; }
  .chtop { flex-wrap: wrap !important; gap: 8px !important; align-items: flex-start !important; }
  .chtop > div { width: 100% !important; }
  .rcol { background: transparent; padding: 0 20px 10px !important; }
  .r-head { padding-left: 0; }
  .rcol-body { gap: 14px; }
  .rcard, .rcard + .rcard { background: var(--panel); border-radius: 18px; padding: 18px !important; border-top: none; }
  .land-h1 { font-size: 40px; letter-spacing: -1.4px; }
  .lc { width: 100%; max-width: 340px; }
  .abox { width: 100%; padding: 30px 22px; border-radius: 22px; }
  .af-modal.on { width: 94vw; }
  .af-modal.on > :first-child { padding: 22px 20px 16px 74px !important; font-size: 17px !important; }
  .af-modal.on > :first-child::before { left: 18px; top: 18px; }
  .af-modal.on > :not(:first-child):not(:last-child):not(.af-x) { margin-left: 20px; margin-right: 20px; }
  .af-modal.on > :last-child { padding: 14px 20px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
