/* Facility owner Payments (payments.js), from Daniel's Payment UI mockup 2026-10-21. KPI tiles use the shared .cp-kpi sizes from
   facility-ui.css; the line chart reuses the dashboard's .fx-chart styles (app.css); the rest builds on ui-kit.css. */
.pm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; color: #0b0f17; font-size: 14px; }   /* one shrinkable column: without it the grid sized itself to its widest card and ran off the right edge */
.pm > .cp-head { margin-bottom: 0; }
.pm-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ctl-h, 40px);
  padding: 0 8px 0 12px;
  border: 1px solid #d9dde3;
  border-radius: var(--ctl-r, 10px);
  background: #fff;
}
.pm-range .ic { width: 16px; height: 16px; color: #6b7280; }
.pm-range select { border: 0; background: none; font: inherit; font-size: 14px; color: #0b0f17; padding: 0 4px; min-height: 36px; }
.pm-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line, #e8eaee); }
.pm-tabs button {
  padding: 10px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  margin-bottom: -1px;
  white-space: nowrap;
}
.pm-tabs button.on { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.pm-tabs button:focus-visible,
.pm-link:focus-visible,
.pm-pb:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.pm-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.pm-kpis small.up { color: #15803d; }
.pm-kpis small.down { color: #dc2626; }
.pm-kpis .cp-kpi-ic.red { background: #fee2e2; color: #dc2626; }
.pm-card { padding: 16px 18px; min-width: 0; }
.pm-card h2 { font-size: 17px; }
.pm-ch { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.pm-ctl { display: flex; gap: 8px; }
.pm-ctl select,
.pm-filters select,
.pm-pn select { min-height: 36px; border: 1px solid #d9dde3; border-radius: 8px; background: #fff; font: inherit; font-size: 13.5px; padding: 0 8px; }
.pm-mid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.pm-trend { width: 100%; height: auto; }
.pm-bd { display: flex; align-items: center; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.pm-dn { position: relative; width: 150px; flex-shrink: 0; }
.pm-donut { width: 150px; height: 150px; display: block; }
.pm-dn-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pm-dn-c b { font-size: 20px; }
.pm-dn-c span { font-size: 12px; color: #6b7280; }
.pm-lg { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; min-width: 190px; }
.pm-lg li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 40px; gap: 8px; align-items: center; font-size: 13.5px; }
.pm-lg i { width: 12px; height: 12px; border-radius: 3px; }
.pm-lg em { font-style: normal; color: #6b7280; text-align: right; }
.pm-filters { display: grid; grid-template-columns: minmax(200px, 1.8fr) repeat(3, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #d9dde3;
  border-radius: 10px;
  background: #fff;
  color: #6b7280;
}
.pm-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: #0b0f17; }
.pm-search:focus-within { outline: 2px solid #93c5fd; outline-offset: 1px; border-color: #2563eb; }
.pm-search .ic { width: 16px; height: 16px; }
.pm-tw { overflow-x: auto; position: relative; }   /* relative: the hidden .sr header label is absolute (ui-kit) and otherwise escapes the scroll box and widens the page */
.pm-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pm-tbl th {
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid var(--line, #e8eaee);
  white-space: nowrap;
}
.pm-tbl td { padding: 9px 10px; border-bottom: 1px solid #f1f2f4; vertical-align: middle; white-space: nowrap; }
.pm-tbl td.muted,
.muted { color: #6b7280; }
.pm-tbl td.neg { color: #b91c1c; }
.pm-empty { padding: 28px 10px !important; text-align: center; color: #6b7280; }
.pm-who { display: inline-flex; align-items: center; gap: 10px; }
.pm-who b { display: block; font-weight: 600; }
.pm-who small { display: block; font-size: 12px; color: #6b7280; }
.pm-chip { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.pm-chip.t-payment,
.pm-chip.s-paid { background: #dcfce7; color: #15803d; }
.pm-chip.t-invoice { background: #dbeafe; color: #1d4ed8; }
.pm-chip.t-refund,
.pm-chip.s-pending { background: #fef3c7; color: #b45309; }
.pm-chip.s-pastdue,
.pm-chip.s-failed { background: #fee2e2; color: #b91c1c; }
.pm-chip.s-refunded { background: #f3f4f6; color: #4b5563; }
.pm-link { border: 0; background: none; padding: 0; color: #2563eb; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pm-pg { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.pm-pn { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pm-pb { min-width: 34px; height: 34px; border: 1px solid #d9dde3; border-radius: 8px; background: #fff; font: inherit; font-size: 13.5px; cursor: pointer; }
.pm-pb.on { background: #eff6ff; border-color: #2563eb; color: #1d4ed8; font-weight: 600; }
.pm-pb:disabled { opacity: .4; cursor: not-allowed; }
.pm-pn label { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; }
.pm-none { text-align: center; padding: 48px 20px; }
.pm-none-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: #eff6ff; color: #2563eb; margin-bottom: 10px; }
.pm-none-ic .ic { width: 24px; height: 24px; }
.pm-inv { display: grid; gap: 2px; margin: 8px 0 4px; }
@media (max-width: 1300px) {
  .pm-mid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1200px) {
  .pm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .pm-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pm-tabs { overflow-x: auto; scrollbar-width: none; }
  .pm-filters { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 480px) { .pm-kpis { grid-template-columns: minmax(0, 1fr) !important; } }

/* A range too big to load completely, and the custom date range in the header */
.pm-note { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #fcd34d; background: #fffbeb; border-radius: 10px; font-size: 14px; color: #92400e; }
.pm-custom { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #6b7280; }
.pm-custom[hidden] { display: none; }
.pm-custom input { min-height: 36px; padding: 0 8px; border: 1px solid #d9dde3; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; color: #0b0f17; }
