/* =====================================================================
   Building Portfolio — building-portfolio.css
   Scope: .pdbp-wrap  |  All pdlp-* / pdc-* utilities duplicated here
   (landlord-portfolio.css / unit-portfolio.css do not load on building pages)
   Pattern: matches unit-portfolio.css tab/section/panel style exactly
   ===================================================================== */

/* ---- Reset & container ---- */
.pdbp-wrap *, .pdbp-wrap *::before, .pdbp-wrap *::after { box-sizing: border-box; }
.pdbp-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1f2937; }

/* ---- Tab bar — boxed style matching unit/tenant/landlord ---- */
.pdbp-wrap .pdc-tabbar {
  display: flex; gap: 0; margin-bottom: 0;
  border: 1px solid #dee2e6; border-radius: 6px 6px 0 0;
  overflow: hidden; background: #f1f3f5;
}
.pdbp-wrap .pdc-tabn {
  flex: 1; display: inline-block;
  padding: 14px 22px; font-size: 14px; font-weight: 500; color: #2e8b57;
  text-decoration: none !important; cursor: pointer; text-align: center;
  border-bottom: 3px solid transparent; border-right: 1px solid #dee2e6;
  background: #f1f3f5; transition: color .15s, background .15s;
}
.pdbp-wrap .pdc-tabn:last-child { border-right: none; }
.pdbp-wrap .pdc-tabn:hover { color: #267a4c; background: #e9ecef; }
.pdbp-wrap .pdc-tabn-on,
.pdbp-wrap .pdc-tabn-on:hover {
  color: #2e8b57 !important; background: #fff !important;
  border-bottom: 3px solid #2e8b57 !important; font-weight: 700 !important;
}

/* ---- Panels ---- */
.pdbp-wrap .pdc-panel     { display: none; padding-top: 18px; }
.pdbp-wrap .pdc-panel-on  { display: block; }
.pdbp-wrap .pdc-empty     { padding: 18px; text-align: center; color: #6b7280; font-size: 14px; background: #f9fafb; border-radius: 5px; border: 1px dashed #d1d5db; }
.pdbp-wrap .pdc-loading   { padding: 50px; text-align: center; color: #9ca3af; font-size: 14px; }

/* ---- KPI strip (Building Info tab) ---- */
.pdbp-kpi-strip {
  display: flex; flex-wrap: wrap; gap: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  overflow: hidden; margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.pdbp-kp-cell {
  flex: 1; min-width: 110px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 12px; border-right: 1px solid #e2e8f0; text-align: center;
}
.pdbp-kp-cell:last-child { border-right: none; }
.pdbp-kp-val  { font-size: 1.45rem; font-weight: 700; color: #0f3460; line-height: 1.1; }
.pdbp-kp-lbl  { font-size: 0.7rem; color: #718096; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.pdbp-kp-rev .pdbp-kp-val { color: #2e8b57; }
.pdbp-kp-maint-warn .pdbp-kp-val { color: #92400e; }

/* ---- Info card ---- */
.pdbp-info-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  overflow: hidden; margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.pdbp-info-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #e8f5ee 100%);
  border-bottom: 1px solid #e2e8f0;
}
.pdbp-info-name { font-size: 17px; font-weight: 700; color: #0f3460; }
.pdbp-info-header-actions { display: flex; align-items: center; gap: 10px; }

.pdbp-info-sections { display: flex; gap: 0; }
.pdbp-info-section  { flex: 1; padding: 16px 20px; border-right: 1px solid #f1f5f9; }
.pdbp-info-section:last-child { border-right: none; }

/* ---- Section column headings ---- */
.pdbp-wrap .pdlp-section-head, .pdbp-section-head {
  font-size: 11px; font-weight: 700; color: #2e8b57;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid #e8f5ee;
}

/* ---- Field rows ---- */
.pdbp-wrap .pdlp-field-row, .pdbp-field-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.875rem;
}
.pdbp-wrap .pdlp-field-row:last-child, .pdbp-field-row:last-child { border-bottom: none; }
.pdbp-wrap .pdlp-field-label, .pdbp-field-label {
  font-size: 10px; color: #9ca3af; text-transform: uppercase;
  letter-spacing: .3px; font-weight: 600; min-width: 110px; flex-shrink: 0;
}
.pdbp-wrap .pdlp-field-val, .pdbp-field-val { font-size: 13px; color: #1f2937; font-weight: 500; }
.pdbp-wrap .pdlp-field-mono, .pdbp-field-mono { font-family: monospace; font-size: 0.82rem; color: #374151; }

/* ---- Edit button ---- */
.pdbp-wrap .pdlp-edit-btn, .pdlp-edit-btn {
  display: inline-block; padding: 5px 16px; background: #2e8b57; color: #fff !important;
  border-radius: 5px; font-size: 12px; font-weight: 600; text-decoration: none !important;
  transition: background .15s;
}
.pdbp-wrap .pdlp-edit-btn:hover, .pdlp-edit-btn:hover { background: #267a4c; }

/* ---- Building status badges ---- */
.pdbp-status-active   { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; background: #dcfce7; color: #166534; }
.pdbp-status-inactive { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; background: #f3f4f6; color: #6b7280; }

/* ---- Unit status badges ---- */
.pdbp-us-rented  { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #dcfce7; color: #166534; }
.pdbp-us-vacant  { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #f3f4f6; color: #6b7280; }
.pdbp-us-maint   { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #feebc8; color: #7b341e; }

/* ---- Notes ---- */
.pdbp-wrap .pdlp-notes-section, .pdbp-notes-section {
  padding: 14px 20px; border-top: 1px solid #f1f5f9; background: #fafcff;
}
.pdbp-wrap .pdlp-notes-body, .pdbp-notes-body {
  font-size: 13px; color: #4a5568; line-height: 1.7; margin-top: 8px;
}
.pdbp-wrap .pdlp-notes-body p { margin: 0 0 8px; }
.pdbp-wrap .pdlp-notes-body p:last-child { margin-bottom: 0; }

/* ---- Attachments ---- */
.pdbp-wrap .pdlp-attachments-section, .pdbp-attachments-section {
  padding: 14px 20px; border-top: 1px solid #f1f5f9;
}
.pdbp-wrap .pdlp-attachments-list, .pdbp-attachments-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.pdbp-wrap .pdlp-attach-item, .pdbp-attach-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 6px; text-decoration: none !important; color: #374151 !important;
  font-size: 13px; transition: background .15s, border-color .15s;
}
.pdbp-wrap .pdlp-attach-item:hover, .pdbp-attach-item:hover { background: #e8f5ee; border-color: #2e8b57; color: #166534 !important; }
.pdbp-wrap .pdlp-attach-ext, .pdbp-attach-ext {
  display: inline-block; padding: 2px 6px; background: #2e8b57; color: #fff;
  border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.pdbp-wrap .pdlp-attach-name, .pdbp-attach-name { font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdbp-wrap .pdlp-attach-size, .pdbp-attach-size { font-size: 11px; color: #9ca3af; white-space: nowrap; }

/* ---- Audit trail — matching landlord layout ---- */
.pdbp-wrap .pdlp-audit-trail, .pdbp-audit-trail {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  padding: 10px 20px; border-top: 1px solid #f1f5f9;
  background: #fafcff; font-size: 12px; color: #6b7280;
}
.pdbp-wrap .pdlp-audit-item, .pdlp-audit-item { display: inline-flex; align-items: center; gap: 4px; }
.pdbp-wrap .pdlp-audit-lbl, .pdlp-audit-lbl { font-weight: 600; color: #374151; }
.pdbp-wrap .pdlp-audit-sep, .pdlp-audit-sep { color: #d1d5db; font-size: 14px; padding: 0 2px; }

/* ---- Status badges (pdc-st-*) ---- */
.pdbp-wrap .pdc-st { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.pdbp-wrap .pdc-st-active    { background: #dcfce7; color: #166534; }
.pdbp-wrap .pdc-st-inactive  { background: #f3f4f6; color: #6b7280; }
.pdbp-wrap .pdc-st-warn      { background: #feebc8; color: #7b341e; }
.pdbp-wrap .pdc-st-received  { background: #dbeafe; color: #1e40af; }
.pdbp-wrap .pdc-st-deposited { background: #fef3c7; color: #92400e; }
.pdbp-wrap .pdc-st-cleared   { background: #dcfce7; color: #166534; }
.pdbp-wrap .pdc-st-bounced   { background: #fecaca; color: #991b1b; }
.pdbp-wrap .pdc-st-replaced  { background: #f3f4f6; color: #6b7280; }
.pdbp-wrap .pdc-st-rented    { background: #dcfce7; color: #166534; }
.pdbp-wrap .pdc-st-vacant    { background: #f3f4f6; color: #6b7280; }
.pdbp-wrap .pdc-st-maintenance { background: #feebc8; color: #7b341e; }

/* ---- Section headers — card style matching unit portfolio ---- */
.pdbp-wrap .pd-section-header {
  padding: 14px 18px; margin: 16px 0 0;
  background: #f8f9fa; border: 1px solid #e5e7eb;
  border-radius: 8px 8px 0 0; border-left: 4px solid #2e8b57;
  display: flex; align-items: center; justify-content: space-between;
}
.pdbp-wrap .pd-section-title { font-size: 16px; font-weight: 700; color: #1a1a1a; }

/* ---- Filters bar ---- */
.pdbp-wrap .pdc-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 12px 16px; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 8px; margin-bottom: 16px;
}
.pdbp-wrap .pdc-fg { display: flex; flex-direction: column; gap: 4px; }
.pdbp-wrap .pdc-fg label { font-size: 11px; font-weight: 500; color: #6b7280; }
.pdbp-wrap .pdc-fsel, .pdbp-wrap .pdc-finput {
  height: 34px; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 5px;
  font-size: 13px; color: #374151; background: #fff; min-width: 140px;
}
.pdbp-wrap .pdc-fsel:focus, .pdbp-wrap .pdc-finput:focus { outline: none; border-color: #2e8b57; }
.pdbp-wrap .pdc-applybtn {
  height: 34px; padding: 0 14px; background: #2e8b57; color: #fff;
  border: none; border-radius: 5px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.pdbp-wrap .pdc-applybtn:hover { background: #267a4c; }
.pdbp-wrap .pdc-clearbtn {
  height: 34px; padding: 0 14px; background: #fff; color: #374151;
  border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.pdbp-wrap .pdc-clearbtn:hover { background: #f3f4f6; }

/* ---- Filter Apply / Clear buttons — matching landlord pdc-applybtn/pdc-clearbtn ---- */
.pdbp-wrap .pdc-filter-apply, .pdc-filter-apply {
  padding: 8px 16px; border-radius: 5px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: #2e8b57; color: #fff !important;
  transition: background .15s;
}
.pdbp-wrap .pdc-filter-apply:hover, .pdc-filter-apply:hover { background: #267a4c; }
.pdbp-wrap .pdc-filter-clear, .pdc-filter-clear {
  padding: 8px 16px; border-radius: 5px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid #d1d5db; background: #fff; color: #374151 !important;
  transition: background .15s;
}
.pdbp-wrap .pdc-filter-clear:hover, .pdc-filter-clear:hover { background: #f3f4f6; }

/* ---- CSV button ---- */
.pdbp-csv-btn, .pdbp-wrap .pdbp-csv-btn {
  display: inline-flex; align-items: center;
  padding: 7px 14px; background: #f0faf4; color: #166534 !important;
  border: 1px solid #bbf7d0; border-radius: 5px; font-size: 12px; font-weight: 500;
  text-decoration: none !important; white-space: nowrap; transition: background .15s;
}
.pdbp-csv-btn:hover, .pdbp-wrap .pdbp-csv-btn:hover { background: #dcfce7; border-color: #86efac; }

/* ---- Table — matching unit portfolio ---- */
.pdbp-wrap .pdc-tbl { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.pdbp-wrap .pdc-tbl thead th {
  background: #2e8b57; color: #fff; padding: 10px 12px;
  text-align: left; font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}
.pdbp-wrap .pdc-tbl tbody td {
  padding: 11px 12px; border-bottom: 1px solid #e5e7eb;
  vertical-align: middle; color: #374151; font-size: 14px;
}
.pdbp-wrap .pdc-tbl tbody tr > td { background-color: inherit !important; }
.pdbp-wrap .pdc-tbl tbody tr:hover > td { background-color: #e2f0e6 !important; }
.pdbp-wrap .pdc-tbl tbody td a { color: #2e8b57; text-decoration: none; }
.pdbp-wrap .pdc-tbl tfoot td { background: #f8fafc; border-top: 2px solid #d4e8dc; padding: 10px 12px; font-size: 13px; font-weight: 700; }
.pdbp-wrap .pdlp-num, .pdbp-wrap .pdc-tbl .pdlp-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Actions cell ---- */
.pdbp-wrap .pdc-acts { display: flex; gap: 4px; white-space: nowrap; }
.pdbp-wrap .pdc-ae {
  display: inline-block; padding: 5px 12px; background: #2e8b57; color: #fff !important;
  border-radius: 4px; font-size: 12px; font-weight: 500; text-decoration: none;
}
.pdbp-wrap .pdc-ae:hover { background: #267a4c; }

/* ---- Cheque group headers (per unit, Cheques AJAX tab) ---- */
.pdbp-unit-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #f3f4f6; border-left: 4px solid #d1d5db;
  border-radius: 0 6px 6px 0; margin: 18px 0 4px; font-size: 0.85rem;
}
.pdbp-unit-header-active  { background: #f0fdf4; border-left-color: #2e8b57; }
.pdbp-unit-header-title   { font-weight: 700; color: #111827; }
.pdbp-unit-header-meta    { color: #6b7280; font-size: 0.8rem; display: flex; align-items: center; gap: 8px; }
.pdbp-unit-header-meta a  { color: #2e8b57; text-decoration: none; }
.pdbp-unit-header-meta a:hover { text-decoration: underline; }

/* ---- Port header (Report tab: title left, PDF button right) ---- */
.pdbp-wrap .pdlp-port-header, .pdlp-port-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #e2e8f0;
}
.pdbp-wrap .pdlp-port-title, .pdlp-port-title {
  font-size: 15px; font-weight: 600; color: #0f3460;
}

/* ---- PDF button ---- */
.pdbp-wrap .pdlp-pdf-btn, .pdlp-pdf-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #2e8b57; color: #fff !important;
  padding: 7px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  text-decoration: none !important; transition: background .15s;
}
.pdbp-wrap .pdlp-pdf-btn:hover, .pdlp-pdf-btn:hover { background: #267a4c; color: #fff !important; }

/* ---- Building Report: Overview table ---- */
.pdbp-overview-tbl { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.pdbp-overview-tbl tr { border-bottom: 1px solid #f1f5f9; }
.pdbp-overview-tbl tr:last-child { border-bottom: none; }
.pdbp-ov-lbl {
  font-size: 10px; color: #9ca3af; text-transform: uppercase;
  letter-spacing: .3px; font-weight: 600;
  padding: 6px 12px 6px 0; width: 18%; white-space: nowrap;
}
.pdbp-ov-val {
  font-size: 13px; color: #1f2937; font-weight: 500;
  padding: 6px 20px 6px 0; width: 32%;
}
.pdbp-ov-rev { color: #166534; }

/* ---- Building Report: Mini KPI strip (Occupancy 4 cells) ---- */
.pdbp-mini-kpi {
  display: flex; gap: 0;
  border: 1px solid #e2e8f0; border-top: none;
  border-radius: 0 0 8px 8px; overflow: hidden; margin-bottom: 12px;
}
.pdbp-mk-cell {
  flex: 1; padding: 14px 8px; text-align: center;
  border-right: 1px solid #e2e8f0; background: #f8fafc;
}
.pdbp-mk-cell:last-child { border-right: none; }
.pdbp-mk-val  { display: block; font-size: 20px; font-weight: 700; color: inherit; line-height: 1.2; }
.pdbp-mk-lbl  { display: block; font-size: 10px; color: #718096; text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }

/* ---- Occupancy bar ---- */
.pdbp-occ-wrap { margin: 8px 0 14px; }
.pdbp-occ-bar {
  display: block; width: 100%;
  height: 12px; border-radius: 6px; overflow: hidden;
  background: #e9ecef;
  border: 1px solid #ced4da;
  box-sizing: border-box;
}
.pdbp-occ-fill { display: block; height: 100%; background: #2e8b57; border-radius: 6px; }
.pdbp-occ-pct  {
  display: block; text-align: right;
  font-size: 12px; font-weight: 600; color: #166534;
  margin-top: 5px; letter-spacing: .01em;
}
/* Legacy segment classes — kept for compatibility */
.pdbp-occ-seg-rented { background: #2e8b57; }
.pdbp-occ-seg-maint  { background: #f59e0b; }
.pdbp-occ-seg-vacant { background: #e5e7eb; }

/* ---- Status summary — card style matching unit portfolio ---- */
.pdbp-wrap .pdlp-status-summary, .pdlp-status-summary {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 0; margin-bottom: 8px;
  padding: 12px 18px;
  border: 1px solid #e5e7eb; border-top: none;
  border-radius: 0 0 6px 6px; background: #fff;
}
.pdbp-wrap .pdlp-ss-item, .pdlp-ss-item {
  display: flex; align-items: center; gap: 8px;
  background: #f7fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 8px 14px;
}
.pdbp-wrap .pdlp-ss-count, .pdlp-ss-count { font-size: 18px; font-weight: 700; color: #2d3748; }
.pdbp-wrap .pdlp-ss-amt,   .pdlp-ss-amt   { font-size: 12px; color: #718096; }

/* ---- Autocomplete ---- */
.pdbp-wrap .pdc-ac-wrap { position: relative; }
.pdbp-wrap .pdc-ac      { width: 100%; }
.pdbp-wrap .pdc-ac-results {
  display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 999;
  background: #fff; border: 1px solid #d1d5db; border-top: none;
  border-radius: 0 0 5px 5px; max-height: 200px; overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.pdbp-wrap .pdc-ac-item { padding: 8px 12px; font-size: 13px; color: #374151; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.pdbp-wrap .pdc-ac-item:hover { background: #f0fdf4; color: #2e8b57; }
.pdbp-wrap .pdc-ac-item:last-child { border-bottom: none; }
.pdbp-wrap .pdc-ac-empty { padding: 8px 12px; font-size: 13px; color: #9ca3af; font-style: italic; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .pdbp-info-sections { flex-direction: column; }
  .pdbp-kpi-strip { gap: 0; }
  .pdbp-kp-cell { min-width: 90px; padding: 10px 8px; }
  .pdbp-kp-val { font-size: 1.1rem; }
  .pdbp-wrap .pdc-tabn { padding: 10px 10px; font-size: 12px; }
  .pdbp-wrap .pdc-tbl { font-size: 12px; }
  .pdbp-wrap .pdc-tbl thead th, .pdbp-wrap .pdc-tbl tbody td { padding: 7px 8px; }
  .pdbp-mini-kpi { flex-wrap: wrap; }
  .pdbp-mk-cell { min-width: 50%; }
}
