/* ==========================================================================
   Customer Detail Redesign — `.cd-` namespace
   --------------------------------------------------------------------------
   Visual restyle of /customers/detail/{customer}. Mirrors the shipped Staff
   Detail / Product Detail / Experience Detail / Store Product Detail chrome
   exactly — same shell, same hero card shape, same tab strip pattern, same
   tile typography. Tokens cloned 1:1 from `.sd-` so behaviour is uniform.
   See docs/CUSTOMER_DETAIL_REDESIGN_PLAN.md.
   ========================================================================== */

/* ----- Tokens (sibling to --sd- / --pd- / --bd-) ----- */
:root {
	--cd-navy: #003264;
	--cd-navy-700: #14457A;
	--cd-line: #eef0f4;
	--cd-line-strong: #dfe3e8;
	--cd-card-bg: #ffffff;
	--cd-page-bg: #f6f7f9;
	--cd-soft-bg: #f7f7f7;
	--cd-soft-bg-2: #f1f4f7;
	--cd-ink: #303233;
	--cd-ink-2: #444444;
	--cd-mute: #6d87a1;
	--cd-mute-2: #94a3b8;
	--cd-success: #16a34a;
	--cd-success-soft: #d8f1e4;
	--cd-warn: #d97706;
	--cd-warn-soft: #fff4e0;
	--cd-danger: #dc2626;
	--cd-danger-soft: #fde2dd;
	--cd-info: #00a3fa;
	--cd-info-soft: #bcdced;
	--cd-dash: #4a2fc9;
	--cd-dash-soft: #f4f0fe;
	--cd-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
	--cd-radius: 12px;
	--cd-radius-sm: 8px;
	--cd-radius-pill: 999px;
}

/* ----- Page shell ----- */
.cd-page {
	background: var(--cd-page-bg);
	min-height: 100%;
}

.cd-shell {
	padding: 24px 32px 12px;
	max-width: 1600px;
	margin: 0 auto;
}

@media (max-width: 991px) {
	.cd-shell { padding: 16px 16px 80px; }
}

/* ----- Header (back + breadcrumb + title + ID pill + Edit Customer + ⋯) ----- */
.cd-header {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 16px 32px;
	border-bottom: 1px solid var(--cd-line);
	background: var(--cd-card-bg);
}

.cd-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	min-width: 0;
}

.cd-breadcrumb {
	font-size: 13px;
	color: var(--cd-mute);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.cd-breadcrumb a { color: var(--cd-mute); text-decoration: none; }
.cd-breadcrumb a:hover { color: var(--cd-navy); text-decoration: underline; }
.cd-breadcrumb-sep { color: var(--cd-mute-2); }

.cd-title {
	font-size: 20px;
	font-weight: 600;
	color: var(--cd-ink);
	line-height: 26px;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 480px;
}

.cd-id-pill {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border: 1px solid var(--cd-line-strong);
	border-radius: var(--cd-radius-pill);
	font-size: 12px;
	font-weight: 500;
	color: var(--cd-mute);
	background: var(--cd-card-bg);
	white-space: nowrap;
}

.cd-header-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* ----- Hero card (single card containing avatar + name + sub-line + tiles + CTAs) ----- */
.cd-hero {
	display: flex;
	align-items: stretch;
	gap: 20px;
	padding: 20px;
	background: var(--cd-card-bg);
	border: 1px solid var(--cd-line);
	border-radius: var(--cd-radius);
	box-shadow: var(--cd-card-shadow);
	margin-bottom: 16px;
}

/* Left block — avatar + name + sub-line */
.cd-hero-identity {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	min-width: 0;
	flex: 1 1 auto;
}

.cd-avatar-wrap {
	position: relative;
	flex-shrink: 0;
}

.cd-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 600;
	color: #fff;
	user-select: none;
	letter-spacing: 0.5px;
}

.cd-hero-namebox {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.cd-hero-name {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	font-size: 22px;
	font-weight: 600;
	color: var(--cd-ink);
	line-height: 1.2;
	margin: 0;
}

.cd-hero-subline {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 13px;
	color: var(--cd-mute);
	line-height: 1.4;
}
.cd-hero-subline a { color: var(--cd-mute); text-decoration: none; }
.cd-hero-subline a:hover { color: var(--cd-navy); text-decoration: underline; }

.cd-hero-subline-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.cd-hero-subline-sep {
	color: var(--cd-mute-2);
}

.cd-hero-subline-strong {
	color: var(--cd-ink);
	font-weight: 500;
}

/* Hero metric tiles — 3 tiles inside the card (Lifetime value, Avg. booking,
   Next booking), separated from identity by a single border-left. Balance
   was removed because the 4th column crushed at 1378–1500px. */
.cd-hero-tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	flex: 1 1 auto;
	align-items: center;
	border-left: 1px solid var(--cd-line);
	padding-left: 20px;
	min-width: 0;
}

.cd-tile {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.cd-tile-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--cd-mute);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 14px;
	/* Allow long single-word labels (e.g. "OUTSTANDING") to wrap to 2 lines
	   at the narrow 1378–1500px viewport where tile columns are tight,
	   instead of getting clipped by the next column or the action buttons. */
	overflow-wrap: anywhere;
	word-break: break-word;
}

.cd-tile-value {
	font-size: 14px;
	font-weight: 600;
	color: var(--cd-ink);
	line-height: 18px;
	/* Allow longer values (e.g. "15 May · in 5 days") to wrap to 2 lines
	   inside narrow tile columns at 1378–1500px instead of getting clipped
	   to "15 May · t" by overflow:hidden + text-overflow:ellipsis. The
	   typical values ($1,267.16 / $97.47 / Today / 15 May · in 5 days)
	   all fit cleanly on 1–2 lines now. */
	overflow-wrap: anywhere;
	word-break: break-word;
}
.cd-tile-value.success { color: var(--cd-success); }
.cd-tile-value.warn    { color: var(--cd-warn); }
.cd-tile-value.danger  { color: var(--cd-danger); }

.cd-tile-value .cd-tile-mute {
	font-weight: 500;
	color: var(--cd-mute);
	font-size: 12px;
}

.cd-tile-sub {
	color: var(--cd-mute);
	font-size: 11px;
	font-weight: 400;
	white-space: nowrap;
}

.cd-hero-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
	align-items: center;
}

/* ----- Buttons (mirrors .sd-btn) ----- */
.cd-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: var(--cd-radius-sm);
	font-size: 13px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 120ms, border-color 120ms;
	text-decoration: none;
	white-space: nowrap;
	background: transparent;
}
.cd-btn-primary {
	background: var(--cd-navy);
	color: #fff;
}
.cd-btn-primary:hover { background: var(--cd-navy-700); color: #fff; }

.cd-btn-secondary {
	background: var(--cd-card-bg);
	color: var(--cd-ink);
	border-color: var(--cd-line-strong);
}
.cd-btn-secondary:hover {
	background: var(--cd-soft-bg);
	border-color: var(--cd-mute-2);
	color: var(--cd-ink);
}

.cd-btn-ghost {
	background: transparent;
	color: var(--cd-mute);
}
.cd-btn-ghost:hover { background: var(--cd-soft-bg); color: var(--cd-ink); }

.cd-btn-sm { padding: 6px 12px; font-size: 12px; }

.cd-btn .cd-icon-svg { width: 14px; height: 14px; flex-shrink: 0; }
.cd-btn-secondary .cd-icon-svg { color: var(--cd-navy); }
.cd-btn-primary .cd-icon-svg { color: #fff; }

.cd-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: var(--cd-radius-sm);
	background: var(--cd-card-bg);
	border: 1px solid var(--cd-line-strong);
	color: var(--cd-mute);
	cursor: pointer;
}
.cd-icon-btn:hover {
	background: var(--cd-soft-bg);
	border-color: var(--cd-mute-2);
	color: var(--cd-ink);
}
.cd-icon-btn img, .cd-icon-btn svg { width: 14px; height: 14px; }

@media (max-width: 575px) {
	.cd-icon-btn { min-width: 44px; min-height: 44px; }
}

/* ----- ⋯ menu dropdown ----- */
.cd-menu-wrap { position: relative; }
.cd-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 200px;
	background: var(--cd-card-bg);
	border: 1px solid var(--cd-line-strong);
	border-radius: var(--cd-radius-sm);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
	padding: 6px;
	z-index: 50;
}
.cd-menu-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 6px;
	font-size: 13px;
	color: var(--cd-ink);
	cursor: pointer;
	background: transparent;
	border: 0;
	width: 100%;
	text-align: left;
	text-decoration: none;
}
.cd-menu-item:hover { background: var(--cd-soft-bg); }
.cd-menu-item.danger { color: var(--cd-danger); }
.cd-menu-item.danger:hover { background: var(--cd-danger-soft); color: var(--cd-danger); }

/* ----- Tab strip (transparent, just border-bottom) ----- */
.cd-tabs-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	border-bottom: 1px solid var(--cd-line);
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.cd-tabs {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.cd-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	font-size: 14px;
	font-weight: 500;
	color: var(--cd-mute);
	cursor: pointer;
	transition: color 120ms, border-color 120ms;
	margin-bottom: -1px;
}
.cd-tab:hover { color: var(--cd-ink); }
.cd-tab.active {
	color: var(--cd-navy);
	border-bottom-color: var(--cd-navy);
	font-weight: 600;
}

.cd-tab-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 18px;
	padding: 0 6px;
	border-radius: var(--cd-radius-pill);
	background: var(--cd-line);
	color: var(--cd-mute);
	font-size: 11px;
	font-weight: 600;
}
.cd-tab.active .cd-tab-badge {
	background: var(--cd-navy);
	color: #fff;
}
.cd-tab-badge.alert {
	background: var(--cd-danger-soft);
	color: var(--cd-danger);
}
.cd-tab.active .cd-tab-badge.alert {
	background: var(--cd-danger);
	color: #fff;
}

/* ----- AI band ----- */
.cd-dash-ai-band {
	margin-bottom: 16px;
}
.cd-dash-ai-row {
	display: flex;
	align-items: center;
	gap: 8px;
}
.cd-dash-ai-insight { flex: 1 1 auto; min-width: 0; }
.cd-dash-ai-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: transparent;
	color: var(--cd-mute);
	cursor: pointer;
	border: 0;
	flex-shrink: 0;
}
.cd-dash-ai-chevron:hover { background: var(--cd-soft-bg); color: var(--cd-ink); }

/* ----- Card chrome ----- */
.cd-card {
	background: var(--cd-card-bg);
	border: 1px solid var(--cd-line);
	border-radius: var(--cd-radius);
	box-shadow: var(--cd-card-shadow);
	overflow: hidden;
}
.cd-card + .cd-card { margin-top: 16px; }

.cd-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid var(--cd-line);
}
.cd-card-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--cd-ink);
	margin: 0;
	letter-spacing: 0.2px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.cd-card-title-meta {
	color: var(--cd-mute);
	font-weight: 400;
	font-size: 12px;
}
.cd-card-body         { padding: 18px; }
.cd-card-body-tight   { padding: 0; }
.cd-card-body-tight > * { padding: 14px 18px; border-bottom: 1px solid var(--cd-line); }
.cd-card-body-tight > *:last-child { border-bottom: 0; }
.cd-card-body-flat    { padding: 0; }

.cd-card-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	background: transparent;
	color: var(--cd-mute);
	font-size: 12px;
	font-weight: 500;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
}
.cd-card-action:hover {
	background: var(--cd-soft-bg);
	color: var(--cd-ink);
	border-color: var(--cd-line-strong);
}
.cd-card-action.is-active {
	background: var(--cd-dash-soft);
	color: var(--cd-dash);
	border-color: transparent;
}
.cd-card-action-icon { width: 14px; height: 14px; }

/* ----- Overview layout ----- */
.cd-overview-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}
@media (max-width: 991px) {
	.cd-overview-grid { grid-template-columns: 1fr; }
}

/* ----- Contact card ----- */
.cd-contact-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 24px;
}
@media (max-width: 575px) {
	.cd-contact-grid { grid-template-columns: 1fr; }
}
.cd-contact-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.cd-contact-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--cd-mute);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.cd-contact-value {
	font-size: 14px;
	color: var(--cd-ink);
	font-weight: 500;
	word-break: break-word;
}
.cd-contact-value-muted { color: var(--cd-mute); font-weight: 400; }
.cd-contact-multiline { white-space: pre-line; }

.cd-contact-input,
.cd-contact-input:focus {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--cd-line-strong);
	border-radius: 8px;
	background: var(--cd-card-bg);
	font-size: 14px;
	color: var(--cd-ink);
	outline: none;
}
.cd-contact-input:focus {
	border-color: var(--cd-navy);
	box-shadow: 0 0 0 3px rgba(0, 50, 100, 0.08);
}
.cd-contact-input.is-invalid { border-color: var(--cd-danger); }

.cd-contact-input-group {
	display: flex;
	gap: 6px;
}
.cd-contact-input-group select { width: 90px; flex: none; }
.cd-contact-input-group .cd-contact-input { flex: 1; }

.cd-contact-edit-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 4px;
}

/* ----- Custom Fields ----- */
.cd-cf-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 24px;
}
@media (max-width: 575px) { .cd-cf-grid { grid-template-columns: 1fr; } }

/* ----- Most-booked ----- */
.cd-most-booked-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--cd-line);
}
.cd-most-booked-row:last-child { border-bottom: 0; }
.cd-most-booked-icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 600;
}
.cd-most-booked-icon.rental     { background: rgba(0, 50, 100, 0.08); color: var(--cd-navy); }
.cd-most-booked-icon.experience { background: var(--cd-success-soft); color: var(--cd-success); }
.cd-most-booked-icon.store      { background: var(--cd-warn-soft); color: var(--cd-warn); }

/* Real product/experience/store-product thumbnail. Same footprint as the
   letter-icon fallback above so row alignment stays consistent. */
.cd-most-booked-thumb {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--cd-soft-bg);
	border: 1px solid var(--cd-line);
}

.cd-most-booked-main { flex: 1; min-width: 0; }
.cd-most-booked-name {
	font-size: 13px;
	font-weight: 500;
	color: var(--cd-ink);
	text-decoration: none;
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cd-most-booked-name:hover { color: var(--cd-navy); }
.cd-most-booked-meta {
	font-size: 11px;
	color: var(--cd-mute);
	margin-top: 2px;
}
.cd-most-booked-count {
	font-size: 12px;
	font-weight: 600;
	color: var(--cd-mute);
	flex-shrink: 0;
}

/* ----- Filter pill row ----- */
.cd-pill-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}
.cd-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: var(--cd-radius-pill);
	background: var(--cd-card-bg);
	border: 1px solid var(--cd-line-strong);
	color: var(--cd-mute);
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
}
.cd-pill:hover { background: var(--cd-soft-bg); color: var(--cd-ink); }
.cd-pill.active { background: var(--cd-navy); color: #fff; border-color: var(--cd-navy); }
.cd-pill .cd-pill-count { font-size: 11px; color: var(--cd-mute-2); }
.cd-pill.active .cd-pill-count { color: rgba(255,255,255,0.7); }

/* ----- Communication ----- */
.cd-comm-list { display: flex; flex-direction: column; gap: 0; }
.cd-comm-row {
	display: grid;
	grid-template-columns: 32px 1fr auto;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--cd-line);
}
.cd-comm-row:last-child { border-bottom: 0; }
.cd-comm-channel-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: var(--cd-soft-bg);
	color: var(--cd-mute);
	flex-shrink: 0;
}
.cd-comm-channel-icon.email { background: rgba(74, 47, 201, 0.10); color: var(--cd-dash); }
.cd-comm-channel-icon.sms   { background: var(--cd-info-soft); color: var(--cd-info); }
.cd-comm-main { min-width: 0; }
.cd-comm-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 4px;
	font-size: 11px;
	color: var(--cd-mute);
}
.cd-comm-channel-pill {
	display: inline-flex;
	align-items: center;
	padding: 1px 7px;
	border-radius: var(--cd-radius-pill);
	background: var(--cd-soft-bg);
	color: var(--cd-mute);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}
.cd-comm-status-pill {
	display: inline-flex;
	align-items: center;
	padding: 1px 7px;
	border-radius: var(--cd-radius-pill);
	background: var(--cd-success-soft);
	color: var(--cd-success);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}
.cd-comm-status-pill.failed    { background: var(--cd-danger-soft); color: var(--cd-danger); }
.cd-comm-status-pill.queued    { background: var(--cd-warn-soft); color: var(--cd-warn); }
.cd-comm-status-pill.sending   { background: var(--cd-warn-soft); color: var(--cd-warn); }
.cd-comm-status-pill.delivered { background: var(--cd-success-soft); color: var(--cd-success); }
.cd-comm-subject {
	font-size: 14px;
	font-weight: 600;
	color: var(--cd-ink);
	margin: 0;
}
.cd-comm-preview {
	margin-top: 4px;
	font-size: 13px;
	color: var(--cd-mute);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.cd-comm-actions {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	flex-shrink: 0;
}
.cd-comm-action {
	width: 28px; height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	background: transparent;
	border: 0;
	color: var(--cd-mute);
	cursor: pointer;
}
.cd-comm-action:hover { background: var(--cd-soft-bg); color: var(--cd-ink); }

/* ----- Activity ----- */
.cd-activity-list { display: flex; flex-direction: column; gap: 0; }
.cd-activity-row {
	display: grid;
	grid-template-columns: 28px 1fr;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--cd-line);
}
.cd-activity-row:last-child { border-bottom: 0; }
.cd-activity-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--cd-soft-bg);
	color: var(--cd-mute);
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 600;
}
.cd-activity-icon svg {
	width: 14px;
	height: 14px;
	display: block;
}
.cd-activity-icon.bookings       { background: rgba(0, 50, 100, 0.08); color: var(--cd-navy); }
.cd-activity-icon.payments       { background: var(--cd-success-soft); color: var(--cd-success); }
.cd-activity-icon.communications { background: rgba(74, 47, 201, 0.10); color: var(--cd-dash); }
.cd-activity-icon.forms          { background: var(--cd-warn-soft); color: var(--cd-warn); }
.cd-activity-icon.note           { background: var(--cd-soft-bg); color: var(--cd-mute); }

.cd-activity-main { min-width: 0; }
.cd-activity-label {
	font-size: 14px;
	color: var(--cd-ink);
	font-weight: 500;
	margin: 0;
}
.cd-activity-meta {
	margin-top: 2px;
	font-size: 12px;
	color: var(--cd-mute);
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.cd-activity-meta a { color: var(--cd-navy); text-decoration: none; }
.cd-activity-meta a:hover { text-decoration: underline; }
.cd-activity-meta-sep { color: var(--cd-mute-2); }
.cd-activity-pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding-top: 14px;
	font-size: 12px;
	color: var(--cd-mute);
}

/* ----- Notes ----- */
.cd-notes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}
.cd-note {
	position: relative;
	background: var(--cd-soft-bg);
	border-radius: var(--cd-radius-sm);
	border: 1px solid var(--cd-line);
	padding: 14px 14px 28px;
	min-height: 100px;
	display: flex;
	flex-direction: column;
}
.cd-note-text {
	font-size: 13px;
	line-height: 1.5;
	color: var(--cd-ink-2);
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}
.cd-note-timestamp {
	position: absolute;
	bottom: 6px;
	right: 10px;
	font-size: 11px;
	color: var(--cd-mute);
}

/* ----- Forms & Surveys (legacy partial host) -----
   waivers.blade.php / surveys.blade.php wrap their content in
   `.waivers-section.mx-4.mt-4` + `.customer-personel-details` (margin-top:
   2rem, white bg) + `.row.p-4` (24px padding). Inside the new cd-card chrome
   that cascades into a giant block with a small title pinned top-left and
   ~150px of empty space below. Strip the nested margins + tighten padding so
   the legacy partial sits flush in cd-card-body-flat. */
.cd-card-body-flat .waivers-section,
.cd-card-body-flat .surveys-section {
	margin: 0 !important;
}
.cd-card-body-flat .customer-personel-details {
	margin-top: 0 !important;
	background: transparent;
	border-radius: 0;
}
.cd-card-body-flat .customer-personel-details .row.p-4 {
	padding: 16px 20px !important;
}
.cd-card-body-flat .customer-personel-details-title {
	font-size: 15px;
	color: var(--cd-ink);
	margin: 0 !important;
}
.cd-card-body-flat .customer-personel-details .col-12.mb-3 {
	margin-bottom: 12px !important;
}
.cd-card-body-flat .customer-personel-details .col-12 > p {
	color: var(--cd-mute);
	font-size: 13px;
	margin: 0;
}

/* ----- Notes (legacy partial host) -----
   The legacy <livewire:customers.customer-details.notes> partial renders a
   4-col CSS grid (.notes-grid-container) plus its own "Note" section title.
   When hosted inside the cd-card chrome that gave us a double-header and a
   single orphaned cell. Overrides below flatten the grid into a vertical
   stack, hide the duplicate title, and re-skin the note tiles to match cd-. */
.cd-notes-host .cd-card-body-flat .notes-section {
	margin: 0 !important;
	padding: 14px 18px 18px !important;
	background: transparent;
	border-radius: 0;
}
.cd-notes-host .cd-card-body-flat .notes-section.mx-4 { margin-left: 0 !important; margin-right: 0 !important; }
.cd-notes-host .cd-card-body-flat .notes-section.p-4 { padding: 14px 18px 18px !important; }
.cd-notes-host .cd-card-body-flat .notes-section-title { display: none; }
.cd-notes-host .cd-card-body-flat .notes-grid-container {
	display: flex;
	flex-direction: column;
	grid-template-columns: none;
	gap: 10px;
	margin-top: 0 !important;
}
.cd-notes-host .cd-card-body-flat .note-item.grid-item {
	background: var(--cd-soft-bg);
	color: var(--cd-ink);
	border-radius: 12px;
	padding: 12px 12px 8px;
	height: auto;
	min-height: 86px;
	text-align: left;
	border: 1px solid var(--cd-line);
}
.cd-notes-host .cd-card-body-flat .note-item textarea {
	background: #fff;
	border: 1px solid var(--cd-line-strong);
	border-radius: 8px;
	font-size: 13px;
	padding: 8px 10px;
	min-height: 64px;
	color: var(--cd-ink);
}
.cd-notes-host .cd-card-body-flat .note-item p {
	font-size: 13px;
	line-height: 1.5;
	color: var(--cd-ink-2);
	margin: 0;
	padding-right: 36px;
	white-space: pre-wrap;
	word-break: break-word;
}
.cd-notes-host .cd-card-body-flat .note-item-input-save-btn,
.cd-notes-host .cd-card-body-flat .note-item-input-update-btn {
	background: var(--cd-navy);
	color: #fff;
	border-radius: var(--cd-radius-pill);
	padding: 6px 16px;
	font-size: 13px;
	font-weight: 600;
	border: none;
}
.cd-notes-host .cd-card-body-flat .note-item-input-save-btn:hover,
.cd-notes-host .cd-card-body-flat .note-item-input-update-btn:hover {
	background: var(--cd-navy-700);
}
.cd-notes-host .cd-card-body-flat .note-item-input-delete-btn {
	color: var(--cd-danger);
	font-size: 13px;
	font-weight: 500;
}
.cd-notes-host .cd-card-body-flat .notes-section-timestamp {
	color: var(--cd-mute);
	font-size: 11px;
}
.cd-notes-host .cd-card-body-flat .notes-section-edit-button img,
.cd-notes-host .cd-card-body-flat .note-item-input-cross-btn img {
	width: 14px;
	height: 14px;
	opacity: 0.7;
}
.cd-notes-host .cd-card-body-flat .notes-section-edit-button:hover img,
.cd-notes-host .cd-card-body-flat .note-item-input-cross-btn:hover img {
	opacity: 1;
}

/* ----- Empty states ----- */
.cd-empty-tab {
	padding: 48px 24px;
	text-align: center;
}
.cd-empty-tab-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--cd-ink);
	margin-bottom: 6px;
}
.cd-empty-tab-body {
	font-size: 13px;
	color: var(--cd-mute);
	max-width: 400px;
	margin: 0 auto 14px;
}
.cd-empty-inline {
	padding: 14px;
	font-size: 13px;
	color: var(--cd-mute);
	text-align: center;
	background: var(--cd-soft-bg);
	border-radius: var(--cd-radius-sm);
}

/* ----- Help banner spacing inside tab body ----- */
.cd-help-banner-wrap { padding: 18px 0 0; }

/* ----- Delete modal helper ----- */
.cd-modal-trash {
	width: 56px;
	height: 56px;
	margin: 0 auto 10px;
	display: block;
}

/* ----- Responsive ----- */
/* At narrower-than-wide desktops, collapse hero secondary CTAs to icon-only
   so the metric tiles keep their breathing room. The "+ New booking" primary
   stays full-width because it's the page's only primary action.
   Threshold 1500px: typical 1378–1440px laptops fall under this so labels
   collapse and tiles stay legible. */
@media (max-width: 1500px) {
	.cd-hero-actions .cd-btn-secondary span { display: none; }
	.cd-hero-actions .cd-btn-secondary { padding: 9px 10px; }
}

@media (max-width: 991px) {
	.cd-hero { flex-direction: column; align-items: stretch; }
	.cd-hero-tiles { border-left: 0; padding-left: 0; border-top: 1px solid var(--cd-line); padding-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cd-hero-actions { justify-content: flex-end; }
	.cd-hero-actions .cd-btn-secondary span { display: inline; }
	.cd-hero-actions .cd-btn-secondary { padding: 9px 16px; }
}

@media (max-width: 768px) {
	.cd-header { padding: 10px 14px; }
	.cd-header-right .cd-btn span { display: inline; }
	.cd-tab { padding: 10px 10px; font-size: 13px; }
	.cd-content { padding: 0; }
}

@media print {
	.cd-header, .cd-tabs-bar, .cd-dash-ai-band, .cd-hero-actions { display: none !important; }
}
