/* =========================================================
   Landlord Portfolio Block — landlord-portfolio.css
   ========================================================= */

/* --- Base tab/panel system (mirrors cheques-page.css) --- */
.pdlp-wrap .pdc-tabbar { display:flex; gap:0; margin-bottom:0; border:1px solid #dee2e6; border-radius:6px 6px 0 0; overflow:hidden; background:#f1f3f5; }
.pdlp-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; }
.pdlp-wrap .pdc-tabn:last-child { border-right:none; }
.pdlp-wrap .pdc-tabn:hover { color:#267a4c; background:#e9ecef; }
.pdlp-wrap .pdc-tabn-on,.pdlp-wrap .pdc-tabn-on:hover { color:#2e8b57 !important; background:#fff !important; border-bottom:3px solid #2e8b57 !important; font-weight:700 !important; }
.pdlp-wrap .pdc-panel { display:none; padding-top:18px; }
.pdlp-wrap .pdc-panel-on { display:block; }
.pdlp-wrap .pdc-empty { padding:18px; text-align:center; color:#6b7280; font-size:14px; background:#f9fafb; border-radius:5px; border:1px dashed #d1d5db; }
.pdlp-wrap .pdc-loading { padding:50px; text-align:center; color:#9ca3af; font-size:14px; }
.pdlp-wrap .pdc-filters { display:flex; gap:10px; align-items:flex-end; margin-bottom:16px; flex-wrap:wrap; }
.pdlp-wrap .pdc-fg { display:flex; flex-direction:column; gap:4px; }
.pdlp-wrap .pdc-fg label { font-size:11px; color:#6b7280; font-weight:500; }
.pdlp-wrap .pdc-fsel { padding:7px 10px; border:1px solid #d1d5db; border-radius:5px; font-size:13px; background:#fff; color:#374151; min-width:120px; }
.pdlp-wrap .pdc-applybtn { padding:8px 16px; border-radius:5px; font-size:13px; font-weight:500; cursor:pointer; border:none; background:#2e8b57; color:#fff !important; }
.pdlp-wrap .pdc-applybtn:hover { background:#267a4c; }
.pdlp-wrap .pdc-clearbtn { padding:8px 16px; border-radius:5px; font-size:13px; font-weight:500; cursor:pointer; border:1px solid #d1d5db; background:#fff; color:#374151 !important; }
.pdlp-wrap .pdc-tbl { width:100%; border-collapse:collapse; font-size:14px; line-height:1.5; }
.pdlp-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; }
.pdlp-wrap .pdc-tbl tbody td { padding:11px 12px; border-bottom:1px solid #e5e7eb; vertical-align:middle; color:#374151; font-size:14px; text-align:left !important; }
.pdlp-wrap .pdc-tbl tbody tr > td { background-color:inherit !important; }
.pdlp-wrap .pdc-tbl tbody tr:hover > td { background-color:#e2f0e6 !important; }
.pdlp-wrap .pdc-tbl tbody td a { color:#2e8b57; text-decoration:none; }
.pdlp-wrap .pdc-acts { display:flex; gap:4px; white-space:nowrap; }
.pdlp-wrap .pdc-ae { display:inline-block; padding:5px 12px; border-radius:4px; font-size:12px; font-weight:500; text-decoration:none !important; background:#2e8b57; color:#fff !important; }
.pdlp-wrap .pdc-ae:hover { background:#267a4c; }
.pdlp-wrap .pdc-total { text-align:right; padding:8px 12px; font-size:13px; font-weight:500; color:#6b7280; }
.pdlp-wrap .pdc-pager { display:flex; justify-content:space-between; align-items:center; margin-top:14px; padding-top:12px; border-top:1px solid #e5e7eb; }
.pdlp-wrap .pdc-pgb { min-width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; border-radius:5px; font-size:13px; font-weight:500; cursor:pointer; border:1px solid #d1d5db; background:#fff; color:#374151; }
.pdlp-wrap .pdc-pgb:hover:not(.pdc-pgb-off) { background:#f3f4f6; }
.pdlp-wrap .pdc-pgb-off { opacity:.35; pointer-events:none; }
.pdlp-wrap .pdc-st { display:inline-block; padding:3px 10px; border-radius:4px; font-size:11px; font-weight:600; text-transform:capitalize; }
.pdlp-wrap .pdc-st-active    { background:#dcfce7; color:#166534; }
.pdlp-wrap .pdc-st-inactive  { background:#f3f4f6; color:#6b7280; }
.pdlp-wrap .pdc-st-warn      { background:#feebc8; color:#7b341e; }
.pdlp-wrap .pdc-st-received  { background:#dbeafe; color:#1e40af; }
.pdlp-wrap .pdc-st-deposited { background:#fef3c7; color:#92400e; }
.pdlp-wrap .pdc-st-cleared   { background:#dcfce7; color:#166534; }
.pdlp-wrap .pdc-st-bounced   { background:#fecaca; color:#991b1b; }
.pdlp-wrap .pdc-st-replaced  { background:#f3f4f6; color:#6b7280; }
.pdlp-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; }
.pdlp-wrap .pd-section-title { font-size:16px; font-weight:700; color:#1a1a1a; }
.pdlp-wrap .pdc-hdr-amber { border-left:4px solid #f59e0b !important; background:#fffbeb !important; }
.pdlp-wrap .pdc-hdr-amber .pd-section-title { color:#92400e !important; }
.pdlp-wrap .pdc-hdr-blue { border-left:4px solid #2563eb !important; background:#eff6ff !important; }
.pdlp-wrap .pdc-hdr-blue .pd-section-title { color:#1e40af !important; }

/* --- KPI row --- */
.pdlp-wrap .kpi-row { display:flex; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.pdlp-wrap .kpi-card { flex:1; min-width:140px; background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:14px 16px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.pdlp-wrap .kpi-card.kpi-ok   { border-top:3px solid #2e8b57; }
.pdlp-wrap .kpi-card.kpi-info { border-top:3px solid #2563eb; }
.pdlp-wrap .kpi-card.kpi-warn { border-top:3px solid #f59e0b; }
.pdlp-wrap .kpi-card.kpi-bad  { border-top:3px solid #dc2626; }
.pdlp-wrap .kpi-label { font-size:11px; font-weight:600; color:#718096; text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px; }
.pdlp-wrap .kpi-value { font-size:26px; font-weight:700; color:#0f3460; line-height:1.2; }
.pdlp-wrap .kpi-sub   { font-size:12px; color:#718096; margin-top:4px; }

/* --- Wrapper --- */
.pdlp-wrap {
  max-width: 100%;
  padding: 0;
}

/* --- Portfolio header (title + PDF button) --- */
.pdlp-port-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}
.pdlp-port-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f3460;
}
.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;
  transition: background .15s;
}
.pdlp-pdf-btn:hover { background: #267a4c; color: #fff !important; }

/* --- CSV export button (inside AJAX tabs) --- */
.pdlp-csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #2f855a;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  margin-left: auto;
  transition: background .15s;
}
.pdlp-csv-btn:hover { background: #276749; color: #fff !important; }

/* Align filter row items including CSV button */
.pdc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

/* --- Landlord Info profile card --- */
.pdlp-profile-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.pdlp-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px 24px;
  margin-bottom: 16px;
}
.pdlp-profile-row {
  display: flex;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}
.pdlp-label {
  font-size: 11px;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: .4px;
  min-width: 100px;
  flex-shrink: 0;
}
.pdlp-value {
  font-size: 13px;
  color: #2d3748;
}
.pdlp-value a { color: #0f3460; }
.pdlp-notes-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.pdlp-notes {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.6;
}

/* Mini KPI row inside Info tab */
.pdlp-info-kpi-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pdlp-info-kpi {
  flex: 1;
  min-width: 120px;
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
}
.pdlp-ik-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #0f3460;
  line-height: 1.2;
}
.pdlp-ik-lbl {
  display: block;
  font-size: 10px;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 2px;
}

/* --- Number cells --- */
.pdlp-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Two-column layout (expiring + due soon) --- */
.pdlp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 4px 0 8px;
}
@media (max-width: 768px) {
  .pdlp-two-col { grid-template-columns: 1fr; }
}
.pdlp-col {}

/* --- Expiring contract cards --- */
.pdlp-exp-card {
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-left: 4px solid;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.pdlp-exp-red    { border-color: #fc8181; background: #fff5f5; }
.pdlp-exp-amber  { border-color: #f6ad55; background: #fffaf0; }
.pdlp-exp-blue   { border-color: #63b3ed; background: #ebf8ff; }
.pdlp-exp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.pdlp-exp-contract { font-weight: 600; font-size: 13px; color: #0f3460; }
.pdlp-exp-contract a { color: #0f3460; }
.pdlp-exp-days {
  font-size: 12px;
  font-weight: 700;
  background: #0f3460;
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
}
.pdlp-exp-detail { font-size: 12px; color: #4a5568; margin-top: 2px; }
.pdlp-exp-date   { font-size: 11px; color: #718096; margin-top: 4px; }

/* --- Cheque due-soon cards --- */
.pdlp-chq-card {
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border: 1px solid #bee3f8;
  background: #ebf8ff;
}
.pdlp-chq-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.pdlp-chq-no  { font-weight: 600; font-size: 13px; color: #0f3460; }
.pdlp-chq-no a { color: #0f3460; }
.pdlp-chq-amt { font-size: 13px; font-weight: 700; color: #2f855a; }
.pdlp-chq-detail { font-size: 12px; color: #4a5568; margin-top: 2px; }

/* --- Cheque status summary --- */
.pdlp-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 16px;
}
.pdlp-ss-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 14px;
}
.pdlp-ss-count {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
}
.pdlp-ss-amt {
  font-size: 12px;
  color: #718096;
}

/* --- Expiring row highlight in contracts tab --- */
.pdlp-row-warn td {
  background: #fffaf0 !important;
}

/* --- Status badges (extends existing pdc-st system) --- */
.pdc-st-warn {
  background: #feebc8;
  color: #7b341e;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* --- Section header overrides for portfolio look --- */
.pd-section-header {
  margin: 16px 0 8px;
  border-radius: 6px;
  padding: 8px 12px;
}

/* =========================================================
   Landlord Info card — redesigned grouped layout
   ========================================================= */
.pdlp-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);
}

/* Header bar: name + status */
.pdlp-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;
}
.pdlp-info-name {
  font-size: 17px;
  font-weight: 700;
  color: #0f3460;
}

/* Three-column grid */
.pdlp-info-sections {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid #e2e8f0;
}
@media (max-width: 768px) {
  .pdlp-info-sections { grid-template-columns: 1fr; }
}
.pdlp-info-section {
  padding: 16px 20px;
  border-right: 1px solid #f1f5f9;
}
.pdlp-info-section:last-child { border-right: none; }

/* Section heading (Contact / Identity / Banking) */
.pdlp-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 inside each section */
.pdlp-field-row {
  display: flex;
  flex-direction: column;
  padding: 5px 0;
  gap: 2px;
}
.pdlp-field-label {
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .3px;
  font-weight: 600;
}
.pdlp-field-val {
  font-size: 13px;
  color: #1f2937;
  word-break: break-word;
}
.pdlp-field-val a { color: #2563eb; text-decoration: none; }
.pdlp-field-mono { font-family: monospace; font-size: 12px; letter-spacing: .5px; }

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

/* KPI strip at the bottom of the info card */
.pdlp-info-kpi-strip {
  display: flex;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.pdlp-ik-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-right: 1px solid #e2e8f0;
  text-align: center;
}
.pdlp-ik-cell:last-child { border-right: none; }
.pdlp-ik-cell .pdlp-ik-val {
  font-size: 20px;
  font-weight: 700;
  color: #0f3460;
  line-height: 1.2;
}
.pdlp-ik-cell .pdlp-ik-lbl {
  font-size: 10px;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 3px;
}
.pdlp-ik-rev .pdlp-ik-val { font-size: 15px; color: #2e8b57; }

/* th alignment fix for numeric columns */
.pdlp-wrap .pdc-tbl thead th.pdlp-num { text-align: left; }

/* Text filter inputs */
.pdlp-wrap .pdc-ftxt {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
  color: #374151;
  min-width: 140px;
}

/* Sortable column headers */
.pdlp-wrap .pdc-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.pdlp-wrap .pdc-th-sort:hover { background: #267a4c !important; }
.pdlp-wrap .pdc-th-sort .sort-icon { margin-left: 4px; opacity: .6; font-style: normal; font-size: 10px; }

/* --- Edit button on info card header --- */
.pdlp-info-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.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;
}
.pdlp-edit-btn:hover { background: #267a4c; }

/* --- Audit trail --- */
.pdlp-audit-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 20px;
  border-top: 1px solid #f1f5f9;
  background: #fafcff;
  font-size: 12px;
  color: #6b7280;
}
.pdlp-audit-lbl {
  font-weight: 600;
  color: #374151;
}
.pdlp-audit-sep {
  color: #d1d5db;
  font-size: 14px;
}

/* --- Autocomplete — mirrors cheques-page.css exactly --- */
.pdlp-wrap .pdc-ac-wrap { position: relative; }
.pdlp-wrap .pdc-ac { width: 100%; }
.pdlp-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); }
.pdlp-wrap .pdc-ac-item { padding: 8px 12px; font-size: 13px; color: #374151; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.pdlp-wrap .pdc-ac-item:hover { background: #f0fdf4; color: #2e8b57; }
.pdlp-wrap .pdc-ac-item:last-child { border-bottom: none; }
.pdlp-wrap .pdc-ac-empty { padding: 8px 12px; font-size: 13px; color: #9ca3af; font-style: italic; }

/* --- Attachments section --- */
.pdlp-attachments-section {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.pdlp-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.pdlp-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;
}
.pdlp-attach-item:hover {
  background: #e8f5ee;
  border-color: #2e8b57;
  color: #166534 !important;
}
.pdlp-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;
}
.pdlp-attach-name {
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdlp-attach-size {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}
