/* ═══════════════════════════════════════════════
   TENANCE — SHARED FEATURE COMPONENTS
   Winter, tickets, money, archive, planning.
   Built on the tokens in variables.css.
═══════════════════════════════════════════════ */

.fx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fx-head .ph { margin-bottom: 0; }
.fx-picker { width: auto; min-width: 200px; max-width: 280px; }
.fx-picker-one { font-size: 12px; font-weight: 600; color: var(--t2); background: var(--card2); border: 1px solid var(--border2); border-radius: 10px; padding: 8px 12px; }

.fx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.fx-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; min-width: 0; }
.fx-card + .fx-card { margin-top: 12px; }
.fx-grid > .fx-card + .fx-card { margin-top: 0; }
.fx-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.fx-ht { font-size: 14px; font-weight: 700; color: var(--t1); }
.fx-hs { font-size: 12px; color: var(--t3); margin-top: 2px; }
.fx-muted { color: var(--t3); font-size: 12px; }
.fx-sep { height: 1px; background: var(--border); margin: 12px 0; }

/* Progress */
.fx-count { font-size: 26px; font-weight: 800; color: var(--t1); letter-spacing: -.5px; }
.fx-count small { font-size: 13px; font-weight: 600; color: var(--t2); margin-left: 6px; letter-spacing: 0; }
.fx-prog { height: 8px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin: 8px 0 14px; }
.fx-prog > i { display: block; height: 100%; border-radius: 6px; background: var(--goldd); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.fx-prog.done > i { background: var(--ok); }

/* Rows */
.fx-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.fx-row:last-child { border-bottom: none; }
.fx-row-b { flex: 1; min-width: 0; }
.fx-row-t { font-size: 13px; font-weight: 600; color: var(--t1); }
.fx-row-t.done { color: var(--t2); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.25); }
.fx-row-s { font-size: 12px; color: var(--t3); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Check button */
.fx-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border2); background: transparent; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: transparent; transition: all .15s; padding: 0; }
.fx-check:hover { border-color: var(--goldd); }
.fx-check.on { background: var(--ok); border-color: var(--ok); color: #0c1a10; }
.fx-check svg { width: 14px; height: 14px; }
.fx-check:disabled { cursor: default; opacity: .7; }

/* Chips */
.fx-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; background: rgba(255,255,255,.07); color: var(--t2); white-space: nowrap; }
.fx-chip.ok   { background: rgba(90,200,106,.13); color: #6ed27c; }
.fx-chip.warn { background: rgba(224,155,107,.15); color: var(--gold); }
.fx-chip.bad  { background: rgba(224,80,80,.15); color: #ef7d7d; }
.fx-chip.info { background: rgba(110,150,230,.15); color: #9db8f0; }
.fx-chip.new  { background: rgba(110,150,230,.18); color: #b4c8f5; }

/* Who did it */
.fx-who { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--t2); font-weight: 600; }
.fx-who-av { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 800; color: #fff; background: #4a6e7c; }
.fx-who-av.fx-role-landlord { background: #8a6a3a; }
.fx-who-av.fx-role-tenant { background: #4a7c59; }
.fx-who-av.fx-role-caretaker { background: #5a6e8a; }

/* Stamp */
.fx-stamp { display: inline-block; border: 2px solid currentColor; color: var(--ok); border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; transform: rotate(-6deg); opacity: .9; }
.fx-stamp.bad { color: #ef7d7d; }

/* Buttons */
.fx-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-btn-ok { background: rgba(90,200,106,.16) !important; color: #6ed27c !important; border: 1px solid rgba(90,200,106,.35) !important; }
.fx-btn-bad { background: rgba(224,80,80,.12) !important; color: #ef7d7d !important; border: 1px solid rgba(224,80,80,.3) !important; }
.fx-link { background: none; border: none; color: var(--gold); font-weight: 600; font-size: 12px; cursor: pointer; padding: 0; }

/* Forms */
.fx-form { display: grid; gap: 10px; }
.fx-form .sl { margin-bottom: 4px; }
.fx-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .fx-form-row { grid-template-columns: 1fr; } }

/* Gauge */
.fx-gauge { display: flex; flex-direction: column; align-items: center; }
.fx-gauge svg { width: 200px; max-width: 100%; height: auto; }
.fx-gauge-v { font-size: 30px; font-weight: 800; margin-top: -46px; letter-spacing: -.5px; }
.fx-gauge-l { font-size: 12px; color: var(--t2); margin-top: 2px; }

/* Rota */
.fx-week { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; }
.fx-week + .fx-week { margin-top: 4px; }
.fx-week.now { background: rgba(224,155,107,.1); border-color: rgba(224,155,107,.35); }
.fx-week.mine { box-shadow: inset 3px 0 0 var(--ok); }
.fx-week-kw { width: 58px; font-size: 12px; font-weight: 800; color: var(--t2); flex-shrink: 0; }
.fx-week-n { flex: 1; font-size: 13px; font-weight: 600; color: var(--t1); min-width: 0; }
.fx-week-d { font-size: 11px; color: var(--t3); }

/* Alert banner inside a card */
.fx-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: rgba(110,150,230,.1); border: 1px solid rgba(110,150,230,.25); font-size: 12px; color: var(--t1); line-height: 1.5; }
.fx-alert.warn { background: rgba(224,155,107,.1); border-color: rgba(224,155,107,.3); }
.fx-alert.ok { background: rgba(90,200,106,.09); border-color: rgba(90,200,106,.28); }
.fx-alert b { font-weight: 700; }

/* Timeline */
.fx-tl { position: relative; padding-left: 22px; }
.fx-tl::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border2); }
.fx-tl-i { position: relative; padding: 0 0 14px; }
.fx-tl-i:last-child { padding-bottom: 0; }
.fx-tl-i::before { content: ''; position: absolute; left: -20px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--border2); }
.fx-tl-i.done::before { background: var(--ok); border-color: var(--ok); }
.fx-tl-i.cur::before { background: var(--goldd); border-color: var(--goldd); box-shadow: 0 0 0 4px rgba(200,146,58,.2); }
.fx-tl-t { font-size: 13px; font-weight: 600; color: var(--t1); }
.fx-tl-s { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* Slots */
.fx-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.fx-slot { border: 1px solid var(--border2); border-radius: 10px; padding: 9px 10px; background: var(--card2); color: var(--t1); font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; }
.fx-slot small { display: block; font-size: 11px; color: var(--t3); font-weight: 500; margin-top: 2px; }
.fx-slot:hover { border-color: var(--goldd); }
.fx-slot.sel { border-color: var(--ok); background: rgba(90,200,106,.1); }
.fx-slot.taken { opacity: .45; cursor: not-allowed; text-decoration: line-through; }

/* Tabs used inside feature pages */
.fx-tabs { display: flex; gap: 4px; background: var(--card2); border-radius: 10px; padding: 4px; margin-bottom: 14px; overflow-x: auto; }
.fx-tab { flex: 1; white-space: nowrap; text-align: center; padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--t2); cursor: pointer; border-radius: 8px; border: none; background: none; }
.fx-tab.on { background: var(--goldd); color: #1a0e00; }
.fx-tab .n { font-size: 10px; margin-left: 4px; opacity: .8; }

/* Photos */
.fx-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-photo { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--card2); border: 1px solid var(--border2); flex-shrink: 0; }
.fx-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-photo-stamp { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; font-weight: 700; color: #fff; background: rgba(0,0,0,.6); padding: 3px 5px; font-variant-numeric: tabular-nums; }
.fx-photo-add { display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--t3); font-size: 26px; }

/* Lines / statement table */
.fx-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.fx-lines td { padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--t1); vertical-align: middle; }
.fx-lines td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.fx-lines tr.tot td { border-bottom: none; font-weight: 800; padding-top: 12px; }

/* KPI tiles */
.fx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fx-kpi { background: var(--card2); border: 1px solid var(--border2); border-radius: 12px; padding: 12px; }
.fx-kpi-l { font-size: 11px; color: var(--t3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.fx-kpi-v { font-size: 20px; font-weight: 800; color: var(--t1); margin-top: 4px; font-variant-numeric: tabular-nums; }
.fx-kpi-s { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* Folders */
.fx-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fx-folder { background: var(--card2); border: 1px solid var(--border2); border-radius: 12px; padding: 14px; cursor: pointer; text-align: left; color: var(--t1); }
.fx-folder:hover, .fx-folder.on { border-color: var(--goldd); }
.fx-folder-n { font-size: 13px; font-weight: 700; margin-top: 8px; }
.fx-folder-c { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* Signature pad */
.fx-sig { width: 100%; height: 160px; background: #f6f3ee; border-radius: 10px; touch-action: none; cursor: crosshair; display: block; }
.fx-sig-img { height: 46px; background: #f6f3ee; border-radius: 6px; padding: 3px 8px; }

/* Occupancy bar (turnover) */
.fx-occ { display: flex; height: 30px; border-radius: 8px; overflow: hidden; font-size: 11px; font-weight: 700; }
.fx-occ > div { display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-occ .cur { background: rgba(90,200,106,.22); color: #8fe09b; }
.fx-occ .gap { background: rgba(224,80,80,.22); color: #ef9a9a; }
.fx-occ .next { background: rgba(110,150,230,.22); color: #b4c8f5; }

/* Units grid (building overview) */
.fx-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.fx-unit { border-radius: 10px; padding: 10px; background: var(--card2); border: 1px solid var(--border2); }
.fx-unit.occ { border-color: rgba(90,200,106,.35); }
.fx-unit.free { border-color: rgba(224,155,107,.45); }
.fx-unit.vac { border-color: rgba(224,80,80,.4); }
.fx-unit-n { font-size: 12px; font-weight: 700; color: var(--t1); }
.fx-unit-s { font-size: 11px; color: var(--t3); margin-top: 3px; }

/* Empty */
.fx-empty { text-align: center; padding: 34px 16px; }
.fx-empty-t { font-size: 14px; font-weight: 700; color: var(--t2); margin-bottom: 5px; }
.fx-empty-s { font-size: 12px; color: var(--t3); line-height: 1.6; max-width: 360px; margin: 0 auto; }

/* Chart container */
.fx-chart { position: relative; height: 200px; }

@media (max-width: 768px) {
  .fx-grid { grid-template-columns: 1fr; }
  .fx-picker { max-width: none; width: 100%; }
  .fx-head { align-items: stretch; }
}

/* ── Tenant profile: primary actions sit right under the name, removal is visible (not buried) ── */
.tm-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 12px 0 10px; }
.tm-actions button { font-size: 11.5px; padding: 8px 6px; justify-content: center; white-space: nowrap; }
.tm-actions .tm-remove { color: #e05050; border-color: rgba(224,80,80,.35); }
.tm-actions .tm-remove:hover { background: rgba(224,80,80,.1); }
@media (max-width: 420px) { .tm-actions { grid-template-columns: 1fr 1fr; } .tm-actions .tm-remove { grid-column: 1 / -1; } }
.t-row-rm { background: transparent; border: 1px solid rgba(224,80,80,.25); color: #e05050; border-radius: 6px; padding: 4px 8px; font-size: 10px; font-weight: 700; cursor: pointer; }
.t-row-rm:hover { background: rgba(224,80,80,.1); }

/* ── Sidebar: grouped sections, search, "soon" tag ── */
.nav-sec { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); padding: 12px 10px 4px; opacity: .75; }
.nav-jump { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 8px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border2); background: rgba(255,255,255,.03); color: var(--t3); font: inherit; font-size: 12px; cursor: pointer; transition: background .15s, color .15s; }
.nav-jump:hover { background: rgba(255,255,255,.06); color: var(--t1); }
.nav-jump span { flex: 1; text-align: left; }
.nav-jump kbd { font: inherit; font-size: 10px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border2); color: var(--t3); }
.ni-soon { font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-left: auto; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.07); color: var(--t3); }
#s-dash.sb-collapsed .sb .nav-sec { visibility: hidden; height: 6px; padding: 0; }
#s-dash.sb-collapsed .sb .nav-jump { justify-content: center; padding: 7px 0; }
#s-dash.sb-collapsed .sb .nav-jump span, #s-dash.sb-collapsed .sb .nav-jump kbd, #s-dash.sb-collapsed .sb .ni-soon { display: none; }

/* ── Quick jump palette ── */
.jump-ov { position: fixed; inset: 0; z-index: 2600; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.jump { width: min(560px, 100%); background: #191f1a; border: 1px solid var(--border2); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.jump input { background: transparent; border: none; border-bottom: 1px solid var(--border2); padding: 15px 18px; font: inherit; font-size: 15px; color: var(--t1); outline: none; }
.jump-list { overflow-y: auto; padding: 6px; }
.jump-row { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.jump-row.sel { background: rgba(200,146,58,.16); }
.jump-kind { flex: 0 0 64px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--t3); }
.jump-label { color: var(--t1); font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jump-sub { margin-left: auto; color: var(--t3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.jump-empty { padding: 18px; text-align: center; color: var(--t3); font-size: 13px; }
.jump-hint { border-top: 1px solid var(--border); padding: 8px 14px; font-size: 11px; color: var(--t3); }
@media (max-width: 600px) { .jump-ov { padding-top: 8vh; } .jump-kind { flex-basis: 54px; } .jump-sub { display: none; } }

/* Confirms/small dialogs open from inside other modals — always stack above them */
#fxModal.overlay { z-index: 2450; }

/* ── Line icons (js/icons.js) — replace every emoji in the app ── */
.ic { display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
.ui-dot { display: inline-block; width: .62em; height: .62em; border-radius: 50%; vertical-align: .02em; flex-shrink: 0; }
[data-ico] { display: inline-flex; vertical-align: -0.14em; }
.fx-alert > .ic { margin-top: 2px; }
.dl-empty-ico .ic, .cp-ico .ic { display: block; margin: 0 auto; }
/* Large placeholder icons (property cards without a photo, empty states) read as quiet artwork */
.pimg-bg .ic, .dlcard-img .ic, .dl-det-img .ic, .dl-empty-ico .ic { color: var(--t3); stroke-width: 1.4; }
.cp-ico .ic { color: var(--gold); }

/* ══ Phones & touch devices: drop effects that make scrolling stutter ══
   Frosted-glass blur re-blurs everything behind it on every scroll frame and the landing glow animates
   forever — both are expensive on phone GPUs. Solid surfaces look the same in this dark theme. */
@media (max-width: 900px), (hover: none) {
  *, *::before, *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  #mobile-nav, #mobile-nav-tenant { background: #0f1410 !important; }
  .abox { background: #1a211b !important; }
  .lc { background: #1c231d !important; }
  .af-modal.on > :last-child { background: #171d18 !important; }
  #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, #s-land .land-wrap::before { animation: none !important; filter: none !important; }
}
/* The iPhone address bar changes 100vh while scrolling, which made screens jump — use the visible height */
@supports (height: 100dvh) {
  .screen { height: 100dvh; }
  @media (max-width: 768px) { .screen.on, #s-dash, #s-tenant { min-height: 100dvh; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Lists are re-rendered on every live data update, so per-row entrance animations replayed constantly
   (cards and rows blinking whenever anything changed). Rows now just appear. */
.pgrid > .pc, .tgrid > .ti, .urow > .uc, .mrow, .mit, .rcard, .sccol > .sc { animation: none !important; }
/* Phones: no page-switch fade-in either — content shows immediately */
@media (max-width: 900px), (hover: none) {
  .pg.on > *, .abox, .land-wrap > * { animation: none !important; }
}

/* ── Typography: readable body text (Inter), display font only for titles; calmer weights ── */
body { font-weight: 400; -webkit-font-smoothing: antialiased; }
.ph-t, .a-title, .land-h1, .sb-bn, .land-logo-name, .gr-t, .mt2, #p-ai .ph-t { font-family: var(--font-display); }
b, strong, .sst, .an-t, .ubx-t { font-weight: 600; }
.ni { font-weight: 500; }
.ni.on { font-weight: 600; }
[style*="font-weight:800"], [style*="font-weight: 800"] { font-weight: 650 !important; }
[style*="font-weight:700"], [style*="font-weight: 700"] { font-weight: 600 !important; }
.sl, .sni, th { font-weight: 600; letter-spacing: .02em; }
.pay-h { font-size: 14px; font-weight: 600; color: var(--t1); margin: 8px 0 10px; }
.pay-h span { font-size: 12px; font-weight: 400; color: var(--t3); margin-left: 6px; }

/* ── App-wide: a button whose save is still running (js/guard.js) shows a spinner and takes no clicks ── */
.tn-busy { pointer-events: none !important; cursor: progress; opacity: .78; }
.tn-busy.tn-busy::after {
  content: ""; position: static; inset: auto; display: inline-block; width: .8em; height: .8em; margin-left: .5em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; background: none;
  transform: none; opacity: 1; animation: rot .6s linear infinite; vertical-align: -.1em;
}
