/* ============================================================
   PropertyDesk — Node Detail Blocks (shared)
   Covers: Cheque Detail · Payment Detail
   Prefix: .pdnd-
   ============================================================ */

/* ---- Outer wrap ---- */
.pdnd-wrap { font-family: inherit; margin: 0 0 1.5rem; }

/* ---- Header bar ---- */
.pdnd-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 8px 8px 0 0; border-bottom: 3px solid #2e8b57;
  padding: .9rem 1.25rem; gap: 1rem; flex-wrap: wrap;
}
.pdnd-header-left  { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.pdnd-header-right { display: flex; gap: .4rem; flex-wrap: wrap; }
.pdnd-title { font-size: 1.05rem; font-weight: 700; color: #111827; }

/* ---- Status badges ---- */
.pdnd-st {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.pdnd-st-received    { background: #dbeafe; color: #1e40af; }
.pdnd-st-deposited   { background: #fef3c7; color: #92400e; }
.pdnd-st-cleared     { background: #dcfce7; color: #166534; }
.pdnd-st-bounced     { background: #fee2e2; color: #991b1b; }
.pdnd-st-replaced    { background: #f3e8ff; color: #6b21a8; }
.pdnd-st-unknown     { background: #f3f4f6; color: #6b7280; }
/* Maintenance statuses (referenced by shared header badge logic in JS) */
.pdnd-st-new         { background: #dbeafe; color: #1e40af; }
.pdnd-st-in_progress { background: #fef3c7; color: #92400e; }
.pdnd-st-closed      { background: #dcfce7; color: #166534; }
.pdnd-st-open        { background: #dbeafe; color: #1e40af; }

/* ---- Contract status mini-badge ---- */
.pdnd-cs {
  display: inline-flex; padding: .13rem .42rem;
  border-radius: 4px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; margin-left: .35rem;
}
.pdnd-cs-active    { background: #dcfce7; color: #166534; }
.pdnd-cs-draft     { background: #f3f4f6; color: #6b7280; }
.pdnd-cs-expired   { background: #fee2e2; color: #991b1b; }
.pdnd-cs-cancelled { background: #fef3c7; color: #92400e; }

/* ---- Action buttons ---- */
.pdnd-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .38rem .85rem; border-radius: 6px;
  font-size: .78rem; font-weight: 600;
  text-decoration: none; border: 1.5px solid;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  line-height: 1;
}
.pdnd-btn-edit   { color: #166534; border-color: #166534; background: #fff; }
.pdnd-btn-edit:hover { background: #166534; color: #fff; }
.pdnd-btn-delete { color: #991b1b; border-color: #991b1b; background: #fff; }
.pdnd-btn-delete:hover { background: #991b1b; color: #fff; }
.pdnd-btn-pdf    { color: #1e3a5f; border-color: #1e3a5f; background: #fff; }
.pdnd-btn-pdf:hover { background: #1e3a5f; color: #fff; }

/* ---- Quick status widget (cheque) ---- */
.pdnd-status-widget {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-top: none;
  padding: .6rem 1.25rem;
}
.pdnd-sw-label { font-size: .78rem; font-weight: 700; color: #166534; white-space: nowrap; }
.pdnd-sw-sel {
  padding: .28rem .5rem; border: 1px solid #d1d5db; border-radius: 5px;
  font-size: .83rem; background: #fff; cursor: pointer; min-width: 130px;
}
.pdnd-sw-btn {
  padding: .3rem .85rem; border-radius: 5px; border: none;
  background: #2e8b57; color: #fff;
  font-size: .8rem; font-weight: 700; cursor: pointer; transition: background .15s;
}
.pdnd-sw-btn:hover    { background: #166634; }
.pdnd-sw-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.pdnd-sw-msg          { font-size: .78rem; font-weight: 600; }
.pdnd-sw-msg.ok  { color: #166534; }
.pdnd-sw-msg.err { color: #991b1b; }

/* ---- KPI strip ---- */
.pdnd-kpi-strip {
  display: flex; background: #fff;
  border: 1px solid #e5e7eb; border-top: none; overflow: hidden;
}
.pdnd-kp {
  flex: 1; padding: .7rem .9rem; text-align: center;
  border-right: 1px solid #e5e7eb;
}
.pdnd-kp:last-child { border-right: none; }
.pdnd-kp-val { font-size: .95rem; font-weight: 700; color: #111827; }
.pdnd-kp-lbl {
  font-size: .65rem; color: #6b7280;
  text-transform: uppercase; letter-spacing: .06em; margin-top: .1rem;
}
.pdnd-days-ok       .pdnd-kp-val { color: #166534; }
.pdnd-days-soon     .pdnd-kp-val { color: #92400e; }
.pdnd-days-overdue  .pdnd-kp-val { color: #991b1b; }

/* ---- Amount hero (payment) ---- */
.pdnd-amount-hero {
  background: #fff; border: 1px solid #e5e7eb; border-top: none;
  padding: 1rem 1.5rem; display: flex; align-items: baseline; gap: .75rem;
  flex-wrap: wrap;
}
.pdnd-amount-big  { font-size: 1.9rem; font-weight: 800; color: #166534; }
.pdnd-amount-meta { font-size: .88rem; color: #6b7280; }
.pdnd-amount-sep  { color: #d1d5db; }

/* ---- Main detail card ---- */
.pdnd-card {
  background: #fff; border: 1px solid #e5e7eb; border-top: none;
}
.pdnd-field-row {
  display: flex; border-bottom: 1px solid #f3f4f6;
  padding: .6rem 1.25rem; gap: 1rem; align-items: flex-start;
}
.pdnd-field-row:last-child { border-bottom: none; }
.pdnd-lbl {
  flex: 0 0 130px; font-size: .73rem; font-weight: 700;
  color: #6b7280; text-transform: uppercase; letter-spacing: .05em; padding-top: .1rem;
}
.pdnd-val { flex: 1; font-size: .88rem; color: #111827; }
.pdnd-link { color: #2e8b57; text-decoration: none; font-weight: 600; }
.pdnd-link:hover { text-decoration: underline; }

/* Notes inside card */
.pdnd-notes-body { line-height: 1.65; }
.pdnd-notes-body p { margin: 0 0 .4rem; }
.pdnd-notes-body p:last-child { margin: 0; }

/* Attachments */
.pdnd-attachments { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
.pdnd-att-link {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .6rem; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 4px; font-size: .75rem; color: #166534; text-decoration: none;
}
.pdnd-att-link:hover { background: #dcfce7; }

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .pdnd-kpi-strip { flex-wrap: wrap; }
  .pdnd-kp { flex: 0 0 50%; }
  .pdnd-lbl { flex: 0 0 100px; }
}
