/* Large restaurant customer directories: bounded pages, quiet rows, one clear drill-down. */
.customer-directory, .customer-profile { min-width: 0; }
.customer-directory-filters.card { display: grid; grid-template-columns: minmax(16rem, 2fr) minmax(10rem, 1fr) minmax(9rem, 1fr) minmax(5rem, .5fr) auto; gap: var(--space-4); align-items: end; padding: var(--space-5); }
.customer-directory-filters > div { min-width: 0; }
.customer-directory-filters label { display: block; margin-bottom: var(--space-2); font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.customer-search-input { position: relative; }
.customer-search-input > .ico { position: absolute; inset-inline-start: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.customer-search-input input { padding-inline-start: calc(var(--space-5) + var(--space-3)); }
.customer-filter-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.customer-directory-result { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); margin-block: var(--space-4); font-size: var(--text-sm); }
.customer-directory-result p { margin: 0; font-weight: var(--fw-semibold); }
.customer-directory-result > span { color: var(--muted); }
.customer-directory-table.card { padding: 0; overflow: hidden; }
.customer-records { width: 100%; table-layout: fixed; border-collapse: collapse; }
.customer-records th { padding: var(--space-3) var(--space-4); background: var(--tint-row); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: start; border-bottom: 1px solid var(--line); }
.customer-records td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); vertical-align: middle; font-size: var(--text-sm); overflow-wrap: anywhere; }
.customer-records tbody tr:nth-child(even) { background: var(--tint-row); }
.customer-records tbody tr:hover, .customer-records tbody tr:focus-within { background: var(--fill-muted); }
.customer-records tbody tr:last-child td { border-bottom: 0; }
.customer-records td small, .customer-person > span { display: block; margin-top: var(--space-1); color: var(--muted); font-size: var(--text-xs); }
.customer-person-link { display: inline-block; padding-block: var(--space-1); color: var(--ink); text-decoration: none; }
.customer-person-link:hover { color: var(--brand-dark); text-decoration: underline; }
.customer-records th:nth-child(1) { width: 24%; }
.customer-records th:nth-child(2) { width: 14%; }
.customer-records th:nth-child(3) { width: 22%; }
.customer-records th:nth-child(4) { width: 13%; }
.customer-records th:nth-child(5) { width: 7%; }
.customer-records th:nth-child(6) { width: 14%; }
.customer-records th:nth-child(7) { width: 6%; }
.customer-phone { color: var(--ink-soft); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.customer-order-count, .customer-order-total { font-variant-numeric: tabular-nums; }
.customer-consent { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--muted); }
.customer-consent::before { content: ''; width: var(--space-2); height: var(--space-2); border-radius: var(--pill); background: var(--faint); flex-shrink: 0; }
.customer-consent.is-consented { color: var(--ok); }
.customer-consent.is-consented::before { background: var(--ok); }
.customer-open { text-align: end; }
.customer-open .btn { padding-inline: var(--space-2); }
.customer-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-5); font-size: var(--text-sm); }
.customer-pagination > div { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.customer-page-position { padding-inline: var(--space-2); color: var(--muted); }
.customer-back { display: inline-flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-5); font-weight: var(--fw-semibold); }
.customer-profile-contact { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); color: var(--muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.customer-profile-contact > span { min-width: 0; }
.customer-profile-contact .customer-phone { display: inline-flex; align-items: center; gap: var(--space-2); }
.customer-profile-summary.card { display: grid; grid-template-columns: minmax(0,.6fr) minmax(0,1fr) minmax(0,1fr); gap: var(--space-5); padding: var(--space-5); margin: 0; }
.customer-profile-summary > div + div { border-inline-start: 1px solid var(--line); padding-inline-start: var(--space-5); }
.customer-profile-summary dt { color: var(--muted); font-size: var(--text-sm); }
.customer-profile-summary dd { margin: var(--space-2) 0 0; font-weight: var(--fw-bold); font-size: var(--text-xl); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.customer-profile-summary dd > span { display: block; }
.customer-profile-nav { display: flex; flex-wrap: wrap; gap: var(--space-5); padding-block: var(--space-5); font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.customer-profile-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(18rem,1fr); gap: var(--space-5); align-items: start; }
.customer-profile-layout > *, .customer-profile-sidebar > * { min-width: 0; }
.customer-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.customer-section-head h2 { margin: 0; font-size: var(--text-lg); }
.customer-section-head > span { color: var(--muted); font-size: var(--text-sm); }
.customer-order-records .badge { white-space: normal; }
.customer-profile-sidebar { display: grid; gap: var(--space-5); }
.customer-profile-sidebar > .card + .card { margin-top: 0; }
.customer-profile-editor h2 { font-size: var(--text-lg); }
.customer-profile-editor summary { display: flex; gap: var(--space-2); align-items: center; cursor: pointer; font-weight: var(--fw-semibold); color: var(--ink); padding-block: var(--space-3); }
.customer-profile-editor summary::after { content: '+'; margin-inline-start: auto; color: var(--muted); }
.customer-profile-editor details[open] summary::after { content: '−'; }
.customer-profile-editor .care-form { border-top: 1px solid var(--line); padding-top: var(--space-3); }
.customer-note-preview { border-top: 1px solid var(--line); padding-top: var(--space-4); margin-top: var(--space-4); }
.customer-note-preview h3 { font-size: var(--text-sm); margin-bottom: var(--space-2); }
.customer-note-preview p { color: var(--ink-soft); font-size: var(--text-sm); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12rem; overflow-y: auto; }
.customer-points { display: inline-block; margin-inline-start: var(--space-2); font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.customer-profile-history, .customer-profile-editor { scroll-margin-block-start: calc(var(--space-8) + var(--space-6)); }
@media (max-width: 85rem) {
    .customer-directory-filters.card { grid-template-columns: minmax(0,2fr) minmax(0,1fr) minmax(0,1fr); }
    .customer-directory-search { grid-column: span 2; }
    .customer-filter-actions { justify-self: end; }
    .customer-profile-layout { grid-template-columns: minmax(0,1fr); }
    .customer-profile-sidebar { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 64rem) {
    .customer-records, .customer-records tbody { display: block; }
    .customer-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .customer-records tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); position: relative; padding: var(--space-4); gap: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
    .customer-records tbody tr:last-child { border-bottom: 0; }
    .customer-records td { padding: 0; border: 0; }
    .customer-records tbody tr:last-child td { border: 0; }
    .customer-records td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--muted); margin-bottom: var(--space-1); }
    .customer-records .customer-person { grid-column: 1 / -1; padding-inline-end: var(--space-8); }
    .customer-order-records .customer-person { padding-inline-end: 0; }
    .customer-records .customer-open { position: absolute; inset-inline-end: var(--space-3); inset-block-start: var(--space-3); }
    .customer-records td.customer-open::before { display: none; }
    .customer-profile-summary dd { font-size: var(--text-lg); }
}
@media (max-width: 40rem) {
    .customer-directory-filters.card { grid-template-columns: repeat(2,minmax(0,1fr)); padding: var(--space-4); gap: var(--space-3); }
    .customer-directory-search, .customer-filter-actions { grid-column: 1 / -1; }
    .customer-filter-actions { justify-self: stretch; }
    .customer-filter-actions .btn { flex: 1; }
    .customer-profile-sidebar { grid-template-columns: minmax(0,1fr); }
    .customer-profile-summary.card { grid-template-columns: minmax(0,1fr); gap: var(--space-4); padding: var(--space-4); }
    .customer-profile-summary > div + div { border-inline-start: 0; border-top: 1px solid var(--line); padding-inline-start: 0; padding-top: var(--space-4); }
    .customer-pagination { align-items: start; }
    .customer-pagination > div { width: 100%; }
    .customer-directory-result { align-items: start; }
}
.customer-history-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.customer-phone-history-warning p { max-width: 100ch; }
.customer-order-records th:nth-child(1) { width: 18%; }
.customer-order-records th:nth-child(2) { width: 16%; }
.customer-order-records th:nth-child(3) { width: 23%; }
.customer-order-records th:nth-child(4) { width: 15%; }
.customer-order-records th:nth-child(5) { width: 17%; }
.customer-order-records th:nth-child(6) { width: 11%; }
