:root {
	--phc-bg: #f5fbff;
	--phc-panel: #ffffff;
	--phc-soft: #edf7fb;
	--phc-soft-2: #f4f9ff;
	--phc-muted: #5f7284;
	--phc-border: #dfeaf3;
	--phc-accent: #0a6d7d;
	--phc-accent-2: #1189a5;
	--phc-accent-soft: rgba(13, 110, 137, 0.12);
	--phc-text: #102a3c;
	--phc-radius: 18px;
	--phc-shadow: 0 22px 50px rgba(6, 31, 48, 0.16);
	--phc-shadow-soft: 0 10px 24px rgba(12, 58, 81, 0.08);
}

.phc-modal-overlay {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: linear-gradient(rgba(7, 15, 25, 0.52), rgba(7, 15, 25, 0.52));
	z-index: 2000;
	padding: 24px;
}

.phc-modal-content {
	width: 100%;
	max-width: 960px;
	background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
	border-radius: 22px;
	box-shadow: var(--phc-shadow);
	overflow: hidden;
	border: 1px solid rgba(139, 168, 191, 0.26);
}

.phc-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 22px 18px;
	border-bottom: 1px solid var(--phc-border);
	background: linear-gradient(
		180deg,
		rgba(14, 107, 129, 0.04),
		rgba(14, 107, 129, 0)
	);
}

.phc-modal-header > div {
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--phc-text);
}

.phc-modal-close {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--phc-soft);
	border: 1px solid var(--phc-border);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: var(--phc-muted);
	transition: all 0.2s ease;
}

.phc-modal-close:hover {
	background: #edf5f9;
	color: var(--phc-accent);
	transform: translateY(-1px);
}

.phc-header-right {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: 12px;
}

.phc-client-name {
	font-size: 1.18rem;
	font-weight: 900;
	color: var(--phc-accent);
	white-space: nowrap;
	max-width: 360px;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Visually disable clinical context when not applicable */
.phc-clinical-disabled {
	opacity: 0.45;
	pointer-events: none;
	filter: grayscale(0.05);
	transition: opacity 0.15s ease;
}

.phc-clinical-disabled .phc-check-item {
	cursor: not-allowed;
}

.phc-clinical-disabled-note {
	margin-bottom: 10px;
	padding: 8px 10px;
	background: rgba(239, 68, 68, 0.06);
	border: 1px solid rgba(239, 68, 68, 0.15);
	border-radius: 10px;
	color: #a12e2e;
	font-size: 12px;
	font-weight: 700;
}

/* Suggestions dropdown for tag inputs */
.phc-suggestions {
	font-family: inherit;
}
.phc-suggestion-item.highlight {
	background: #f0f9ff;
}

.phc-body {
	padding: 18px 20px 20px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	max-height: min(72vh, 760px);
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 12px;
}

.phc-body::-webkit-scrollbar {
	width: 8px;
}

.phc-body::-webkit-scrollbar-track {
	background: #eef5fa;
	border-radius: 999px;
}

.phc-body::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, var(--phc-accent), var(--phc-accent-2));
	border-radius: 999px;
}

.phc-actions {
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.phc-save-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: rgba(12, 94, 117, 0.05);
	border: 1px solid rgba(12, 94, 117, 0.12);
	border-radius: 999px;
	font-weight: 700;
	font-size: 13px;
	color: var(--phc-text);
}

.phc-save-toggle input {
	accent-color: var(--phc-accent);
}

.phc-actions .btn {
	padding: 9px 16px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 0.92rem;
}

.phc-section-card {
	background: linear-gradient(180deg, var(--phc-panel), #f9fbff);
	border: 1px solid var(--phc-border);
	border-radius: 16px;
	box-shadow: var(--phc-shadow-soft);
	overflow: hidden;
}

.phc-section-header {
	padding: 12px 14px;
	background: linear-gradient(
		180deg,
		rgba(10, 109, 125, 0.06),
		rgba(10, 109, 125, 0.02)
	);
	border-bottom: 1px solid var(--phc-border);
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--phc-accent);
}

.phc-section-body {
	padding: 14px;
	display: grid;
	gap: 14px;
}

.phc-grid-two {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.phc-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.phc-label,
.phc-field-label {
	font-size: 12px;
	color: var(--phc-muted);
	font-weight: 700;
	letter-spacing: 0.01em;
}

.phc-field-stack {
	display: grid;
	gap: 12px;
}

.phc-field {
	display: grid;
	gap: 8px;
}

.phc-input {
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--phc-border);
	background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
	font-size: 0.92rem;
	line-height: 1.4;
	color: var(--phc-text);
	box-shadow: inset 0 1px 2px rgba(16, 42, 60, 0.03);
	transition: all 0.18s ease;
}

.phc-input:focus {
	outline: none;
	border-color: rgba(10, 109, 125, 0.7);
	box-shadow:
		0 0 0 4px rgba(10, 109, 125, 0.08),
		inset 0 1px 2px rgba(16, 42, 60, 0.02);
}

.phc-input::placeholder {
	color: #8ea3b3;
}

.phc-check-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border: 1px solid var(--phc-border);
	background: linear-gradient(180deg, #ffffff 0%, #f2f8fd 100%);
	border-radius: 10px;
	font-weight: 700;
	color: var(--phc-text);
	box-shadow: 0 4px 12px rgba(15, 44, 62, 0.04);
}

.phc-check-item input {
	accent-color: var(--phc-accent);
}

.phc-inline-checks {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.phc-trimester-wrap {
	max-width: 240px;
}

.phc-clinical-body {
	align-items: end;
}

.phc-tags {
	min-height: 48px;
	border-radius: 12px;
	border: 1px solid var(--phc-border);
	padding: 8px 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	background: linear-gradient(180deg, #fdfefe 0%, #f5faff 100%);
	box-shadow: inset 0 1px 2px rgba(16, 42, 60, 0.03);
}

.phc-tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px 7px 12px;
	border-radius: 999px;
	background: linear-gradient(180deg, #ebf9fd 0%, #dff4fa 100%);
	border: 1px solid rgba(17, 137, 165, 0.14);
	color: #0d4c5b;
	font-weight: 700;
	font-size: 0.8rem;
	box-shadow: 0 4px 10px rgba(20, 84, 103, 0.06);
}

.phc-tag-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(13, 76, 91, 0.09);
	color: #7a233c;
	font-weight: 800;
	cursor: pointer;
	transition: all 0.18s ease;
}

.phc-tag-remove:hover {
	background: rgba(122, 35, 60, 0.12);
}

.phc-tag-input {
	flex: 1;
	min-width: 140px;
	border: 0;
	padding: 6px 4px;
	background: transparent;
	font-size: 0.9rem;
	color: var(--phc-text);
}

.phc-tag-input:focus {
	outline: none;
}

.phc-actions-bottom {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 4px;
}

.phc-modal-content .btn-primary {
	background: linear-gradient(135deg, var(--phc-accent), var(--phc-accent-2));
	color: #fff;
	border: 1px solid rgba(8, 79, 96, 0.2);
	box-shadow: 0 10px 18px rgba(10, 109, 125, 0.2);
}

.phc-modal-content .btn-secondary {
	background: #ffffff;
	color: var(--phc-text);
	border: 1px solid var(--phc-border);
	box-shadow: 0 4px 10px rgba(18, 38, 48, 0.04);
}

@media (max-width: 800px) {
	.phc-grid-two {
		grid-template-columns: 1fr;
	}
	.phc-modal-content {
		max-width: 720px;
	}
}

@media (max-width: 560px) {
	.phc-modal-overlay {
		padding: 12px;
	}
	.phc-body {
		padding: 14px;
	}
	.phc-actions-bottom {
		flex-direction: column-reverse;
	}
	.phc-actions-bottom .btn {
		width: 100%;
	}
	.phc-trimester-wrap {
		max-width: 100%;
	}
}
