* { box-sizing: border-box; }
:root {
  --bg: #f4f6f8; --card: #fff; --line: #e3e8ee; --text: #1d2733; --dim: #64748b;
  --blue: #2563eb; --blue-soft: #eff4ff; --green: #16803c; --green-soft: #e8f7ee;
  --red: #b91c1c; --red-soft: #fdecec; --amber: #92600a; --amber-soft: #fdf3dd;
}
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.topbar { background: #14202e; position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; min-height: 52px; padding: 6px 0; }
.brand { color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand span { color: #8fa4bb; font-weight: 500; }
.brand:hover { text-decoration: none; }
.nav-collapse { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; flex: 1; min-width: 0; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  color: #b9c6d4; padding: 6px 12px; border-radius: 6px; white-space: nowrap;
}
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar nav a.on { background: #2a3b4f; color: #fff; }
.userbox { margin-left: auto; display: flex; gap: 10px; align-items: center; white-space: nowrap; }

/* mobile nav: collapse into a hamburger dropdown */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-collapse {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #14202e; padding: 6px 0 10px;
    box-shadow: 0 10px 26px rgba(0,0,0,.35);
    max-height: calc(100vh - 52px); overflow-y: auto;
  }
  .nav-collapse.open { display: flex; }
  .topbar nav { flex-direction: column; overflow: visible; gap: 0; }
  .topbar nav a { padding: 13px 22px; border-radius: 0; font-size: 15px; }
  .userbox { margin: 6px 22px 0; padding-top: 12px; border-top: 1px solid #2a3b4f; }
}
.userbox a { color: #b9c6d4; font-weight: 600; }
.userbox a:hover { color: #fff; text-decoration: none; }
.userbox button { background: none; border: 1px solid #3d5268; color: #b9c6d4; border-radius: 6px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 12.5px; }
.userbox button:hover { color: #fff; border-color: #b9c6d4; }
.loginwrap { display: flex; justify-content: center; padding-top: 8vh; }
.loginwrap .card { width: 340px; }

main { padding: 22px 20px 60px; }

/* headings & layout */
.pagehead { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; flex-wrap: wrap; }
.pagehead h1 { font-size: 20px; margin: 0; }
.pagehead .spacer { flex: 1; }
h2 { font-size: 15px; margin: 26px 0 10px; }
.muted { color: var(--dim); }
.small { font-size: 12.5px; }

/* cards & stats */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.stat .n { font-size: 22px; font-weight: 700; }
.stat .l { color: var(--dim); font-size: 12px; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
td.num, th.num { text-align: right; }
tr.group td { background: #edf1f6; font-weight: 700; font-size: 13px; }
tr.total td { background: #f8fafc; font-weight: 700; border-top: 2px solid var(--line); }
tr.noborder td { border-bottom: 0; }
tr.subinfo td { padding: 0 12px 8px; font-size: 12px; color: var(--dim); }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-active, .b-current, .b-ok { background: var(--green-soft); color: var(--green); }
.b-vacant, .b-declined { background: var(--red-soft); color: var(--red); }
.b-mtm, .b-holdover, .b-applicant, .b-approved { background: var(--amber-soft); color: var(--amber); }
.b-prospect { background: var(--blue-soft); color: var(--blue); }
.b-past, .b-ended { background: #eef0f3; color: var(--dim); }
.b-dnr { background: #7f1d1d; color: #fff; }
.b-hap { background: #ede9fe; color: #6d28d9; }
.b-corr { background: #ffedd5; color: #c2410c; }

/* buttons & forms */
.btn {
  display: inline-block; background: var(--blue); color: #fff; border: 0; cursor: pointer;
  padding: 7px 14px; border-radius: 7px; font-size: 13.5px; font-weight: 600; font-family: inherit;
}
.btn:hover { background: #1d4fd8; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid #c9d2dd; }
.btn.ghost:hover { background: #f4f6f8; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #eec7c7; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
form.inline { display: inline-flex; gap: 6px; align-items: center; }

.form { max-width: 560px; }
.form label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 4px; }
.form input[type=text], .form input[type=number], .form input[type=date],
.form input[type=email], .form select, .form textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c9d2dd; border-radius: 7px;
  font: inherit; background: #fff;
}
.form textarea { min-height: 70px; resize: vertical; }
.form .row { display: flex; gap: 12px; }
.form .row.person { margin-bottom: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.checks label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; margin: 2px 0; }
.form .row > div { flex: 1; }
.form .actions { margin-top: 20px; display: flex; gap: 10px; }
.checklist { max-height: 220px; overflow-y: auto; border: 1px solid #c9d2dd; border-radius: 7px; padding: 8px 10px; background: #fff; }
.checklist label { font-weight: 400; margin: 3px 0; display: flex; gap: 8px; align-items: center; }
input[type=date], input[type=checkbox] { accent-color: var(--blue); }

/* flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.error { background: var(--red-soft); color: var(--red); }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13px; }
.tabs a:hover { text-decoration: none; border-color: #b9c6d4; }
.tabs a.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* property blocks */
.prop { margin-bottom: 18px; }
.prop .prophead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.prop .prophead h3 { margin: 0; font-size: 15px; }

.searchbox { padding: 7px 12px; border: 1px solid #c9d2dd; border-radius: 7px; font: inherit; min-width: 220px; }

/* do-not-rent box on tenant form */
.dnrbox { border: 1px solid #eec7c7; background: var(--red-soft); border-radius: 8px; padding: 10px 12px; margin-top: 16px; }
.dnrbox input[type=text] { margin-top: 8px; }

/* attachments */
.attach-add { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.attach-add input[type=file] { font-size: 12.5px; }
.attachrow { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; margin-bottom: 6px; }
.attachrow a { overflow-wrap: anywhere; }
.attachrow span { margin-left: auto; white-space: nowrap; }
.attachrow .x { background: none; border: 0; color: #b6c0cc; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.attachrow .x:hover { color: var(--red); }

/* tenant activity log */
.lognote-add { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.lognote-add textarea { flex: 1; min-height: 42px; padding: 8px 10px; border: 1px solid #c9d2dd; border-radius: 7px; font: inherit; resize: vertical; }
.lognote { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin-bottom: 8px; }
.lognote-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.lognote .x { background: none; border: 0; color: #b6c0cc; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.lognote .x:hover { color: var(--red); }
.empty { color: var(--dim); padding: 26px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 10px; }

/* horizontal scroll for wide tables on small screens */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* tenant autocomplete (deposits) */
.autocomplete { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid #c9d2dd; border-radius: 8px; box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.14)); max-height: 280px; overflow-y: auto; margin-top: 3px; }
.ac-item { padding: 11px 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item:active { background: var(--blue-soft); }

/* payment-method segmented buttons */
.segmented { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #c9d2dd; border-radius: 8px; padding: 9px 14px; cursor: pointer; font-weight: 500; }
.segmented input { accent-color: var(--blue); }

/* "accepted by" highlight on a deposit */
.acceptedby { background: var(--blue-soft); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }

/* proof / photo capture buttons */
.proof { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.proof-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--blue); color: #fff; padding: 11px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; }
.proof-btn.ghost { background: #fff; color: var(--text); border: 1px solid #c9d2dd; }
.proofcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 10px; }
.proofcard img { max-width: 100%; display: block; border-radius: 7px; border: 1px solid var(--line); }
.proofcard-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding: 0 2px; }
.proofcard .x { background: none; border: 0; color: #b6c0cc; cursor: pointer; font-size: 16px; line-height: 1; }
.proofcard .x:hover { color: var(--red); }

/* mobile friendliness */
@media (max-width: 640px) {
  .form input, .form select, .form textarea, .searchbox { font-size: 16px; }  /* stops iOS zoom-on-focus */
  .form .row { flex-direction: column; gap: 0; }
  .pagehead h1 { font-size: 18px; }
  .proof-btn { flex: 1; justify-content: center; }
}

/* tenant-left popover — fixed mini-modal so table/card overflow can't clip it */
details.tleft { display: inline-block; }
details.tleft > summary { list-style: none; cursor: pointer; }
details.tleft > summary::-webkit-details-marker { display: none; }
details.tleft[open] > summary::before {
  content: ""; position: fixed; inset: 0; z-index: 59; background: rgba(20,32,46,.35);
}
.tleft-form {
  position: fixed; left: 50%; top: 14vh; transform: translateX(-50%); z-index: 60;
  width: min(340px, calc(100vw - 28px));
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; box-shadow: 0 12px 34px rgba(20,32,46,.25);
  display: flex; flex-direction: column; gap: 9px; text-align: left;
}
.tleft-form label { display: flex; flex-direction: column; gap: 3px;
  font-size: 12px; color: var(--dim); }
.tleft-form select, .tleft-form input {
  padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; color: var(--text); background: #fff; }
.tleft-form .btn { width: 100%; }

/* eviction flowchart */
.eprogress { height: 8px; background: var(--line); border-radius: 5px; overflow: hidden; min-width: 90px; }
.eprogress-bar { height: 100%; background: var(--green); border-radius: 5px; transition: width .3s; }
.eflow { max-width: 640px; }
.estep { background: var(--card); border: 2px solid var(--line); border-radius: 10px;
  padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; align-items: center; }
.estep-head { display: flex; gap: 10px; align-items: flex-start; min-width: 220px; flex: 1; }
.estep-mark { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.estep.done { border-color: var(--green); background: var(--green-soft); }
.estep.done .estep-mark { color: var(--green); font-weight: 700; }
.edone-date { color: var(--green); font-weight: 600; }
.estep.na { opacity: .55; }
.estep.na strong { text-decoration: line-through; }
.estep.current { border-color: var(--amber); background: var(--amber-soft);
  animation: epulse 1.6s ease-in-out infinite; }
.estep.current .estep-mark { color: var(--amber); }
@keyframes epulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,144,10,.35); }
  50% { box-shadow: 0 0 0 6px rgba(217,144,10,.12); }
}
.estep.pending { color: var(--dim); }
.econn { width: 2px; height: 18px; background: #c6cfda; margin-left: 32px; }
.eexit { margin: 6px 0 0 32px; color: var(--dim); border-left: 2px dashed #c6cfda; padding-left: 10px; }
.esplit { font-weight: 600; margin: 4px 0 8px 12px; }
.ebranch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ebranch-title { margin-bottom: 6px; margin-left: 4px; }
.ehex { background: #dff2e4; border: 2px solid var(--green); color: var(--green);
  font-weight: 700; text-align: center; padding: 14px 10px; border-radius: 12px; }
.ehex.lost { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.ehex.won { box-shadow: 0 0 0 3px rgba(22,128,60,.25); }
.ehex.active { box-shadow: 0 0 0 3px rgba(185,28,28,.25); }
.ehex-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inlinectl { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inlinectl input[type=date] { padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.inlinectl .ctl-note { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; width: 90px; }
@media (max-width: 700px) {
  .ebranch { grid-template-columns: 1fr; }
  .ehex-row { grid-template-columns: 1fr 1fr; }
}
.b-evict { background: var(--red-soft); color: var(--red); border: 1px solid #eec7c7; }
a.statlink { text-decoration: none; color: inherit; display: block; }
a.statlink:hover { border-color: var(--blue); }
a.statlink .n { color: var(--red); }

/* vacancies filter bar */
.filterbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 14px; }
.filterbar label { display: flex; flex-direction: column; gap: 3px;
  font-size: 12px; color: var(--dim); }
.filterbar select, .filterbar input {
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; color: var(--text); background: #fff; min-width: 90px; }
.filterbar input[type=number] { width: 96px; }
@media (max-width: 640px) {
  .filterbar label { flex: 1 1 44%; }
  .filterbar select, .filterbar input { font-size: 16px; width: 100%; }
}
.estep-file { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.estep-attach { color: var(--blue); cursor: pointer; display: inline-block; margin-top: 4px; }
.estep-attach:hover { text-decoration: underline; }

/* tasks */
.tasklist { padding: 8px 12px; }
.taskrow { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0;
  border-bottom: 1px solid var(--line); }
.tasklist .taskrow:last-child, .card .taskrow:last-child { border-bottom: 0; }
.taskcheck { background: none; border: 0; font-size: 19px; cursor: pointer;
  color: var(--blue); padding: 0 2px; line-height: 1.3; }
.taskrow.tdone .tasktitle { text-decoration: line-through; color: var(--dim); }
.tasktitle { font-weight: 600; }
.checkgrid { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checkitem { display: flex; gap: 6px; align-items: center; font-size: 13px;
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; cursor: pointer; }
.checkitem:has(input:checked) { background: var(--blue-soft); border-color: var(--blue); }
.pagehead .btn.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.b-type { background: var(--blue-soft); color: var(--blue); }
.typefilter { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.rolegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 20px; }
.ttypeperms { margin: 8px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--line);
  display: flex; flex-direction: column; gap: 3px; }
.ttypeperms label { display: flex; gap: 6px; align-items: center; }
.mutest { color: #9aa8b8; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sortable[data-dir="asc"]::after { content: " ▲"; font-size: 9px; }
th.sortable[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }

/* rent roll / vacancies inline controls */
select.renosel { font-size: 12px; padding: 2px 4px; max-width: 150px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; color: var(--dim); cursor: pointer; }
select.renosel:hover, select.renosel:focus { border-color: var(--line); background: var(--card); }
select.renosel.renoset { color: #9a5b00; background: #fff7ed; border-color: #fed7aa; font-weight: 600; }
input.mktin { width: 82px; text-align: right; font-size: 13px; padding: 2px 6px;
  border: 1px dashed transparent; border-radius: 6px; background: transparent; color: inherit; }
input.mktin:hover { border-color: var(--line); }
input.mktin:focus { border-color: #94a3b8; background: var(--card); outline: none; }
.statusctl { display: inline-flex; }
.nowrap { white-space: nowrap; }

/* payments: + add-attachment button */
.attach-plus { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--blue);
  color: var(--blue); background: var(--blue-soft); cursor: pointer;
  font-size: 15px; font-weight: 700; line-height: 1; vertical-align: middle; margin-left: 4px; }
.attach-plus:hover { background: var(--blue); color: #fff; }

/* payments: inline bank-deposit inputs + detail card */
input.bankin { font-size: 12px; padding: 2px 5px; border: 1px dashed transparent;
  border-radius: 6px; background: transparent; color: inherit; }
input.bankin:hover { border-color: var(--line); }
input.bankin:focus { border-color: #94a3b8; background: var(--card); outline: none; }
.bankcard { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0;
  padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.bankcard label { display: inline-flex; align-items: center; gap: 5px; }
.bankcard input { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

/* cleaning list: due date + assignee controls */
.cleanctl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 5px; }
.duebox { display: inline-flex; align-items: center; gap: 6px; }
.duebox input[type=date] { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.duebox input.overdue { border-color: var(--red); color: var(--red); }
.assignbox { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.asgchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  background: var(--blue-soft); color: var(--blue); border-radius: 12px; padding: 1px 4px 1px 8px; }
.asgchip .x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 14px;
  line-height: 1; padding: 0 2px; opacity: .7; }
.asgchip .x:hover { opacity: 1; }
.assign-ac { min-width: 130px; }
.assign-ac .assign-search { font-size: 12px; padding: 3px 8px; border: 1px dashed var(--line);
  border-radius: 12px; background: transparent; width: 120px; }
.assign-ac .assign-search:focus { border-style: solid; border-color: #94a3b8; outline: none; }

/* receipts: duplicate-match cards */
.dupmatch { display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-top: 1px solid rgba(0,0,0,.08); margin-top: 8px; flex-wrap: wrap; }
.dupthumb img { height: 54px; width: auto; max-width: 80px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); display: block; }
.dupinfo { flex: 1; min-width: 160px; }
.dupactions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dupactions form { display: inline; }
.newtype-in { margin-top: 6px; }

/* receipts: per-column filter row */
tr.filterrow td { padding: 3px 6px; background: #f8fafc; border-bottom: 1px solid var(--line); }
tr.filterrow input, tr.filterrow select { width: 100%; box-sizing: border-box; font-size: 12px;
  padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
tr.filterrow input::placeholder { color: #b6c0cc; }

/* receipts: paid-out-of-pocket toggle */
.oop-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 0; font-weight: 600; }
.oop-check input { width: 17px; height: 17px; cursor: pointer; }

/* unit notes & photos */
.unitnote-add textarea { width: 100%; min-height: 60px; padding: 8px 10px; border: 1px solid #c9d2dd;
  border-radius: 7px; font: inherit; resize: vertical; margin-bottom: 8px; box-sizing: border-box; }
.notefiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.notefile { position: relative; display: inline-flex; }
.notefile img { height: 100px; width: auto; max-width: 170px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); display: block; }
.notefile .notefile-doc { display: inline-block; padding: 10px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; }
.notefile form { position: absolute; top: 3px; right: 3px; }
.notefile .x { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 50%;
  width: 20px; height: 20px; line-height: 1; font-size: 14px; color: var(--dim); cursor: pointer; padding: 0; }
.notefile .x:hover { color: var(--red); }
.noteattach { margin-top: 8px; }

/* bulk-edit bar + selection column */
.bulkbar:not([hidden]) { display: flex; }
.bulkbar { align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 5; }
.bulkbar label { display: flex; align-items: center; gap: 6px; }
.bulkbar select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
td.selcol, th.selcol { text-align: center; width: 34px; }
td.selcol input, th.selcol input { width: 16px; height: 16px; cursor: pointer; }

/* unit status badges */
.b-reno-pending  { background: #fff7ed; color: #9a5b00; }
.b-reno-progress { background: #ffedd5; color: #9a3412; }
.b-to-clean      { background: #e0f2fe; color: #075985; }
.b-land          { background: #ecfccb; color: #3f6212; }

/* properties table: fixed layout so every building's columns line up
   (min-width lets narrow screens scroll inside .tablewrap instead of cramming) */
.proptable { table-layout: fixed; width: 100%; min-width: 840px; }
.proptable td, .proptable th { overflow-wrap: anywhere; }
.uchip { display: inline-block; font-size: 11px; line-height: 1.5; padding: 0 6px; margin: 1px 2px 1px 0;
  border-radius: 10px; background: var(--green-soft); color: var(--green); white-space: nowrap; }

/* furnished cell with hover/click details */
.furn-detail { cursor: help; position: relative; border-bottom: 1px dotted var(--dim); outline: none; }
.furn-pop { display: none; position: absolute; left: 0; top: 100%; z-index: 20; margin-top: 3px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  width: max-content; max-width: 240px; box-shadow: 0 4px 14px rgba(0,0,0,.14);
  font-weight: 400; white-space: normal; color: var(--text); }
.furn-detail:hover .furn-pop, .furn-detail:focus .furn-pop, .furn-detail.open .furn-pop { display: block; }

/* petty-cash: negative amounts (cash paid out) read as red */
.negamt, .negamt .bankin { color: #b3261e; }

/* materials list + 3rd-party vendor tasks */
.b-pending { background: #dbeafe; color: #1d4ed8; }
td span.overdue { color: var(--red); font-weight: 600; }

/* receipt upload drop zone (drag & drop OR click to browse) */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #fafbfc;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--blue); background: var(--blue-soft); }
.dropzone.drag { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 3px rgba(37,99,235,.12); }
.dropzone.has-file { border-style: solid; cursor: default; background: #fff; }
.dz-ic { font-size: 30px; line-height: 1; margin-bottom: 6px; }
.dz-head { font-weight: 600; }
.dz-cam { margin-top: 12px; }
.dz-filled { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.dz-thumb { max-height: 96px; max-width: 160px; border-radius: 8px; border: 1px solid var(--line); }
.dz-fileic { font-size: 34px; }
.dz-name { font-weight: 600; word-break: break-all; }
.dz-x {
  border: 1px solid var(--line); background: #fff; color: var(--dim);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 13px;
}
.dz-x:hover { border-color: #dc2626; color: #dc2626; }

/* YT Receipts: drag-and-drop intake zone */
.dropzone {
  border: 2px dashed #c9d2dd; border-radius: 10px; padding: 16px 18px;
  text-align: center; background: var(--card); cursor: pointer; margin-bottom: 4px;
  transition: border-color .12s, background .12s;
}
.dropzone:hover { border-color: #b9c6d4; }
.dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }

/* YT Receipts: list filter row + inline patient dropdown */
tr.filterrow td { padding: 4px 8px; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.rf { width: 100%; padding: 4px 6px; border: 1px solid #d4dbe4; border-radius: 6px;
      font: inherit; font-size: 12px; background: #fff; }
.rf.num { text-align: right; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th[data-dir="asc"]::after  { content: " ▲"; font-size: 9px; }
th[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }
.inline-sel { padding: 3px 6px; border: 1px solid #c9d2dd; border-radius: 6px;
              font: inherit; font-size: 12.5px; background: #fff; max-width: 150px; }
