/* Patient Profile page styles */

/* Typography utilities */
.mb-4 { margin-bottom: var(--sp-4); }
.mb-0 { margin-bottom: 0; }
.text-xl { font-size: var(--fs-xl); }
.text-xs { font-size: var(--fs-xs); }

/* Layout utilities */
.span-2 { grid-column: 1 / -1; }

/* Clinical notes box */
.notes-box {
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.6;
}

/* Tab panels */
.tab-panel { padding: var(--sp-6) var(--pad) var(--pad); }
.tab-panel .grid { gap: var(--sp-6); }

/* Table wrapper */
.table-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-card .table { margin-bottom: 0; }

/* Stat value overrides */
.stat-value.text-xl { font-size: var(--fs-xl); }
.stat-delta.text-xs { font-size: var(--fs-xs); }

/* Patient head chips and actions */
.patient-head .chips { margin-top: var(--sp-3); }
.patient-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-inline-start: auto; min-width: 0; }

/* Tables inside a bordered wrapper: tighter edge padding than a full-bleed card table */
.table-card .table th:first-child, .table-card .table td:first-child { padding-inline-start: var(--sp-5); }
.table-card .table th:last-child, .table-card .table td:last-child { padding-inline-end: var(--sp-5); }

@media (max-width: 600px) {
  /* header buttons: a tidy 2-up grid, the main action full width */
  .patient-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .patient-actions > .btn-primary { grid-column: 1 / -1; }
  .patient-actions .btn, .patient-actions form .btn { width: 100%; }
  .table-card .table td:first-child, .table-card .table td:last-child { padding-inline-start: 0; padding-inline-end: 0; }
}

/* Profile photo and its upload controls under the avatar */
.photo-box { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.avatar-photo { width: 96px; height: 96px; object-fit: cover; background: var(--surface-2); }
.photo-box .avatar-lg { width: 96px; height: 96px; }
.photo-form { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.photo-form:focus-within label { outline: 2px solid var(--accent); outline-offset: 2px; }
.js .photo-save { display: none; }
.photo-box .field-error { max-width: 180px; text-align: center; }
.row-actions { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* Balance strip (D30): remaining or credit, standing discount, links to history and the printable record. */
.balance-strip { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-3) var(--pad); border-top: 1px solid var(--border-subtle); }
.money { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
