/* patients.css — admin patients screens (.pt- prefix) */
.pt-list .pt-search { flex: 1 1 260px; min-width: 0; }
.pt-filters { gap: 10px; }
.pt-filters > * { min-width: 0; max-width: 100%; }
.pt-filters .select { min-width: 0; flex: 1 1 150px; max-width: 260px; }
.pt-filters .pt-dates { flex: 1 1 240px; min-width: 0; }
.pt-filters .pt-dates .input { min-width: 0; width: 0; flex: 1 1 0; }
.pt-list .avatar { font-size: .8rem; }
.pt-more { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pt-more > summary { padding: 12px 14px; cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.pt-more > summary:focus-visible { outline: 2px solid var(--aqua-deep); outline-offset: 2px; border-radius: 10px; }
.pt-more-body { padding: 4px 14px 16px; }
.pt-tools > .row { padding: 4px 12px 12px; gap: 8px; }
.pt-record-tools { gap: 10px; }
.pt-balance { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; min-width: 0; }
.pt-balance-summary { display: grid; gap: 6px; min-width: 0; }
.pt-balance-summary > .label { margin: 0; }
.pt-balance-amount { font-size: clamp(1.6rem, 3vw, 2.15rem); line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.pt-balance-controls { display: grid; gap: 10px; min-width: 0; }
.pt-balance-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.pt-balance-hint { margin: 0; text-align: right; line-height: 1.5; }
.pt-balance-cell { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; }
.pt-payment-invoices { display: grid; gap: 10px; }
.pt-payment-invoice { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; gap: 14px; align-items: center; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; }
.pt-payment-invoice:hover { background: var(--aqua-tint); border-color: var(--aqua-deep); }
.pt-payment-invoice > span { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.pt-payment-invoice > strong { overflow-wrap: anywhere; }
.pt-payment-invoice svg { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .pt-balance { display: grid; gap: 18px; padding: 18px; }
  .pt-balance-actions { justify-content: flex-start; }
  .pt-balance-actions .btn { flex: 1 1 150px; }
  .pt-balance-hint { text-align: left; }
  .daily-table .pt-balance-cell { justify-content: flex-start; }
}
.pt-record-content { min-width: 0; }
.pt-record-content > .pt-card { max-width: 100%; }
.pt-record-content .pt-more > .pt-card { border: 0; box-shadow: none; margin: 0; padding-top: 4px; }

/* Daily overview lists use the same labelled cards on phones and tablets.
   Only explicitly marked tables switch; forms and clinical editors do not. */
.daily-card-label { display: none; }
.daily-cell-value { min-width: 0; }
@media (max-width: 760px) {
  .daily-table.table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .daily-table > table.tbl { display: block; width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; }
  .daily-table > .tbl > thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); }
  .daily-table > .tbl > tbody { display: grid; gap: 14px; width: 100%; }
  .daily-table > .tbl > tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .daily-table > .tbl > tbody > tr:focus-visible { outline: 2px solid var(--aqua-deep); outline-offset: 3px; }
  .daily-table > .tbl > tbody > tr > td { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 0; border: 0; text-align: left; }
  .daily-table > .tbl > tbody > tr > td.daily-title { grid-column: 1 / -1; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .daily-table > .tbl > tbody > tr > td[data-label="Patient"],
  .daily-table > .tbl > tbody > tr > td[data-label="Customer"],
  .daily-table > .tbl > tbody > tr > td[data-label="Treatment"],
  .daily-table > .tbl > tbody > tr > td[data-label="Package"],
  .daily-table > .tbl > tbody > tr > td[data-label="Parameters"],
  .daily-table > .tbl > tbody > tr > td.daily-actions { grid-column: 1 / -1; }
  .daily-table .daily-card-label { display: block; color: var(--ink-faint); font-size: .76rem; line-height: 1.4; font-weight: 500; }
  .daily-table .daily-title > .daily-card-label { display: none; }
  .daily-table .daily-title .daily-cell-value { font-weight: 600; }
  .daily-table .daily-cell-value { max-width: 100%; line-height: 1.5; overflow-wrap: anywhere; }
  .daily-table .daily-cell-value .nowrap, .daily-table .daily-cell-value .pt-clip { white-space: normal; max-width: 100%; overflow: visible; text-overflow: clip; }
  .daily-table .daily-cell-value > .row { flex-wrap: wrap; }
  .daily-table .daily-title .avatar { flex: none; }
  .daily-table .daily-title .avatar + div { min-width: 0; flex: 1; }
  .daily-table .daily-actions .daily-cell-value, .daily-table .inv-row-act { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
  .daily-table .daily-actions .btn { min-height: 44px; }
}

.pt-record .pt-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .pt-record .pt-grid { grid-template-columns: minmax(0, 1fr); } }
.pt-record .pt-grid > .stack { min-width: 0; }
.pt-record .card-head .tiny { white-space: normal; }
.pt-card { padding: 22px; min-width: 0; }
.pt-card .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-card .card-head h3 { margin: 0; }
.pt-card > .row-between { flex-wrap: wrap; }
.pt-card > .row-between > span { min-width: 0; overflow-wrap: anywhere; }
.pt-card .list { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.pt-card .list-item .end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pt-card .list-item .body { min-width: 0; flex: 1; }
.pt-card .list-item .title { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.pt-card .list-item .sub { color: var(--ink-soft); font-size: .85rem; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.pt-items { max-width: 220px; overflow-wrap: anywhere; }
.pt-flaggrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
@media (max-width: 560px) { .pt-flaggrid { grid-template-columns: 1fr; } }
.pt-params { margin-top: 6px; }
.pt-pre { font: 600 .85rem/1.5 var(--font-body); white-space: pre-wrap; word-break: break-word; background: var(--aqua-tint); color: var(--ink);
  padding: 10px 12px; border-radius: var(--radius-sm); margin: 0; }
.pt-record .timeline .tl-body { min-width: 0; }
.pt-history-heading { display: grid; gap: 6px; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.pt-history-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pt-history-meta > * { min-width: 0; }
.pt-record .timeline .when { font-size: .82rem; color: var(--ink-faint); margin: 2px 0 4px; }
.pt-clip { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* statement of account */
.pt-soa { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.pt-soa-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.pt-soa-balance { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--ink); font-weight: 700; }
.pt-soa-balance .amount { font-size: 1.5rem; }

/* merge */
.pt-merge { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .pt-merge { grid-template-columns: 1fr; } }
.pt-merge-col { min-width: 0; padding: 16px; border-radius: var(--radius-sm); display: grid; gap: 10px; overflow-wrap: anywhere; }
.pt-merge-col .dl { font-size: .9rem; }

@media (max-width: 640px) {
  .pt-card { padding: 16px; }
  .pt-card .list-item { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .pt-card .list-item .body { flex: 1 1 calc(100% - 64px); }
  .pt-card .list-item .end { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
  .pt-filters .select { max-width: 100%; }
}
@media (max-width: 480px) {
  .pt-filters .pt-dates { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pt-filters .pt-dates .input { width: 100%; }
  .pt-dates > span { text-align: center; }
}

/* print only the statement when its modal is open */
@media print {
  body.pt-printing #app, body.pt-printing #drawer-root, body.pt-printing #toast-root { display: none !important; }
  body.pt-printing #modal-root { display: block !important; }
  body.pt-printing .modal { position: static; max-width: none; max-height: none; overflow: visible; width: auto; box-shadow: none; border: 0; transform: none; animation: none; padding: 0; }
  body.pt-printing .scrim { position: static; background: none; backdrop-filter: none; }
  body.pt-printing .modal .no-print, body.pt-printing .modal .iconbtn { display: none !important; }
  body.pt-printing .pt-soa { color: #000; }
}
