/* Upgrade 2026-10 – area "portal": tenant portal (portal, accounts, notices, feedback, document verification + requests). Tokens from theme.css only; no all-caps labels, no thick coloured left borders. */

/* tabs with icons (portal + landlord portal page) */
.pt-tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.pt-tabs .icon { width: 16px; height: 16px; }

/* overview grid + key/value lists */
.pt-kpis { margin-bottom: var(--gap); }
.pt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.pt-grid > .card { min-width: 0; }
@media (max-width: 900px) { .pt-grid { grid-template-columns: minmax(0, 1fr); } }
.pt-kv { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 8px 14px; margin: 0; }
.pt-kv dt { color: var(--text-2); font-size: var(--fs-sm); }
.pt-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pt-kv dd.num { text-align: right; font-variant-numeric: tabular-nums; }
.pt-bank { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2, var(--bg)); border: 1px solid var(--border); overflow-wrap: anywhere; }
.pt-bank .num { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.pt-link { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none !important; min-height: 44px; }
.pt-link:hover { background: var(--surface-2, var(--bg)); }
.pt-link > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pt-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-cert { gap: 8px; margin-bottom: 12px; align-items: center; }

/* lists */
.pt-notices li, .pt-fb li, .pa-notices li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.pt-notices li:last-child, .pt-fb li:last-child, .pa-notices li:last-child { border-bottom: 0; }
.pt-reqs li a { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; min-height: 44px; }
.pt-reqs li:last-child a { border-bottom: 0; }
.pt-req-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pt-reply { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2, var(--bg)); border: 1px solid var(--border); }
.pt-msgs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.pt-msgs li { padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); max-width: 90%; }
.pt-msgs li.own { align-self: flex-end; background: var(--surface-2, var(--bg)); }
.pt-msgs li p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* stars + rating inputs */
.pt-stars { display: inline-flex; gap: 1px; color: var(--text-3, #9aa5a1); }
.pt-stars .icon.on { color: var(--st-open); fill: currentColor; }
.pt-rate { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.pt-rate legend { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 4px; width: 100%; }
.pt-rate label { cursor: pointer; }
.pt-rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pt-rate label > span { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 10px; color: var(--text-3, #9aa5a1); }
.pt-rate label > span .icon { width: 24px; height: 24px; }
.pt-rate input:focus-visible + span { outline: 2px solid var(--primary); }
.pt-rate label:has(~ label input:checked) > span, .pt-rate label:has(input:checked) > span { color: var(--st-open); }
.pt-rate label:has(~ label input:checked) > span .icon, .pt-rate label:has(input:checked) > span .icon { fill: currentColor; }
.pt-aspects { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

/* photo thumbnails */
.pt-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pt-thumb { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); display: block; }
.pt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-thumb .btn { position: absolute; top: 2px; right: 2px; background: var(--surface); }

/* tags + document flags (documents section, central documents page) */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs, 12px); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.tag .icon { width: 13px; height: 13px; }
.tag-share { color: var(--primary); border-color: currentColor; }
.tag-warn { color: var(--st-open); border-color: currentColor; }
.doc-flags { gap: 6px; margin-top: 4px; align-items: center; }
.doc-acts .btn.on { color: var(--primary); }

/* tenant page card */
.pc-acc, .pc-docs { gap: 8px; align-items: center; }
.pc-reqs li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pc-reqs li:last-child { border-bottom: 0; }
.pc-reqs li > span:first-child { min-width: 0; flex: 1 1 220px; }

/* login: four demo buttons wrap on phones */
.lp-demo-more { flex-wrap: wrap; }
.lp-demo-more .btn { flex: 1 1 calc(50% - 8px); }

/* phone: stacked tables of the portal */
@media (max-width: 640px) {
  .pt-pay thead, .pa-acc thead { display: none; }
  .pt-pay tr, .pa-acc tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .pt-pay td, .pa-acc td { border: 0 !important; padding: 0 !important; text-align: left !important; }
  .pt-pay td[data-l]::before, .pa-acc td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; color: var(--text-2); }
  .pt-pay td:last-child, .pa-acc td:last-child { grid-column: 1 / -1; }
  .pt-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pt-kv dd { margin-bottom: 8px; }
  .pt-kv dd.num { text-align: left; }
}

/* follow-up 2026-10: simple electronic signature (pad, signer list, portal dialog) */
.sig-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sig-label { font-weight: 650; font-size: var(--fs-sm); color: var(--text-2); }
.sig-pad { position: relative; height: 190px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; touch-action: none; }
.sig-pad canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; z-index: 2; }
.sig-line { position: absolute; left: 18px; right: 18px; bottom: 44px; border-bottom: 1.5px dashed #cbd5e1; }
.sig-ph { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #94a3b8; font-size: var(--fs-xs); pointer-events: none; transition: opacity .15s; }
.sig.signed .sig-ph { opacity: 0; }
.sig.signed .sig-pad { border-color: var(--st-done); }
.sg-list { display: flex; flex-direction: column; gap: 8px; }
.sg-list .sg-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.sg-row.done { background: var(--surface-2); }
.sg-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.sg-img { height: 44px; max-width: 180px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 6px; }
.sg-acts { gap: 8px; }
.sg-verify { display: flex; align-items: flex-start; gap: 6px; margin: 0; } .sg-verify .icon { flex: none; margin-top: 2px; }
.sg-verify.ok { color: var(--st-done); } .sg-verify.bad { color: var(--st-bad); }
.sg-hist summary { cursor: pointer; min-height: 32px; }
.sign-dlg code, [data-sign-card] code { font-size: 11px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .sig-pad { height: 170px; } .sg-row .btn { width: 100%; justify-content: center; } }
