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

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

/* ---- Tab bar — boxed style ---- */
.pdcp-wrap .pdc-tabbar {
  display: flex; gap: 0; margin-bottom: 0;
  border: 1px solid #dee2e6; border-radius: 6px 6px 0 0;
  overflow: hidden; background: #f1f3f5;
}
.pdcp-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;
}
.pdcp-wrap .pdc-tabn:last-child { border-right: none; }
.pdcp-wrap .pdc-tabn:hover { color: #267a4c; background: #e9ecef; }
.pdcp-wrap .pdc-tabn-on,
.pdcp-wrap .pdc-tabn-on:hover {
  color: #2e8b57 !important; background: #fff !important;
  border-bottom: 3px solid #2e8b57 !important; font-weight: 700 !important;
}

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

/* ---- KPI strip (Contract Info tab) ---- */
.pdcp-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);
}
.pdcp-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;
}
.pdcp-kp-cell:last-child { border-right: none; }
.pdcp-kp-val  { font-size: 1.45rem; font-weight: 700; color: #0f3460; line-height: 1.1; }
.pdcp-kp-lbl  { font-size: 0.7rem; color: #718096; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.pdcp-kp-rev .pdcp-kp-val { color: #2e8b57; }
.pdcp-kp-warn .pdcp-kp-val { color: #92400e; }
.pdcp-kp-danger .pdcp-kp-val { color: #991b1b; }

/* ---- Info card ---- */
.pdcp-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);
}
.pdcp-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;
}
.pdcp-info-name { font-size: 17px; font-weight: 700; color: #0f3460; }
.pdcp-info-header-actions { display: flex; align-items: center; gap: 10px; }

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

/* ---- Financial row (full-width section below 2-col) ---- */
.pdcp-info-section-full {
  padding: 14px 20px; border-top: 1px solid #f1f5f9; background: #fafcff;
}

/* ---- Section column headings ---- */
.pdcp-wrap .pdlp-section-head, .pdcp-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 ---- */
.pdcp-wrap .pdlp-field-row, .pdcp-field-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.875rem;
}
.pdcp-wrap .pdlp-field-row:last-child, .pdcp-field-row:last-child { border-bottom: none; }
.pdcp-wrap .pdlp-field-label, .pdcp-field-label {
  font-size: 10px; color: #9ca3af; text-transform: uppercase;
  letter-spacing: .3px; font-weight: 600; min-width: 130px; flex-shrink: 0;
}
.pdcp-wrap .pdlp-field-val, .pdcp-field-val { font-size: 13px; color: #1f2937; font-weight: 500; }

/* ---- Edit button ---- */
.pdcp-wrap .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;
}
.pdcp-wrap .pdlp-edit-btn:hover { background: #267a4c; }

/* ---- Contract status badges ---- */
.pdcp-status-active    { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; background: #dcfce7; color: #166534; }
.pdcp-status-draft     { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; background: #fef3c7; color: #92400e; }
.pdcp-status-expired   { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; background: #f3f4f6; color: #6b7280; }
.pdcp-status-cancelled { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; background: #fecaca; color: #991b1b; }

/* ---- Days remaining badge ---- */
.pdcp-days-ok      { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; background: #dcfce7; color: #166534; }
.pdcp-days-soon    { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; background: #fef3c7; color: #92400e; }
.pdcp-days-expired { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; background: #fecaca; color: #991b1b; }

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

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

/* ---- Audit trail ---- */
.pdcp-wrap .pdlp-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;
}
.pdcp-wrap .pdlp-audit-item { display: inline-flex; align-items: center; gap: 4px; }
.pdcp-wrap .pdlp-audit-lbl  { font-weight: 600; color: #374151; }
.pdcp-wrap .pdlp-audit-sep  { color: #d1d5db; font-size: 14px; padding: 0 2px; }

/* ---- Cheque status badges (pdc-st-*) ---- */
.pdcp-wrap .pdc-st { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.pdcp-wrap .pdc-st-received  { background: #dbeafe; color: #1e40af; }
.pdcp-wrap .pdc-st-deposited { background: #fef3c7; color: #92400e; }
.pdcp-wrap .pdc-st-cleared   { background: #dcfce7; color: #166534; }
.pdcp-wrap .pdc-st-bounced   { background: #fecaca; color: #991b1b; }
.pdcp-wrap .pdc-st-replaced  { background: #f3f4f6; color: #6b7280; }

/* ---- Section headers — card style ---- */
.pdcp-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;
}
.pdcp-wrap .pd-section-title { font-size: 16px; font-weight: 700; color: #1a1a1a; }

/* ---- Filters bar ---- */
.pdcp-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;
}
.pdcp-wrap .pdc-fg { display: flex; flex-direction: column; gap: 4px; }
.pdcp-wrap .pdc-fg label { font-size: 11px; font-weight: 500; color: #6b7280; }
.pdcp-wrap .pdc-fsel, .pdcp-wrap .pdc-finput {
  height: 34px; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 5px;
  font-size: 13px; color: #374151; background: #fff; min-width: 160px;
}
.pdcp-wrap .pdc-fsel:focus, .pdcp-wrap .pdc-finput:focus { outline: none; border-color: #2e8b57; }

/* ---- Filter Apply / Clear buttons ---- */
.pdcp-wrap .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;
}
.pdcp-wrap .pdc-filter-apply:hover { background: #267a4c; }
.pdcp-wrap .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;
}
.pdcp-wrap .pdc-filter-clear:hover { background: #f3f4f6; }

/* ---- CSV button ---- */
.pdcp-csv-btn, .pdcp-wrap .pdcp-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;
}
.pdcp-csv-btn:hover, .pdcp-wrap .pdcp-csv-btn:hover { background: #dcfce7; border-color: #86efac; }
.pdcp-csv-row { margin-bottom: 8px; }

/* ---- Table ---- */
.pdcp-wrap .pdc-tbl { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.pdcp-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;
}
.pdcp-wrap .pdc-tbl tbody td {
  padding: 11px 12px; border-bottom: 1px solid #e5e7eb;
  vertical-align: middle; color: #374151; font-size: 14px;
}
.pdcp-wrap .pdc-tbl tbody tr > td { background-color: inherit !important; }
.pdcp-wrap .pdc-tbl tbody tr:hover > td { background-color: #e2f0e6 !important; }
.pdcp-wrap .pdc-tbl tbody td a { color: #2e8b57; text-decoration: none; }
.pdcp-wrap .pdc-tbl tfoot td { background: #f8fafc; border-top: 2px solid #d4e8dc; padding: 10px 12px; font-size: 13px; font-weight: 700; }

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

/* ---- PDF button ---- */
.pdcp-wrap .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;
}
.pdcp-wrap .pdlp-pdf-btn:hover { background: #267a4c; color: #fff !important; }

/* ---- Contract Report: Overview table ---- */
.pdcp-overview-tbl { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.pdcp-overview-tbl tr { border-bottom: 1px solid #f1f5f9; }
.pdcp-overview-tbl tr:last-child { border-bottom: none; }
.pdcp-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;
}
.pdcp-ov-val {
  font-size: 13px; color: #1f2937; font-weight: 500;
  padding: 6px 20px 6px 0; width: 32%;
}
.pdcp-ov-rev { color: #166534; font-weight: 700; }

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

/* ---- Cheques Cleared progress bar ---- */
.pdcp-occ-wrap { margin: 8px 0 14px; }
.pdcp-occ-bar {
  display: block; width: 100%;
  height: 12px; border-radius: 6px; overflow: hidden;
  background: #e9ecef;
  border: 1px solid #ced4da;
  box-sizing: border-box;
}
.pdcp-occ-fill { display: block; height: 100%; background: #2e8b57; border-radius: 6px; }
.pdcp-occ-pct  {
  display: block; text-align: right;
  font-size: 12px; font-weight: 600; color: #166534;
  margin-top: 5px; letter-spacing: .01em;
}

/* ---- Status summary — cheque breakdown ---- */
.pdcp-wrap .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;
}
.pdcp-wrap .pdlp-ss-item {
  display: flex; align-items: center; gap: 8px;
  background: #f7fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 8px 14px;
}
.pdcp-wrap .pdlp-ss-count { font-size: 18px; font-weight: 700; color: #2d3748; }
.pdcp-wrap .pdlp-ss-amt   { font-size: 12px; color: #718096; }

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