/* Customer workspace: shared cards and compact, reachable actions in either tablet orientation. */
.customer-record-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.customer-record-title { min-width: 0; flex: 1 1 300px; }
.customer-record-title h1, .customer-record-title p { overflow-wrap: anywhere; }
.customer-record-attribution { flex: 1 0 100%; }
.customer-record-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.customer-record-actions .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
.customer-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.customer-detail-grid .card-body, .customer-address-panel .card-body { padding: 24px; }
.customer-address-panel > summary { padding: 20px 24px; min-height: 64px; color: var(--hbl-green); cursor: pointer; }
.customer-address-panel [data-customer-addresses] { margin-top: 0 !important; }
.customer-address-panel .form-check { min-height: 48px; display: flex; gap: 10px; align-items: center; }
.customer-address-panel .form-check-input { flex-shrink: 0; }
.customer-save-bar { justify-content: flex-end; }
.customer-save-bar [role=status] { margin-right: auto; }
.customer-tab-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.customer-tab-heading h2 { margin-bottom: 6px; }
.customer-activity-search { max-width: 520px; width: 100%; }
.customer-activity-list { display: grid; gap: 16px; padding: 0; margin: 20px 0; list-style: none; }
.customer-activity-list > li { min-width: 0; }
.customer-activity-card { height: 100%; display: flex; flex-direction: column; gap: 16px; }
.customer-activity-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.customer-activity-card header > div { min-width: 0; }
.customer-activity-card h3 { overflow-wrap: anywhere; }
.customer-activity-card .customer-facts { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.customer-activity-card .btn { align-self: flex-start; margin-top: auto; }
.customer-activity-card p { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.customer-activity-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.customer-activity-card:has(.customer-activity-full[open]) > .customer-activity-preview { display: none; }
.customer-activity-full summary { min-height: 48px; color: var(--hbl-green); font-weight: 600; }
.record-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 12px; }
.record-pagination .btn { min-height: 48px; min-width: 90px; }
.customer-empty { padding: 28px; border: 1px solid var(--hbl-border); border-radius: 4px; background: #fff; color: var(--hbl-muted); }
.customer-original-section { background: #fff; border: 1px solid var(--hbl-border); border-radius: 4px; padding: 24px; margin-bottom: 20px; }
.customer-original-owner { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--hbl-border); }
.customer-original-owner:first-child { margin-top: 0; }
.customer-original-section .attachment-gallery { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.customer-original-section .attachment-preview { height: 210px; border-radius: 3px; }
.customer-original-section figure { padding: 12px; border: 1px solid var(--hbl-border); border-radius: 4px; }
.customer-original-section figure > a { display: block; }
.customer-original-section .attachment-caption { font-size: .9rem; margin-top: 12px; }
.history-entry { padding: 0 20px; margin-bottom: 12px; background: #fff; border: 1px solid var(--hbl-border); border-radius: 4px; }
.history-entry > summary { min-height: 64px; padding-block: 16px; }
.history-entry summary strong, .history-entry summary span { overflow-wrap: anywhere; }
.history-entry summary small { display: block; color: var(--hbl-muted); margin-top: 4px; }
.history-change { padding: 16px 0; border-top: 1px solid var(--hbl-border); }
.history-values { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.history-values > div { padding: 12px; background: var(--hbl-light); border: 1px solid var(--hbl-border); }
.history-values dt { font-size: .8rem; color: var(--hbl-muted); font-weight: 500; }
.history-values dd { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-device-edits { padding-bottom: 16px; }
.history-device-edits > summary { min-height: 48px; color: var(--hbl-green); }

@media (min-width: 1000px) and (orientation: landscape), (min-width: 1400px) {
    .customer-detail-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
    .customer-activity-list:not([data-activity-list="order"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-address-panel [data-customer-addresses] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
    .customer-address-panel .form-check { grid-column: 1 / -1; grid-row: 1; margin: 0 !important; }
    .customer-address-panel [data-customer-addresses]:has([data-shipping-address][hidden]) { grid-template-columns: minmax(0, 1fr); }
    .customer-address-panel [data-customer-addresses]:has([data-shipping-address][hidden]) [data-billing-address] .col-12 { width: 50%; }
}
@media (max-width: 1199.98px) and (orientation: portrait) {
    .record-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .customer-record-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 599.98px) {
    .record-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-record-actions { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-record-actions > :first-child { grid-column: 1 / -1; }
    .customer-detail-grid .card-body, .customer-address-panel .card-body, .customer-original-section { padding: 16px; }
    .customer-address-panel > summary { padding: 16px; }
    .history-values { grid-template-columns: minmax(0, 1fr); }
    .customer-original-section .attachment-gallery { grid-template-columns: minmax(0, 1fr); }
}
