/* TR PM — shared detail panel styles (Rentvine-style right-side slide-over) */
.trp-overlay {
  position: fixed; inset: 0; background: rgba(4,6,10,0.55);
  opacity: 0; pointer-events: none; transition: opacity .22s ease; z-index: 998;
  backdrop-filter: blur(2px);
}
.trp-overlay.open { opacity: 1; pointer-events: auto; }

.trp-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw;
  background: linear-gradient(180deg, #14161b 0%, #0e0f13 100%);
  border-left: 1px solid rgba(255,255,255,0.12);
  box-shadow: -16px 0 48px rgba(0,0,0,0.5);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  z-index: 999; display: flex; flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: #eef3f8;
}
.trp-panel.open { transform: translateX(0); }

.trp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}
.trp-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.trp-close {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  color: #dbe6f0; width: 32px; height: 32px; border-radius: 9px; font-size: 20px;
  line-height: 1; cursor: pointer; flex-shrink: 0;
}
.trp-close:hover { background: rgba(255,255,255,0.16); }

.trp-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.trp-loading, .trp-error { padding: 30px 4px; color: #8aa0b3; font-size: 13.5px; }
.trp-error { color: #f59e0b; }
.trp-muted { color: #8aa0b3; font-size: 13px; padding: 4px 0; }

.trp-sec { margin-bottom: 20px; }
.trp-sec-title {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #a5b4fc; margin-bottom: 9px;
}
.trp-row {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 13.5px;
}
.trp-row:last-child { border-bottom: none; }
.trp-k { color: #8aa0b3; font-weight: 600; flex-shrink: 0; }
.trp-v { color: #eef3f8; font-weight: 600; text-align: right; }

.trp-issue {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 13px 15px; font-size: 13.5px; line-height: 1.5; color: #dbe6f0;
}
.trp-meta-line { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.trp-chip {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  background: rgba(255,255,255,0.08); color: #c2d0dd; border: 1px solid rgba(255,255,255,0.12);
}
.trp-chip.good { background: rgba(16,185,129,0.14); color: #10b981; border-color: rgba(16,185,129,0.3); }
.trp-chip.bad { background: rgba(239,68,68,0.14); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.trp-chip.acc { background: rgba(129,140,248,0.16); color: #a5b4fc; border-color: rgba(129,140,248,0.35); }
.trp-chip.muted { background: rgba(255,255,255,0.06); color: #8aa0b3; }
.trp-chip.status { background: rgba(34,211,238,0.12); color: #22d3ee; border-color: rgba(34,211,238,0.3); }

.trp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.trp-photos img {
  width: 100%; height: 96px; object-fit: cover; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12); cursor: pointer; transition: transform .12s;
}
.trp-photos img:hover { transform: scale(1.03); }

/* clickable rows on list pages get a pointer */
.trp-clickable { cursor: pointer; }

/* --- Portfolio panel: properties + expandable units --- */
.trp-clickable:hover { background: rgba(129,140,248,0.08); border-radius: 8px; }
.trp-prop { margin-bottom: 4px; }
.trp-units { margin: 2px 0 8px 14px; border-left: 2px solid rgba(129,140,248,0.25); padding-left: 10px; }
.trp-unit-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 4px; font-size: 12.5px; color: #b8c5d2; gap: 8px; }
.trp-unit-row span:first-child { font-weight: 600; color: #dbe6f0; }


/* ---- Ledger / Rent Roll section (QuickBooks-backed) --------------------- */
.trp-ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.trp-refresh-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #2c6e49;
  background: #eafaf1;
  color: #1d5635;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease;
}
.trp-refresh-btn:hover { background: #d6f3e3; }
.trp-refresh-btn:active { transform: translateY(1px); }

.trp-qbo-banner {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  margin: 6px 0 10px;
  line-height: 1.4;
}
.trp-qbo-acc  { background: #fff6e6; color: #8a5a00; border: 1px solid #f0d8a8; }
.trp-qbo-good { background: #eafaf1; color: #1d5635; border: 1px solid #b6e6cb; }
.trp-qbo-bad  { background: #fdecec; color: #8a1f1f; border: 1px solid #f3c0c0; }

/* QuickBooks connection light — green dot = connected, red = offline. */
.trp-qbo-light {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  margin: 4px 0 10px;
  color: var(--muted, #6b7280);
}
.trp-qbo-light .trp-qbo-label { font-weight: 600; color: inherit; }
.trp-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; flex: 0 0 auto;
}
.trp-dot-good { background: #21c277; box-shadow: 0 0 0 3px rgba(33,194,119,0.18); }
.trp-dot-bad  { background: #e2453d; box-shadow: 0 0 0 3px rgba(226,69,61,0.18); }

.trp-amt-pos { color: #1d5635; font-weight: 600; }
.trp-amt-neg { color: #b23b3b; font-weight: 600; }


/* ---- Documents / Files section ----------------------------------------- */
.trp-docs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.trp-docs-head > span:first-child {
  font-weight: 700;
  white-space: nowrap;
}
.trp-docs-headtools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* unified pill styling for all three header buttons */
.trp-rollup-btn, .trp-newfolder-btn, .trp-upload-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #cdd9e2;
  background: #eef3f7;
  color: #0a3a52;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.3;
}
.trp-rollup-btn:hover, .trp-newfolder-btn:hover, .trp-upload-btn:hover { background: #dceaf3; }
/* + Upload is the primary action — make it stand out a touch */
.trp-upload-btn { border-color: #063a53; background: #063a53; color: #fff; }
.trp-upload-btn:hover { background: #0a4a68; }
/* roll-up active state */
.trp-rollup-btn.on { background: #e7defb; border-color: #b9a4ef; color: #4a2f9e; }

/* folder filter bar */
.trp-folderbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.trp-folderbar:empty { margin: 0; }
.trp-fchip {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid #d4dce2; background: #f5f8fa; color: #4a6072; cursor: pointer; white-space: nowrap;
}
.trp-fchip:hover { background: #e9f0f5; }
.trp-fchip.on { background: #063a53; border-color: #063a53; color: #fff; }

/* roll-up source tags on a doc card */
.trp-doc-src {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: #e7defb; color: #4a2f9e; margin-left: 6px; white-space: nowrap;
}
.trp-doc-also {
  font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 999px;
  background: #eef3f7; color: #5a7387; margin-left: 4px; white-space: nowrap;
}

.trp-upload-btn:hover { background: #0a4a68; }
.trp-docs-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0 10px;
  padding: 8px;
  background: #f6f8fa;
  border-radius: 8px;
}
.trp-docs-form input[type="text"] {
  flex: 1 1 140px;
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid #d4dce2;
  border-radius: 6px;
}
.trp-docs-form input[type="file"] { font-size: 11px; flex: 1 1 160px; }
.trp-doc-save {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: #063a53;
  color: #fff;
  cursor: pointer;
}
.trp-doc-status { flex-basis: 100%; font-size: 11px; color: #8a5a00; }
.trp-doc-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 1px 6px;
  border-radius: 4px;
  background: #eaf2f8;
  color: #063a53;
  margin-right: 4px;
}
.trp-doc-row a { color: #063a53; text-decoration: none; font-weight: 500; }
.trp-doc-row a:hover { text-decoration: underline; }
.trp-doc-del {
  border: none;
  background: transparent;
  color: #b23b3b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.trp-doc-del:hover { color: #8a1f1f; }

/* ---- Clean document cards (RentVine migration + uploads) ---------------- */
.trp-docs-body { display: flex; flex-direction: column; gap: 8px; }
.trp-doc-card {
  display: flex; align-items: center; gap: 8px;
  background: #f7fafc; border: 1px solid #e2ebf2; border-radius: 10px;
  padding: 4px 6px 4px 4px; transition: border-color .12s ease, box-shadow .12s ease;
}
.trp-doc-card:hover { border-color: #b9d4e6; box-shadow: 0 2px 8px rgba(6,58,83,.08); }
.trp-doc-open {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  background: transparent; border: none; cursor: pointer;
  text-align: left; padding: 7px 8px; border-radius: 8px;
  font: inherit; color: #063a53;
}
.trp-doc-open:hover { background: #eaf2f8; }
.trp-doc-ico { font-size: 16px; line-height: 1; flex: 0 0 auto; }
.trp-doc-name {
  font-size: 13.5px; font-weight: 600; color: #0a3a52;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.trp-doc-meta { font-size: 11px; color: #7c93a4; margin-left: auto; padding-left: 8px; flex: 0 0 auto; white-space: nowrap; }
.trp-doc-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.trp-doc-act {
  border: none; background: transparent; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 6px 6px; border-radius: 7px;
  opacity: .55; transition: opacity .12s ease, background .12s ease;
}
.trp-doc-card:hover .trp-doc-act { opacity: .9; }
.trp-doc-act:hover { background: #e3edf4; opacity: 1; }
.trp-doc-del:hover { background: #fbe6e6; }

/* ---- In-panel document viewer modal ------------------------------------- */
.trp-dv-overlay {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(8,16,24,.62); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s ease; padding: 28px;
}
.trp-dv-overlay.open { display: flex; opacity: 1; }
.trp-dv-box {
  background: #fff; border-radius: 14px; width: min(980px, 94vw); height: min(88vh, 1100px);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.trp-dv-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid #e7eef4; background: #f7fafc;
}
.trp-dv-title { font-size: 14px; font-weight: 700; color: #0a3a52; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trp-dv-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.trp-dv-print, .trp-dv-download, .trp-dv-close {
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  border: 1px solid #d4e2ec; background: #fff; color: #0a3a52;
  padding: 7px 11px; border-radius: 9px; text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
}
.trp-dv-print:hover, .trp-dv-download:hover { background: #eaf2f8; }
.trp-dv-close { border-color: #e7c4c4; color: #8a1f1f; }
.trp-dv-close:hover { background: #fbe6e6; }
.trp-dv-body { flex: 1 1 auto; min-height: 0; background: #525659; display: flex; align-items: center; justify-content: center; }
.trp-dv-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.trp-dv-body img { max-width: 100%; max-height: 100%; object-fit: contain; }


/* ---- Lease / Property lifecycle action buttons -------------------------- */
.trp-action-row { display:flex; flex-wrap:wrap; gap:8px; margin:4px 0 6px; }
.trp-act-btn {
  font-size:12.5px; font-weight:700; padding:8px 14px; border-radius:10px;
  border:1px solid #063a53; background:#eaf2f8; color:#063a53; cursor:pointer;
}
.trp-act-btn:hover { background:#d8e8f3; }
.trp-act-btn.act-moveout { border-color:#b26a00; background:#fff6e6; color:#8a5a00; }
.trp-act-btn.act-moveout:hover { background:#ffedcc; }
.trp-act-btn.act-movein { border-color:#2c6e49; background:#eafaf1; color:#1d5635; }
.trp-act-btn.act-movein:hover { background:#d6f3e3; }
.trp-act-status { font-size:12px; margin-top:6px; min-height:15px; font-weight:600; }

/* ---- Inline edit forms (Property / Owner / Lease editors) --------------- */
.trp-edit-sec { margin-top:6px; }
.trp-edit-form { margin-top:8px; }
.trp-ef-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px 14px; }
.trp-ef-row { display:flex; flex-direction:column; gap:4px; font-size:11.5px; font-weight:700;
  letter-spacing:.02em; color:#5a7184; text-transform:uppercase; }
.trp-ef-row span { line-height:1.2; }
.trp-ef-row input, .trp-ef-row select {
  font-size:13.5px; font-weight:500; padding:8px 10px; border-radius:8px;
  border:1px solid #c4d3df; background:#fff; color:#0a2a3a; text-transform:none; letter-spacing:0;
  font-family:inherit; width:100%; }
.trp-ef-row input:focus, .trp-ef-row select:focus { outline:none; border-color:#0a5376; box-shadow:0 0 0 2px rgba(10,83,118,.15); }
.trp-edit-form .act-edit-toggle { width:auto; }
@media (max-width:520px){ .trp-ef-grid { grid-template-columns:1fr; } }

/* ---- "Send to…" document routing modal --------------------------------- */
.trp-send-overlay {
  position: fixed; inset: 0; z-index: 4100;
  background: rgba(8,16,24,.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 28px;
}
.trp-send-overlay.open { display: flex; }
.trp-send-box {
  background: #fff; border-radius: 14px; width: min(440px, 94vw);
  padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.4); color: #0a2a3a;
}
.trp-send-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 800; color: #0a3a52; }
.trp-send-x { border: none; background: transparent; font-size: 16px; cursor: pointer; color: #6a8094; }
.trp-send-doc { font-size: 12.5px; color: #4a6072; margin: 10px 0 14px; }
.trp-send-doc b { color: #0a3a52; }
.trp-send-lbl { display: block; font-size: 11px; font-weight: 700; color: #4a6072; margin: 10px 0 4px; }
.trp-send-dest, .trp-send-folder {
  width: 100%; font-size: 13px; padding: 9px 10px; border-radius: 9px;
  border: 1px solid #cdd9e2; background: #f7fafc; color: #0a2a3a; font-family: inherit;
}
.trp-send-hint { font-size: 11px; color: #7c93a4; margin-top: 10px; line-height: 1.4; }
.trp-send-status { font-size: 12px; font-weight: 700; color: #2c6e49; margin-top: 8px; min-height: 14px; }
.trp-send-foot { display: flex; gap: 8px; margin-top: 14px; }
.trp-send-go {
  flex: 1; font-size: 13px; font-weight: 800; padding: 10px; border-radius: 10px;
  border: none; background: #063a53; color: #fff; cursor: pointer;
}
.trp-send-go:hover { background: #0a4a68; }
.trp-send-cancel {
  font-size: 13px; font-weight: 700; padding: 10px 14px; border-radius: 10px;
  border: 1px solid #cdd9e2; background: #fff; color: #4a6072; cursor: pointer;
}
.trp-send-cancel:hover { background: #f0f4f7; }

