/* Health Private DMS Frontend Portal */

.hpdms-portal-wrap {
	max-width: 1180px !important;
	margin: 46px auto !important;
	padding: 0 18px !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
	color: #102f30 !important;
}

.hpdms-login-screen {
	max-width: 560px !important;
}

.hpdms-login-card,
.hpdms-portal-panel,
.hpdms-portal-card {
	background: #ffffff !important;
	border: 1px solid #dce8e6 !important;
	border-radius: 24px !important;
	box-shadow: 0 22px 55px rgba(15, 61, 62, 0.10) !important;
}

.hpdms-login-card {
	overflow: hidden !important;
}

.hpdms-login-brand {
	background: linear-gradient(135deg, #0f3d3e, #135d66) !important;
	color: #ffffff !important;
	padding: 34px 36px !important;
}

.hpdms-login-brand span,
.hpdms-portal-hero span {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	color: #b8f3e6 !important;
	text-transform: uppercase !important;
	font-weight: 800 !important;
	font-size: 12px !important;
	letter-spacing: 0.12em !important;
	margin-bottom: 10px !important;
}

.hpdms-login-brand h1,
.hpdms-portal-hero h1 {
	margin: 0 !important;
	color: #ffffff !important;
	font-size: 34px !important;
	line-height: 1.2 !important;
	font-weight: 850 !important;
}

.hpdms-login-brand p,
.hpdms-portal-hero p {
	margin: 10px 0 0 !important;
	color: #e7fffa !important;
	font-size: 15px !important;
	line-height: 1.6 !important;
}

#hpdms_frontend_login {
	padding: 32px 36px 12px !important;
	margin: 0 !important;
}

#hpdms_frontend_login p {
	margin: 0 0 18px !important;
}

#hpdms_frontend_login label {
	display: block !important;
	font-weight: 800 !important;
	color: #173f3f !important;
	margin-bottom: 8px !important;
	font-size: 14px !important;
}

#hpdms_frontend_login input[type="text"],
#hpdms_frontend_login input[type="password"] {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	border: 1px solid #bdd3d0 !important;
	border-radius: 13px !important;
	padding: 13px 14px !important;
	font-size: 15px !important;
	line-height: 1.4 !important;
	background: #ffffff !important;
	color: #102f30 !important;
	box-shadow: none !important;
}

#hpdms_frontend_login input[type="text"]:focus,
#hpdms_frontend_login input[type="password"]:focus {
	outline: none !important;
	border-color: #135d66 !important;
	box-shadow: 0 0 0 3px rgba(19, 93, 102, 0.12) !important;
}

#hpdms_frontend_login .login-remember label {
	display: flex !important;
	align-items: center !important;
	gap: 9px !important;
	font-weight: 700 !important;
	color: #506c69 !important;
}

#hpdms_frontend_login input[type="checkbox"] {
	width: 16px !important;
	height: 16px !important;
	margin: 0 !important;
}

#hpdms_frontend_login input[type="submit"],
#hpdms_wp_submit {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	background: #0f3d3e !important;
	color: #ffffff !important;
	border: 0 !important;
	border-radius: 999px !important;
	padding: 14px 24px !important;
	font-weight: 850 !important;
	cursor: pointer !important;
	font-size: 15px !important;
	box-shadow: 0 10px 24px rgba(15, 61, 62, 0.18) !important;
	text-decoration: none !important;
}

#hpdms_frontend_login input[type="submit"]:hover,
#hpdms_wp_submit:hover {
	background: #135d66 !important;
	color: #ffffff !important;
}

.hpdms-login-note {
	padding: 0 36px 32px !important;
	color: #607573 !important;
	line-height: 1.6 !important;
	font-size: 14px !important;
	margin: 0 !important;
}

.hpdms-frontend-alert {
	margin: 22px 36px 0 !important;
	border-radius: 14px !important;
	padding: 13px 15px !important;
	font-weight: 700 !important;
}

.hpdms-frontend-alert-error {
	background: #fef2f2 !important;
	border: 1px solid #fecaca !important;
	color: #991b1b !important;
}

.hpdms-portal-hero {
	display: flex !important;
	justify-content: space-between !important;
	gap: 20px !important;
	align-items: center !important;
	background: linear-gradient(135deg, #0f3d3e, #135d66) !important;
	border-radius: 26px !important;
	padding: 36px !important;
	margin-bottom: 24px !important;
	box-shadow: 0 18px 45px rgba(15, 61, 62, 0.16) !important;
}

.hpdms-portal-logout {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #ffffff !important;
	color: #0f3d3e !important;
	text-decoration: none !important;
	border-radius: 999px !important;
	padding: 12px 20px !important;
	font-weight: 850 !important;
	white-space: nowrap !important;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08) !important;
}

.hpdms-portal-logout:hover {
	background: #e9fbf8 !important;
	color: #0f3d3e !important;
}

.hpdms-portal-grid {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
	gap: 18px !important;
	margin-bottom: 24px !important;
}

.hpdms-portal-card {
	display: block !important;
	padding: 24px !important;
	text-decoration: none !important;
	color: #102f30 !important;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

.hpdms-portal-card:hover {
	transform: translateY(-2px) !important;
	border-color: #135d66 !important;
	box-shadow: 0 20px 48px rgba(15, 61, 62, 0.14) !important;
	color: #102f30 !important;
}

.hpdms-portal-card span {
	display: block !important;
	color: #577270 !important;
	font-weight: 850 !important;
	font-size: 12px !important;
	text-transform: uppercase !important;
	letter-spacing: 0.08em !important;
	margin-bottom: 12px !important;
}

.hpdms-portal-card strong {
	display: block !important;
	color: #0f3d3e !important;
	font-size: 36px !important;
	line-height: 1 !important;
	margin-bottom: 12px !important;
	font-weight: 850 !important;
}

.hpdms-portal-card p {
	margin: 0 !important;
	color: #526d6b !important;
	line-height: 1.5 !important;
	font-size: 14px !important;
	font-weight: 500 !important;
}

.hpdms-portal-panel {
	padding: 26px !important;
}

.hpdms-portal-panel h1,
.hpdms-portal-panel h2 {
	margin-top: 0 !important;
	color: #0f3d3e !important;
	font-size: 26px !important;
	font-weight: 850 !important;
}

.hpdms-portal-panel p {
	color: #526d6b !important;
	line-height: 1.7 !important;
	margin-bottom: 0 !important;
}

@media (max-width: 760px) {
	.hpdms-portal-wrap {
		margin: 24px auto !important;
		padding: 0 14px !important;
	}

	.hpdms-portal-hero {
		display: block !important;
		padding: 28px !important;
	}

	.hpdms-portal-logout {
		margin-top: 18px !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}

	.hpdms-login-brand,
	#hpdms_frontend_login,
	.hpdms-login-note {
		padding-left: 24px !important;
		padding-right: 24px !important;
	}

	.hpdms-login-brand h1,
	.hpdms-portal-hero h1 {
		font-size: 28px !important;
	}
}

body .hpdms-login-screen {
	max-width: 560px !important;
	padding: 0 !important;
}

body .hpdms-login-screen .hpdms-login-card {
	margin: 0 auto !important;
}

body .entry-content:has(.hpdms-login-screen),
body .wp-block-post-content:has(.hpdms-login-screen) {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

/* Hide normal theme page hero/title on the DMS portal page */
body.hpdms-doctor-portal-page .hp-page-hero,
body.hpdms-doctor-portal-page .page-hero,
body.hpdms-doctor-portal-page .entry-header,
body.hpdms-doctor-portal-page .hpc-page-hero,
body.hpdms-doctor-portal-page .hp-hero,
body.hpdms-doctor-portal-page .site-page-header {
	display: none !important;
}

/* Centre the DMS portal properly once the theme hero is hidden */
body.hpdms-doctor-portal-page .hpdms-portal-wrap.hpdms-login-screen {
	margin-top: 55px !important;
	margin-bottom: 70px !important;
}

/* Reduce excessive page content spacing */
body.hpdms-doctor-portal-page .entry-content,
body.hpdms-doctor-portal-page .wp-block-post-content,
body.hpdms-doctor-portal-page main {
	padding-top: 0 !important;
}

/* Make logged-in DMS dashboard use full website width */
body.hpdms-doctor-portal-page .hpdms-portal-wrap:not(.hpdms-login-screen) {
	max-width: 1180px !important;
	width: calc(100% - 48px) !important;
	margin: 55px auto 70px !important;
	padding: 0 !important;
}

/* Make the main dashboard container wider */
body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell {
	width: 100% !important;
	max-width: 100% !important;
}

/* Wider hero */
body.hpdms-doctor-portal-page .hpdms-portal-hero {
	width: 100% !important;
	box-sizing: border-box !important;
}

/* Better dashboard grid across the full layout */
body.hpdms-doctor-portal-page .hpdms-portal-grid {
	grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
	width: 100% !important;
}

/* Make cards use the full row nicely */
body.hpdms-doctor-portal-page .hpdms-portal-card {
	min-height: 150px !important;
}

/* Portal status full width */
body.hpdms-doctor-portal-page .hpdms-portal-panel {
	width: 100% !important;
	box-sizing: border-box !important;
}

/* Remove the large outer card effect if the theme/content wrapper is adding it */
body.hpdms-doctor-portal-page .entry-content,
body.hpdms-doctor-portal-page .wp-block-post-content,
body.hpdms-doctor-portal-page main {
	max-width: 100% !important;
}

/* Responsive fallback */
@media (max-width: 1100px) {
	body.hpdms-doctor-portal-page .hpdms-portal-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 760px) {
	body.hpdms-doctor-portal-page .hpdms-portal-wrap:not(.hpdms-login-screen) {
		width: calc(100% - 28px) !important;
		margin-top: 28px !important;
	}

	body.hpdms-doctor-portal-page .hpdms-portal-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Doctor Portal full-width dashboard fix */
body.hpdms-doctor-portal-page article#post-67.hp-page-content,
body.hpdms-doctor-portal-page article#post-67 .hp-content,
body.hpdms-doctor-portal-page .hp-page-content,
body.hpdms-doctor-portal-page .hp-content {
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	box-sizing: border-box !important;
}

/* Keep the actual portal nicely aligned to the website width */
body.hpdms-doctor-portal-page .hpdms-portal-wrap.hpdms-portal-dashboard-shell {
	width: min(1400px, calc(100% - 72px)) !important;
	max-width: 1400px !important;
	margin: 55px auto 70px !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

/* Make dashboard sections stretch inside that wider layout */
body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-hero,
body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-grid,
body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-panel {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
}

/* Force five cards in one row on desktop */
body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-grid {
	display: grid !important;
	grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
	gap: 20px !important;
}

/* Make the dashboard cards look balanced on the wider layout */
body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-card {
	min-height: 165px !important;
}

/* Keep login screen compact, do not stretch it */
body.hpdms-doctor-portal-page .hpdms-portal-wrap.hpdms-login-screen {
	width: 560px !important;
	max-width: calc(100% - 32px) !important;
	margin: 55px auto 70px !important;
}

/* Responsive layout */
@media (max-width: 1200px) {
	body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 760px) {
	body.hpdms-doctor-portal-page .hpdms-portal-wrap.hpdms-portal-dashboard-shell {
		width: calc(100% - 28px) !important;
		margin-top: 28px !important;
	}

	body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Phase 13 - frontend patient list and cabinet polish */

body.hpdms-doctor-portal-page .hp-content,
body.hpdms-doctor-portal-page article.hp-page-content {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

/* Main portal width */
body.hpdms-doctor-portal-page .hpdms-portal-wrap.hpdms-portal-dashboard-shell {
	width: min(1420px, calc(100% - 56px)) !important;
	max-width: 1420px !important;
	margin: 38px auto 56px !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

/* Hero */
body.hpdms-doctor-portal-page .hpdms-portal-hero {
	padding: 34px 38px !important;
	border-radius: 24px !important;
	margin-bottom: 20px !important;
	box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-subhero {
	margin-bottom: 22px !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-hero-actions {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-end !important;
	gap: 10px !important;
	flex-wrap: wrap !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-secondary-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: rgba(255, 255, 255, 0.14) !important;
	color: #ffffff !important;
	border: 1px solid rgba(255, 255, 255, 0.28) !important;
	text-decoration: none !important;
	border-radius: 999px !important;
	padding: 12px 18px !important;
	font-weight: 850 !important;
	white-space: nowrap !important;
	min-width: 150px !important;
	text-align: center !important;
	box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-secondary-btn:hover {
	background: rgba(255, 255, 255, 0.22) !important;
	color: #ffffff !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-logout {
	min-width: 150px !important;
	text-align: center !important;
	box-sizing: border-box !important;
}

/* Panels */
body.hpdms-doctor-portal-page .hpdms-portal-panel {
	padding: 24px !important;
	border-radius: 20px !important;
	box-sizing: border-box !important;
}

/* Search/filter panel */
body.hpdms-doctor-portal-page .hpdms-frontend-filter label {
	display: block !important;
	font-weight: 850 !important;
	color: #0f3d3e !important;
	margin-bottom: 8px !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-filter-row {
	display: grid !important;
	grid-template-columns: 1fr 96px 86px !important;
	gap: 10px !important;
	align-items: center !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-filter-row input {
	width: 100% !important;
	height: 48px !important;
	border: 1px solid #bdd3d0 !important;
	border-radius: 13px !important;
	padding: 13px 14px !important;
	font-size: 15px !important;
	color: #102f30 !important;
	box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-filter-row input:focus {
	outline: none !important;
	border-color: #135d66 !important;
	box-shadow: 0 0 0 3px rgba(19, 93, 102, 0.12) !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-filter-row button,
body.hpdms-doctor-portal-page .hpdms-frontend-filter-row a {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	height: 48px !important;
	border-radius: 999px !important;
	padding: 12px 18px !important;
	font-weight: 850 !important;
	text-decoration: none !important;
	box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-filter-row button {
	background: #0f3d3e !important;
	color: #ffffff !important;
	border: 0 !important;
	cursor: pointer !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-filter-row button:hover {
	background: #135d66 !important;
	color: #ffffff !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-filter-row a {
	background: #f4fbf9 !important;
	color: #0f3d3e !important;
	border: 1px solid #d7eee6 !important;
}

/* Patient list */
body.hpdms-doctor-portal-page .hpdms-frontend-table-card {
	background: #ffffff !important;
	border: 1px solid #dce8e6 !important;
	border-radius: 22px !important;
	box-shadow: 0 18px 46px rgba(15, 61, 62, 0.07) !important;
	overflow: hidden !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-table-head {
	display: flex !important;
	justify-content: space-between !important;
	gap: 15px !important;
	align-items: center !important;
	padding: 20px 24px !important;
	border-bottom: 1px solid #edf3f2 !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-table-head h2 {
	margin: 0 !important;
	color: #0f3d3e !important;
	font-size: 24px !important;
	font-weight: 850 !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-table-head p {
	margin: 0 !important;
	color: #607573 !important;
	font-weight: 700 !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-patient-list {
	display: grid !important;
	gap: 0 !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-patient-row {
	display: grid !important;
	grid-template-columns: 1.7fr 0.9fr 0.9fr 1.1fr 110px !important;
	gap: 16px !important;
	align-items: center !important;
	padding: 17px 24px !important;
	text-decoration: none !important;
	color: #102f30 !important;
	border-bottom: 1px solid #edf3f2 !important;
	transition: background 0.15s ease, transform 0.15s ease !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-patient-row:hover {
	background: #f4fbf9 !important;
	color: #102f30 !important;
	transform: translateX(2px) !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-patient-row:last-child {
	border-bottom: 0 !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-patient-row strong {
	display: block !important;
	color: #0f3d3e !important;
	font-size: 16px !important;
	margin-bottom: 4px !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-patient-row span {
	display: block !important;
	color: #526d6b !important;
	font-size: 14px !important;
	line-height: 1.5 !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-label {
	text-transform: uppercase !important;
	font-size: 11px !important;
	letter-spacing: 0.08em !important;
	font-weight: 850 !important;
	color: #77908d !important;
	margin-bottom: 4px !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-status {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #ecfdf3 !important;
	color: #166534 !important;
	border-radius: 999px !important;
	padding: 8px 12px !important;
	font-weight: 850 !important;
	white-space: nowrap !important;
	min-width: 86px !important;
	text-align: center !important;
	box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-empty {
	padding: 28px !important;
	color: #607573 !important;
}

/* Patient cabinet summary */
body.hpdms-doctor-portal-page .hpdms-frontend-summary-grid {
	display: grid !important;
	grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	gap: 12px !important;
	margin-bottom: 20px !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-summary-card {
	background: #ffffff !important;
	border: 1px solid #dce8e6 !important;
	border-radius: 18px !important;
	padding: 17px 18px !important;
	min-height: 94px !important;
	box-shadow: 0 12px 32px rgba(15, 61, 62, 0.06) !important;
	box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-summary-card span {
	display: block !important;
	color: #577270 !important;
	font-weight: 850 !important;
	font-size: 11px !important;
	text-transform: uppercase !important;
	letter-spacing: 0.08em !important;
	margin-bottom: 8px !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-summary-card strong {
	display: block !important;
	color: #0f3d3e !important;
	font-size: 24px !important;
	line-height: 1.1 !important;
	word-break: break-word !important;
}

/* Cabinet tabs */
body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-tabs {
	display: flex !important;
	gap: 9px !important;
	flex-wrap: wrap !important;
	margin: 4px 0 20px !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-tabs a {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #ffffff !important;
	border: 1px solid #dce8e6 !important;
	color: #0f3d3e !important;
	border-radius: 999px !important;
	padding: 11px 16px !important;
	font-weight: 850 !important;
	text-decoration: none !important;
	box-shadow: 0 6px 16px rgba(15, 61, 62, 0.04) !important;
	box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-tabs a:hover {
	background: #f4fbf9 !important;
	color: #0f3d3e !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-tabs a.active {
	background: #0f3d3e !important;
	color: #ffffff !important;
	border-color: #0f3d3e !important;
}

/* Cabinet overview layout */
body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 20px !important;
	align-items: start !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-grid .hpdms-portal-panel {
	min-height: 100% !important;
}

/* Detail rows */
body.hpdms-doctor-portal-page .hpdms-frontend-detail-row {
	display: grid !important;
	grid-template-columns: 185px 1fr !important;
	gap: 14px !important;
	padding: 13px 0 !important;
	border-bottom: 1px solid #edf3f2 !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-detail-row:first-of-type {
	padding-top: 4px !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-detail-row:last-child {
	border-bottom: 0 !important;
	padding-bottom: 4px !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-detail-row strong {
	color: #173f3f !important;
	font-weight: 850 !important;
}

body.hpdms-doctor-portal-page .hpdms-frontend-detail-row span {
	color: #526d6b !important;
	line-height: 1.6 !important;
	word-break: break-word !important;
}

/* Tablet */
@media (max-width: 1200px) {
	body.hpdms-doctor-portal-page .hpdms-frontend-summary-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}

	body.hpdms-doctor-portal-page .hpdms-frontend-patient-row {
		grid-template-columns: 1fr 1fr !important;
	}

	body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Mobile */
@media (max-width: 760px) {
	body.hpdms-doctor-portal-page .hpdms-portal-wrap.hpdms-portal-dashboard-shell {
		width: calc(100% - 24px) !important;
		margin: 24px auto 44px !important;
	}

	body.hpdms-doctor-portal-page .hpdms-portal-hero {
		display: block !important;
		padding: 26px !important;
	}

	body.hpdms-doctor-portal-page .hpdms-portal-hero-actions {
		display: grid !important;
		grid-template-columns: 1fr !important;
		width: 100% !important;
		margin-top: 18px !important;
	}

	body.hpdms-doctor-portal-page .hpdms-portal-secondary-btn,
	body.hpdms-doctor-portal-page .hpdms-portal-logout {
		width: 100% !important;
		min-width: 0 !important;
	}

	body.hpdms-doctor-portal-page .hpdms-frontend-filter-row,
	body.hpdms-doctor-portal-page .hpdms-frontend-summary-grid,
	body.hpdms-doctor-portal-page .hpdms-frontend-patient-row,
	body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-grid,
	body.hpdms-doctor-portal-page .hpdms-frontend-detail-row {
		grid-template-columns: 1fr !important;
	}

	body.hpdms-doctor-portal-page .hpdms-frontend-table-head {
		display: block !important;
	}

	body.hpdms-doctor-portal-page .hpdms-frontend-table-head p {
		margin-top: 6px !important;
	}

	body.hpdms-doctor-portal-page .hpdms-frontend-patient-row {
		gap: 10px !important;
	}

	body.hpdms-doctor-portal-page .hpdms-frontend-status {
		width: fit-content !important;
	}

	body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-tabs a {
		width: 100% !important;
		box-sizing: border-box !important;
	}
}

/* Phase 9B - theme-aware full-viewport portal breakout
   The Health Private theme keeps page content inside a narrow content column.
   These rules deliberately break only the DMS portal out of that column while
   leaving the public website header/footer untouched. */
body.hpdms-doctor-portal-page,
body.hpdms-doctor-portal-page .site,
body.hpdms-doctor-portal-page .site-content,
body.hpdms-doctor-portal-page .content-area,
body.hpdms-doctor-portal-page .site-main,
body.hpdms-doctor-portal-page main,
body.hpdms-doctor-portal-page article,
body.hpdms-doctor-portal-page .entry-content,
body.hpdms-doctor-portal-page .wp-block-post-content,
body.hpdms-doctor-portal-page .hp-page-content,
body.hpdms-doctor-portal-page .hp-content,
body.hpdms-doctor-portal-page .container,
body.hpdms-doctor-portal-page .wp-site-blocks {
    max-width: none !important;
    overflow-x: visible !important;
}

body.hpdms-doctor-portal-page .entry-content,
body.hpdms-doctor-portal-page .wp-block-post-content,
body.hpdms-doctor-portal-page .hp-page-content,
body.hpdms-doctor-portal-page .hp-content {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-wrap:not(.hpdms-login-screen) {
    width: calc(100vw - 44px) !important;
    max-width: none !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 34px 0 64px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-wrap.hpdms-login-screen {
    left: auto !important;
    transform: none !important;
    position: static !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-dashboard-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 22vw, 420px) !important;
    gap: 24px !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-main-col,
body.hpdms-doctor-portal-page .hpdms-portal-side-col {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-grid,
body.hpdms-doctor-portal-page .hpdms-portal-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-card,
body.hpdms-doctor-portal-page .hpdms-portal-card {
    min-height: 136px !important;
    padding: 22px !important;
    box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-card strong,
body.hpdms-doctor-portal-page .hpdms-portal-card strong {
    font-size: clamp(28px, 2.1vw, 36px) !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-hero {
    width: 100% !important;
    margin-bottom: 24px !important;
    box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-notifications {
    width: 100% !important;
    box-sizing: border-box !important;
    position: sticky !important;
    top: 24px !important;
}

body.hpdms-doctor-portal-page .hpdms-portal-panel,
body.hpdms-doctor-portal-page .hpdms-frontend-table-card,
body.hpdms-doctor-portal-page .hpdms-frontend-summary-grid,
body.hpdms-doctor-portal-page .hpdms-frontend-cabinet-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 1180px) {
    body.hpdms-doctor-portal-page .hpdms-portal-dashboard-layout {
        grid-template-columns: 1fr !important;
    }

    body.hpdms-doctor-portal-page .hpdms-portal-notifications {
        position: static !important;
    }
}

@media (max-width: 760px) {
    body.hpdms-doctor-portal-page .hpdms-portal-wrap:not(.hpdms-login-screen) {
        width: calc(100vw - 24px) !important;
        margin-top: 24px !important;
        margin-bottom: 44px !important;
    }

    body.hpdms-doctor-portal-page .hpdms-portal-dashboard-shell .hpdms-portal-grid,
    body.hpdms-doctor-portal-page .hpdms-portal-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Phase 11 - frontend weekly appointment calendar */
body.hpdms-doctor-portal-page .hpdms-calendar-shell {
    --hpdms-calendar-border: rgba(12, 49, 71, 0.12);
    --hpdms-calendar-soft: #f5fbfc;
}

body.hpdms-doctor-portal-page .hpdms-calendar-toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 18px !important;
    margin-bottom: 18px !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-toolbar h2 {
    margin: 0 0 4px !important;
    color: #0b3047 !important;
    font-size: clamp(24px, 2vw, 34px) !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-toolbar p {
    margin: 0 !important;
    color: #60778b !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-actions {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-panel {
    padding: 0 !important;
    overflow: hidden !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-scroll {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    border-radius: 24px !important;
    background: #ffffff !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-grid {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 76px repeat(7, minmax(170px, 1fr)) !important;
    grid-template-rows: 72px repeat(var(--hpdms-calendar-slot-rows), 18px) !important;
    min-width: 1320px !important;
    background: #ffffff !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-corner,
body.hpdms-doctor-portal-page .hpdms-calendar-day-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
    background: linear-gradient(180deg, #f9fdfe 0%, #edf7f8 100%) !important;
    border-bottom: 1px solid var(--hpdms-calendar-border) !important;
    border-right: 1px solid var(--hpdms-calendar-border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #0b3047 !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-corner {
    grid-column: 1 !important;
    grid-row: 1 !important;
    left: 0 !important;
    z-index: 12 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-day-head.is-today {
    background: linear-gradient(180deg, #e2fbf7 0%, #d5f4f0 100%) !important;
    color: #007f78 !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-time {
    position: sticky !important;
    left: 0 !important;
    z-index: 5 !important;
    background: #fbfeff !important;
    border-right: 1px solid var(--hpdms-calendar-border) !important;
    border-bottom: 1px solid rgba(12, 49, 71, 0.06) !important;
    color: #6c8291 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 2px 8px 0 0 !important;
    text-align: right !important;
    box-sizing: border-box !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-time.is-hour {
    color: #0b3047 !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-cell {
    border-right: 1px solid rgba(12, 49, 71, 0.07) !important;
    border-bottom: 1px solid rgba(12, 49, 71, 0.045) !important;
    background: #ffffff !important;
    min-width: 0 !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-cell.is-hour {
    border-top: 1px solid rgba(12, 49, 71, 0.12) !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-event {
    z-index: 6 !important;
    margin: 2px 5px !important;
    padding: 8px 9px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(12, 49, 71, 0.18) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-status-pending_payment,
body.hpdms-doctor-portal-page .hpdms-calendar-status-manual_review {
    background: linear-gradient(135deg, #b7791f 0%, #975a16 100%) !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-status-rescheduled {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-status-completed {
    background: linear-gradient(135deg, #166534 0%, #14532d 100%) !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-status-cancelled,
body.hpdms-doctor-portal-page .hpdms-calendar-status-no_show {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%) !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-event-time {
    font-weight: 900 !important;
    opacity: 0.92 !important;
    margin-bottom: 3px !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-event-title {
    display: block !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 900 !important;
    margin-bottom: 2px !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-event-title:hover {
    text-decoration: underline !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-event-type {
    opacity: 0.9 !important;
    font-weight: 650 !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-event-links {
    display: flex !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    margin-top: 7px !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-event-links a {
    color: #053a3a !important;
    background: rgba(255, 255, 255, 0.88) !important;
    border-radius: 999px !important;
    text-decoration: none !important;
    padding: 3px 7px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
}

body.hpdms-doctor-portal-page .hpdms-calendar-list-panel {
    margin-top: 18px !important;
}

@media (max-width: 1180px) {
    body.hpdms-doctor-portal-page .hpdms-calendar-toolbar {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    body.hpdms-doctor-portal-page .hpdms-calendar-actions {
        justify-content: flex-start !important;
    }
}

@media (max-width: 760px) {
    body.hpdms-doctor-portal-page .hpdms-calendar-grid {
        min-width: 980px !important;
        grid-template-columns: 64px repeat(7, minmax(130px, 1fr)) !important;
    }

    body.hpdms-doctor-portal-page .hpdms-calendar-day-head {
        font-size: 12px !important;
    }

    body.hpdms-doctor-portal-page .hpdms-calendar-event {
        padding: 6px 7px !important;
        font-size: 11px !important;
    }
}

/* Phase 20C: consultation room action panels */
.hpdms-consult-actions-panel,
.hpdms-consult-uploads-panel{
    margin-top:18px;
    padding:18px;
    border:1px solid rgba(15,61,62,.12);
    border-radius:18px;
    background:linear-gradient(180deg,#ffffff,#f7fbfa);
}
.hpdms-consult-status-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin:12px 0 18px;
}
.hpdms-consult-status-actions form{margin:0!important;}
.hpdms-consult-status-btn{
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    min-height:36px;
    border-radius:999px!important;
    border:1px solid #d6e7e3!important;
    background:#fff!important;
    color:#0f3d3e!important;
    font-weight:800!important;
    cursor:pointer;
}
.hpdms-consult-status-btn.hpdms-status-started{background:#ecfeff!important;}
.hpdms-consult-status-btn.hpdms-status-completed{background:#ecfdf5!important;}
.hpdms-consult-status-btn.hpdms-status-no_show{background:#fff7ed!important;}
.hpdms-consult-action-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
    gap:16px;
}
.hpdms-consult-action-card{
    display:block;
    margin:0!important;
    padding:16px;
    border:1px solid #dce8e6;
    border-radius:16px;
    background:#fff;
    box-shadow:0 8px 22px rgba(16,47,48,.05);
}
.hpdms-consult-action-card h3{
    margin:0 0 12px;
    color:#0f3d3e;
    font-size:17px;
}
.hpdms-consult-action-card label{
    display:block;
    margin:10px 0 5px;
    color:#426465;
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.hpdms-consult-action-card input[type="text"],
.hpdms-consult-action-card input[type="date"],
.hpdms-consult-action-card input[type="file"],
.hpdms-consult-action-card select,
.hpdms-consult-action-card textarea{
    width:100%;
    box-sizing:border-box;
    border:1px solid #ccdeda;
    border-radius:12px;
    padding:10px 12px;
    background:#fbfefd;
    color:#102f30;
}
.hpdms-consult-action-card textarea{resize:vertical;}
.hpdms-consult-mini-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}
.hpdms-consult-action-card .hpdms-frontend-primary-btn{
    margin-top:12px;
}
@media(max-width:720px){
    .hpdms-consult-action-grid{grid-template-columns:1fr;}
    .hpdms-consult-mini-grid{grid-template-columns:1fr;}
}

/* Phase 22: frontend Booking Setup polish + frontend-safe form controls */
body.hpdms-admin-portal-page .hpdms-portal-module-shell,
body.hpdms-doctor-portal-page .hpdms-portal-module-shell{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
}

.hpdms-portal-module-shell .hpdms-grid{
    display:grid!important;
    grid-template-columns:minmax(360px,520px) minmax(0,1fr)!important;
    gap:22px!important;
    align-items:start!important;
}

.hpdms-portal-module-shell .hpdms-panel{
    background:#fff!important;
    border:1px solid rgba(15,61,62,.12)!important;
    border-radius:22px!important;
    box-shadow:0 18px 42px rgba(16,47,48,.06)!important;
    padding:22px!important;
    overflow:hidden!important;
}

.hpdms-portal-module-shell .hpdms-panel h2{
    margin:0 0 16px!important;
    color:#0f3d3e!important;
    font-size:24px!important;
    line-height:1.15!important;
}

.hpdms-portal-module-shell table.form-table,
.hpdms-portal-module-shell .form-table tbody,
.hpdms-portal-module-shell .form-table tr,
.hpdms-portal-module-shell .form-table th,
.hpdms-portal-module-shell .form-table td{
    display:block!important;
    width:100%!important;
    border:0!important;
    background:transparent!important;
    padding:0!important;
}

.hpdms-portal-module-shell .form-table tr{
    margin:0 0 14px!important;
}

.hpdms-portal-module-shell .form-table th label,
.hpdms-portal-module-shell .form-table th{
    margin:0 0 7px!important;
    color:#426465!important;
    font-size:12px!important;
    font-weight:900!important;
    letter-spacing:.05em!important;
    text-transform:uppercase!important;
}

.hpdms-portal-module-shell input[type="text"],
.hpdms-portal-module-shell input[type="number"],
.hpdms-portal-module-shell input[type="time"],
.hpdms-portal-module-shell input[type="date"],
.hpdms-portal-module-shell select,
.hpdms-portal-module-shell textarea{
    width:100%!important;
    max-width:100%!important;
    min-height:42px!important;
    box-sizing:border-box!important;
    border:1px solid #ccdeda!important;
    border-radius:13px!important;
    padding:10px 12px!important;
    background:#fbfefd!important;
    color:#102f30!important;
    font-size:14px!important;
    box-shadow:none!important;
}

.hpdms-portal-module-shell textarea{
    min-height:92px!important;
    resize:vertical!important;
}

.hpdms-portal-module-shell input[type="checkbox"]{
    width:17px!important;
    height:17px!important;
    margin-right:7px!important;
    transform:translateY(3px)!important;
}

.hpdms-portal-module-shell .hpdms-booking-submit-wrap{
    margin:18px 0 0!important;
    padding:0!important;
}

.hpdms-portal-module-shell .hpdms-booking-setup-submit{
    border:0!important;
    cursor:pointer!important;
}

.hpdms-portal-module-shell .hpdms-table,
.hpdms-portal-module-shell table.widefat{
    width:100%!important;
    border-collapse:separate!important;
    border-spacing:0!important;
    border:1px solid #dce8e6!important;
    border-radius:16px!important;
    overflow:hidden!important;
    background:#fff!important;
}

.hpdms-portal-module-shell .hpdms-table th,
.hpdms-portal-module-shell .hpdms-table td,
.hpdms-portal-module-shell table.widefat th,
.hpdms-portal-module-shell table.widefat td{
    padding:12px 13px!important;
    border-bottom:1px solid #e7efed!important;
    color:#102f30!important;
    vertical-align:top!important;
}

.hpdms-portal-module-shell .hpdms-table th,
.hpdms-portal-module-shell table.widefat th{
    background:#eef9f7!important;
    color:#0f3d3e!important;
    font-size:11px!important;
    font-weight:900!important;
    text-transform:uppercase!important;
    letter-spacing:.05em!important;
}

.hpdms-portal-module-shell .button,
.hpdms-portal-module-shell .button-small{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:32px!important;
    border-radius:999px!important;
    border:1px solid #d6e7e3!important;
    background:#fff!important;
    color:#0f3d3e!important;
    font-weight:800!important;
    text-decoration:none!important;
    padding:6px 12px!important;
    box-shadow:none!important;
    cursor:pointer!important;
}

@media(max-width:1080px){
    .hpdms-portal-module-shell .hpdms-grid{
        grid-template-columns:1fr!important;
    }
}

/* Phase 24: cleaner patient cabinet workflow panels */
.hpdms-portal-panel .hpdms-medical-record-upload,
.hpdms-portal-panel form.hpdms-medical-record-upload,
.hpdms-portal-panel .hpdms-doc-upload-form,
.hpdms-portal-panel form.hpdms-practice-stack-form{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(160px,1fr)) auto!important;
    gap:14px!important;
    align-items:end!important;
    padding:18px!important;
    margin:18px 0!important;
    background:#f7fbfa!important;
    border:1px solid #dce8e6!important;
    border-radius:18px!important;
}

.hpdms-portal-panel .hpdms-medical-record-upload p,
.hpdms-portal-panel .hpdms-doc-upload-form p,
.hpdms-portal-panel form.hpdms-practice-stack-form p{
    margin:0!important;
}

.hpdms-portal-panel .hpdms-medical-record-upload label,
.hpdms-portal-panel .hpdms-doc-upload-form label,
.hpdms-portal-panel form.hpdms-practice-stack-form label{
    display:block!important;
    margin:0 0 7px!important;
    color:#426465!important;
    font-size:12px!important;
    font-weight:900!important;
    letter-spacing:.05em!important;
    text-transform:uppercase!important;
}

.hpdms-portal-panel input[type="file"]{
    width:100%!important;
    padding:9px!important;
    min-height:42px!important;
    border:1px dashed #9fbfba!important;
    border-radius:13px!important;
    background:#fff!important;
    color:#102f30!important;
}

.hpdms-portal-panel .hpdms-workflow-actions{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:10px!important;
    margin:16px 0!important;
}

.hpdms-portal-panel .hpdms-workflow-actions a,
.hpdms-portal-panel .hpdms-workflow-actions button{
    border-radius:999px!important;
}

.hpdms-portal-panel .hpdms-empty,
.hpdms-portal-panel .hpdms-frontend-empty{
    margin:18px 0!important;
    padding:18px!important;
    border:1px dashed #cfe2de!important;
    border-radius:16px!important;
    background:#fbfefd!important;
    color:#557372!important;
}

.hpdms-portal-panel .hpdms-template-preview,
.hpdms-portal-panel .hpdms-letter-template-preview{
    white-space:pre-wrap!important;
    background:#fbfefd!important;
    border:1px solid #dce8e6!important;
    border-radius:16px!important;
    padding:16px!important;
    color:#102f30!important;
    line-height:1.55!important;
}

@media(max-width:1180px){
    .hpdms-portal-panel .hpdms-medical-record-upload,
    .hpdms-portal-panel form.hpdms-medical-record-upload,
    .hpdms-portal-panel .hpdms-doc-upload-form,
    .hpdms-portal-panel form.hpdms-practice-stack-form{
        grid-template-columns:1fr 1fr!important;
    }
}
@media(max-width:720px){
    .hpdms-portal-panel .hpdms-medical-record-upload,
    .hpdms-portal-panel form.hpdms-medical-record-upload,
    .hpdms-portal-panel .hpdms-doc-upload-form,
    .hpdms-portal-panel form.hpdms-practice-stack-form{
        grid-template-columns:1fr!important;
    }
}

.hpdms-portal-panel .hpdms-frontend-upload-form,
.hpdms-portal-panel .hpdms-frontend-medical-upload-form{
    display:grid!important;
    grid-template-columns:2fr 1fr 1fr 1.5fr auto!important;
    gap:14px!important;
    align-items:end!important;
    padding:18px!important;
    margin:18px 0!important;
    background:#f7fbfa!important;
    border:1px solid #dce8e6!important;
    border-radius:18px!important;
}
.hpdms-portal-panel .hpdms-frontend-upload-form label,
.hpdms-portal-panel .hpdms-frontend-medical-upload-form label{
    display:block!important;
    margin:0 0 7px!important;
    color:#426465!important;
    font-size:12px!important;
    font-weight:900!important;
    letter-spacing:.05em!important;
    text-transform:uppercase!important;
}
@media(max-width:1180px){
    .hpdms-portal-panel .hpdms-frontend-upload-form,
    .hpdms-portal-panel .hpdms-frontend-medical-upload-form{grid-template-columns:1fr 1fr!important;}
}
@media(max-width:720px){
    .hpdms-portal-panel .hpdms-frontend-upload-form,
    .hpdms-portal-panel .hpdms-frontend-medical-upload-form{grid-template-columns:1fr!important;}
}

/* Phase 26 assessment share-link actions */
.hpdms-portal-panel .hpdms-assessment-link-actions,
.hpdms-assessment-link-actions{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:10px!important;
    margin-top:12px!important;
}
.hpdms-portal-panel .hpdms-assessment-link-label,
.hpdms-assessment-link-label{
    flex-basis:100%!important;
    margin:0 0 2px!important;
    font-size:12px!important;
    font-weight:900!important;
    color:#557372!important;
    letter-spacing:.05em!important;
    text-transform:uppercase!important;
}
.hpdms-portal-panel .hpdms-assessment-link-input,
.hpdms-assessment-link-input{
    flex:1 1 520px!important;
    min-width:260px!important;
    max-width:100%!important;
    border:1px solid #cfe2de!important;
    border-radius:999px!important;
    padding:12px 16px!important;
    background:#fff!important;
    color:#0f3d3e!important;
    font-size:14px!important;
    box-sizing:border-box!important;
}
.hpdms-frontend-small-btn-whatsapp{
    background:#25D366!important;
    border-color:#25D366!important;
    color:#fff!important;
}
.hpdms-portal-panel details.hpdms-frontend-response-details,
details.hpdms-result-details{
    margin-top:12px!important;
}
.hpdms-portal-panel details.hpdms-frontend-response-details summary,
details.hpdms-result-details summary{
    cursor:pointer!important;
    display:inline-flex!important;
    align-items:center!important;
    border:1px solid #cfe2de!important;
    border-radius:999px!important;
    padding:10px 14px!important;
    background:#fff!important;
    color:#0f3d3e!important;
    font-weight:900!important;
}
@media(max-width:720px){
    .hpdms-portal-panel .hpdms-assessment-link-actions,
    .hpdms-assessment-link-actions{
        flex-direction:column!important;
        align-items:stretch!important;
    }
    .hpdms-portal-panel .hpdms-assessment-link-input,
    .hpdms-assessment-link-input{
        flex-basis:auto!important;
        width:100%!important;
    }
}

/* Phase 27 assessment link buttons - force visible layout */
.hpdms-portal-panel .hpdms-assessment-link-actions-fixed,
.hpdms-assessment-link-actions-fixed{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    align-items:stretch!important;
    width:100%!important;
}
.hpdms-portal-panel .hpdms-assessment-share-buttons,
.hpdms-assessment-share-buttons{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    width:100%!important;
}
.hpdms-portal-panel .hpdms-assessment-link-actions-fixed .hpdms-assessment-link-input,
.hpdms-assessment-link-actions-fixed .hpdms-assessment-link-input{
    width:100%!important;
    flex:0 0 auto!important;
}
.hpdms-portal-panel .hpdms-frontend-small-btn-whatsapp,
.hpdms-frontend-small-btn-whatsapp{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    background:#25D366!important;
    border-color:#25D366!important;
    color:#fff!important;
    box-shadow:0 10px 22px rgba(37,211,102,.22)!important;
}
.hpdms-portal-panel .hpdms-frontend-small-btn-whatsapp:hover,
.hpdms-frontend-small-btn-whatsapp:hover{
    background:#1ebe5d!important;
    border-color:#1ebe5d!important;
    color:#fff!important;
}
.hpdms-portal-panel .hpdms-assessment-share-buttons form,
.hpdms-assessment-share-buttons form{
    margin:0!important;
    display:inline-flex!important;
}
@media(max-width:720px){
    .hpdms-portal-panel .hpdms-assessment-share-buttons,
    .hpdms-assessment-share-buttons{
        flex-direction:column!important;
        align-items:stretch!important;
    }
    .hpdms-portal-panel .hpdms-assessment-share-buttons .hpdms-frontend-small-btn,
    .hpdms-assessment-share-buttons .hpdms-frontend-small-btn,
    .hpdms-portal-panel .hpdms-assessment-share-buttons form,
    .hpdms-assessment-share-buttons form{
        width:100%!important;
    }
}


/* Phase 28: keep assessment WhatsApp links visible inside DMS portal.
   Older app-mode rules hide public floating WhatsApp widgets by matching wa.me URLs and whatsapp classes. */
body.hpdms-doctor-portal-page .hpdms-portal-wrap .hpdms-assessment-share-buttons a.hpdms-frontend-small-btn-whatsapp[href*="wa.me"],
body.hpdms-doctor-portal-page .hpdms-portal-wrap a.hpdms-frontend-small-btn.hpdms-frontend-small-btn-whatsapp,
body.hpdms-doctor-portal-page .hpdms-portal-wrap a.hpdms-frontend-small-btn-whatsapp,
body.hpdms-admin-portal-page .hpdms-portal-wrap .hpdms-assessment-share-buttons a.hpdms-frontend-small-btn-whatsapp[href*="wa.me"],
body.hpdms-admin-portal-page .hpdms-portal-wrap a.hpdms-frontend-small-btn.hpdms-frontend-small-btn-whatsapp,
body.hpdms-admin-portal-page .hpdms-portal-wrap a.hpdms-frontend-small-btn-whatsapp,
.hpdms-portal-wrap .hpdms-assessment-share-buttons a.hpdms-frontend-small-btn-whatsapp[href*="wa.me"]{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    pointer-events:auto!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    background:#25D366!important;
    border-color:#25D366!important;
    color:#fff!important;
    box-shadow:0 10px 22px rgba(37,211,102,.22)!important;
}
body.hpdms-doctor-portal-page .hpdms-portal-wrap .hpdms-assessment-share-buttons,
body.hpdms-admin-portal-page .hpdms-portal-wrap .hpdms-assessment-share-buttons,
.hpdms-portal-wrap .hpdms-assessment-share-buttons{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    height:auto!important;
    overflow:visible!important;
    gap:10px!important;
    flex-wrap:wrap!important;
}


/* Phase 34 - Outlook-style calendar booking modal */
.hpdms-calendar-bookable-cell{cursor:pointer;position:relative;transition:background .12s ease, box-shadow .12s ease;}
.hpdms-calendar-bookable-cell:hover{background:rgba(0,121,112,.08)!important;box-shadow:inset 0 0 0 1px rgba(0,121,112,.18);}
.hpdms-calendar-new-booking-btn{font-family:inherit;cursor:pointer;}
.hpdms-calendar-booking-modal{display:none;position:fixed;inset:0;z-index:999999;align-items:center;justify-content:center;padding:24px;}
.hpdms-calendar-booking-modal.is-open{display:flex;}
.hpdms-calendar-booking-modal-backdrop{position:absolute;inset:0;background:rgba(2,24,32,.48);backdrop-filter:blur(3px);}
.hpdms-calendar-booking-dialog{position:relative;z-index:2;width:min(860px,96vw);max-height:92vh;overflow:auto;background:#fff;border:1px solid rgba(0,65,64,.14);border-radius:24px;box-shadow:0 28px 80px rgba(0,31,38,.22);}
.hpdms-calendar-booking-dialog-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;padding:26px 28px;background:linear-gradient(135deg,#064745,#0c7771);color:#fff;border-radius:24px 24px 0 0;}
.hpdms-calendar-booking-dialog-head span{display:block;text-transform:uppercase;letter-spacing:.12em;font-size:11px;font-weight:800;margin-bottom:8px;color:#c8fbf3;}
.hpdms-calendar-booking-dialog-head h2{margin:0 0 6px;color:#fff;font-size:24px;line-height:1.15;}
.hpdms-calendar-booking-dialog-head p{margin:0;color:rgba(255,255,255,.86);max-width:640px;}
.hpdms-calendar-booking-close{width:42px;height:42px;border-radius:999px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.14);color:#fff;font-size:26px;line-height:1;cursor:pointer;}
.hpdms-calendar-booking-form{padding:24px 28px 28px;}
.hpdms-calendar-booking-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 20px;}
.hpdms-calendar-booking-form-grid p{margin:0;}
.hpdms-calendar-booking-form-grid label{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:#275858;margin-bottom:7px;}
.hpdms-calendar-booking-form-grid input,
.hpdms-calendar-booking-form-grid select,
.hpdms-calendar-booking-form-grid textarea{width:100%;min-height:44px;border:1px solid rgba(0,65,64,.16);border-radius:14px;padding:10px 12px;background:#f9fdfc;color:#073b40;font:inherit;box-sizing:border-box;}
.hpdms-calendar-booking-form-grid textarea{min-height:92px;resize:vertical;}
.hpdms-calendar-booking-form-wide{grid-column:1/-1;}
.hpdms-calendar-booking-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:22px;padding-top:18px;border-top:1px solid rgba(0,65,64,.12);}
.hpdms-calendar-booking-footer label{font-weight:700;color:#285a5b;}
.hpdms-calendar-booking-note{margin:14px 0 0;color:#5f7779;font-size:13px;}
@media (max-width:760px){.hpdms-calendar-booking-form-grid{grid-template-columns:1fr}.hpdms-calendar-booking-footer{align-items:stretch;flex-direction:column}.hpdms-calendar-booking-dialog-head{padding:22px}.hpdms-calendar-booking-form{padding:22px}}

/* Phase 35 - calendar booking modal safety and availability UX */
body.hpdms-doctor-portal-page .hpdms-calendar-past-cell{
    cursor:not-allowed!important;
    background:rgba(12,49,71,.035)!important;
    opacity:.55!important;
}
body.hpdms-doctor-portal-page .hpdms-calendar-past-cell:hover{
    box-shadow:none!important;
    background:rgba(12,49,71,.035)!important;
}
body.hpdms-doctor-portal-page .hpdms-calendar-booking-dialog-head p{
    color:#e9fffb!important;
    opacity:1!important;
    font-weight:600!important;
    line-height:1.55!important;
}
body.hpdms-doctor-portal-page .hpdms-calendar-booking-dialog-head h2{
    color:#ffffff!important;
    text-shadow:0 1px 0 rgba(0,0,0,.08);
}
body.hpdms-doctor-portal-page .hpdms-calendar-booking-availability-status{
    margin:16px 0 0;
    padding:12px 14px;
    border-radius:14px;
    border:1px solid rgba(0,65,64,.14);
    background:#f6fbfb;
    color:#275858;
    font-weight:700;
}
body.hpdms-doctor-portal-page .hpdms-calendar-booking-availability-status.is-checking{
    background:#fff8e7;
    border-color:#efd99b;
    color:#6c5200;
}
body.hpdms-doctor-portal-page .hpdms-calendar-booking-availability-status.is-good{
    background:#e9fbf3;
    border-color:#9adfbe;
    color:#075e3d;
}
body.hpdms-doctor-portal-page .hpdms-calendar-booking-availability-status.is-bad{
    background:#fff0f0;
    border-color:#efb5b5;
    color:#8a1f1f;
}
body.hpdms-doctor-portal-page .hpdms-calendar-booking-submit:disabled{
    opacity:.45!important;
    cursor:not-allowed!important;
    box-shadow:none!important;
}

/* Phase 44: Consultation Workspace Upgrade */
body.hpdms-doctor-portal-page .hpdms-consult-workspace-wrap,
body.hpdms-admin-portal-page .hpdms-consult-workspace-wrap{
    max-width:1500px!important;
}

.hpdms-consult-workspace-hero{
    margin-bottom:18px!important;
}

.hpdms-consult-feedback-list{
    display:grid;
    gap:10px;
    margin:0 0 16px;
}

.hpdms-consult-feedback{
    padding:12px 14px;
    border-radius:14px;
    font-weight:800;
    border:1px solid #dbece8;
    background:#fff;
    color:#0f3d3e;
}

.hpdms-consult-feedback-success{
    background:#ecfdf5;
    border-color:#b7f7d4;
}

.hpdms-consult-feedback-warning{
    background:#fff7ed;
    border-color:#fed7aa;
}

.hpdms-consult-focus-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(220px,280px);
    gap:18px;
    align-items:stretch;
    padding:22px;
    border:1px solid rgba(15,61,62,.12);
    border-radius:24px;
    background:linear-gradient(135deg,#ffffff,#f5fbfa);
    box-shadow:0 18px 45px rgba(16,47,48,.08);
    margin-bottom:14px;
}

.hpdms-consult-kicker,
.hpdms-consult-card-headline span{
    display:inline-flex;
    align-items:center;
    width:max-content;
    padding:5px 10px;
    border-radius:999px;
    background:#e8f5f2;
    color:#0f3d3e;
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.06em;
}

.hpdms-consult-focus-main h2{
    margin:8px 0 8px!important;
    color:#0f3d3e!important;
    font-size:28px!important;
}

.hpdms-consult-focus-meta{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.hpdms-consult-focus-meta span{
    display:inline-flex;
    padding:7px 10px;
    border-radius:999px;
    background:#fff;
    border:1px solid #dce9e6;
    color:#365b5c;
    font-size:13px;
    font-weight:800;
}

.hpdms-consult-focus-status{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:flex-start;
    padding:16px;
    border-radius:20px;
    background:#0f3d3e;
    color:#fff;
}

.hpdms-consult-focus-status strong{
    font-size:22px;
    line-height:1.1;
}

.hpdms-consult-focus-status span{
    margin-top:4px;
    opacity:.88;
    font-size:13px;
    font-weight:700;
}

.hpdms-consult-safety-strip{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    margin:0 0 16px;
}

.hpdms-consult-safety-item{
    padding:14px 16px;
    border-radius:18px;
    border:1px solid #d8e8e4;
    background:#fff;
    box-shadow:0 10px 26px rgba(16,47,48,.05);
}

.hpdms-consult-safety-item strong{
    display:block;
    margin-bottom:5px;
    color:#0f3d3e;
    font-size:13px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.hpdms-consult-safety-item span{
    display:block;
    color:#355f60;
    font-size:14px;
    line-height:1.45;
}

.hpdms-consult-safety-alert{
    border-color:#fecaca!important;
    background:#fff7f7!important;
}

.hpdms-consult-workflow-strip{
    position:sticky;
    top:12px;
    z-index:15;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:8px;
    padding:8px;
    border-radius:18px;
    background:rgba(255,255,255,.94);
    border:1px solid #dce9e6;
    box-shadow:0 12px 28px rgba(16,47,48,.08);
    margin:0 0 16px;
    backdrop-filter:blur(10px);
}

.hpdms-consult-workflow-strip a{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:42px;
    border-radius:14px;
    background:#f5fbfa;
    color:#0f3d3e!important;
    text-decoration:none!important;
    font-weight:900;
}

.hpdms-consult-workflow-strip strong{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:24px;
    height:24px;
    border-radius:50%;
    background:#0f3d3e;
    color:#fff;
    font-size:12px;
}

.hpdms-consult-workflow-strip span{
    font-size:13px;
}

.hpdms-consult-status-panel,
.hpdms-consult-clinical-work-panel,
.hpdms-consult-uploads-panel,
.hpdms-consult-history-section{
    margin-bottom:18px!important;
}

.hpdms-consult-status-panel{
    border-radius:22px!important;
    border:1px solid #dbe9e6!important;
    box-shadow:0 12px 32px rgba(16,47,48,.05)!important;
}

.hpdms-consult-current-status{
    display:inline-flex;
    padding:8px 12px;
    border-radius:999px;
    background:#e8f5f2;
    color:#0f3d3e;
    font-size:12px;
    font-weight:900;
}

.hpdms-consult-workspace-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 390px;
    gap:18px;
    align-items:start;
}

.hpdms-consult-workspace-main{
    min-width:0;
}

.hpdms-consult-workspace-side{
    position:sticky;
    top:88px;
    display:grid;
    gap:14px;
}

.hpdms-consult-side-card{
    border-radius:20px!important;
    border:1px solid #dce9e6!important;
    box-shadow:0 12px 28px rgba(16,47,48,.06)!important;
}

.hpdms-consult-side-card h2{
    margin:0 0 12px!important;
    color:#0f3d3e!important;
    font-size:18px!important;
}

.hpdms-consult-side-card p{
    margin:8px 0!important;
    color:#365b5c!important;
    line-height:1.45!important;
}

.hpdms-consult-side-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:12px;
}

.hpdms-consult-attention-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}

.hpdms-consult-attention-grid a{
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:13px;
    border-radius:15px;
    border:1px solid #dce9e6;
    background:#f8fdfc;
    color:#0f3d3e!important;
    text-decoration:none!important;
}

.hpdms-consult-attention-grid strong{
    font-size:22px;
    line-height:1;
}

.hpdms-consult-attention-grid span{
    color:#597677;
    font-size:12px;
    font-weight:800;
}

.hpdms-consult-context-list,
.hpdms-consult-link-list,
.hpdms-consult-checklist{
    display:grid;
    gap:9px;
}

.hpdms-consult-context-list a,
.hpdms-consult-link-list a{
    display:block;
    padding:11px 12px;
    border-radius:14px;
    border:1px solid #dce9e6;
    background:#fff;
    color:#0f3d3e!important;
    text-decoration:none!important;
    font-weight:900;
}

.hpdms-consult-context-list a span{
    display:block;
    margin-top:4px;
    color:#668081;
    font-size:12px;
    font-weight:700;
}

.hpdms-consult-checklist label{
    display:flex;
    align-items:center;
    gap:9px;
    margin:0!important;
    padding:10px 11px;
    border-radius:13px;
    border:1px solid #dce9e6;
    background:#f8fdfc;
    color:#315a5b;
    font-weight:800;
}

.hpdms-consult-action-grid-stacked{
    grid-template-columns:1fr!important;
}

.hpdms-consult-card-headline{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:12px;
}

.hpdms-consult-card-headline h3{
    margin:0!important;
}

.hpdms-consult-form-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    margin-top:12px;
}

.hpdms-consult-form-footer span{
    color:#6b8586;
    font-size:13px;
    font-weight:700;
}

.hpdms-consult-medication-item{
    margin-top:12px;
    padding:14px;
    border:1px dashed #c9ded9;
    border-radius:16px;
    background:#fbfefd;
}

.hpdms-consult-medication-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:8px;
}

.hpdms-consult-medication-head strong{
    color:#0f3d3e;
}

.hpdms-consult-remove-medication{
    border:1px solid #f3c7c7;
    border-radius:999px;
    background:#fff7f7;
    color:#9f1239;
    padding:5px 9px;
    font-size:12px;
    font-weight:900;
    cursor:pointer;
}

.hpdms-consult-remove-medication:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.hpdms-consult-muted{
    margin:0 0 12px!important;
    color:#597677!important;
    font-size:13px!important;
}

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

.hpdms-consult-summary-panel{
    border-radius:20px!important;
    border:1px solid #dce9e6!important;
    box-shadow:0 10px 26px rgba(16,47,48,.05)!important;
}

.hpdms-consult-summary-list{
    display:grid;
    gap:10px;
}

.hpdms-consult-summary-item{
    padding:12px;
    border-radius:14px;
    border:1px solid #dce9e6;
    background:#fbfefd;
}

.hpdms-consult-summary-item strong,
.hpdms-consult-summary-item span{
    display:block;
}

.hpdms-consult-summary-item strong{
    color:#0f3d3e;
    font-size:14px;
}

.hpdms-consult-summary-item span{
    color:#6b8586;
    font-size:12px;
    margin-top:3px;
    font-weight:800;
}

.hpdms-consult-summary-item p{
    margin:7px 0 0!important;
    color:#365b5c!important;
    font-size:13px!important;
}

.hpdms-consult-timeline-card{
    margin-top:18px!important;
}

@media(max-width:1180px){
    .hpdms-consult-workspace-layout{
        grid-template-columns:1fr;
    }
    .hpdms-consult-workspace-side{
        position:static;
    }
}

@media(max-width:900px){
    .hpdms-consult-focus-card,
    .hpdms-consult-safety-strip,
    .hpdms-consult-summary-grid{
        grid-template-columns:1fr;
    }
    .hpdms-consult-workflow-strip{
        grid-template-columns:1fr;
        position:static;
    }
}

@media(max-width:640px){
    .hpdms-consult-focus-card{
        padding:16px;
    }
    .hpdms-consult-focus-main h2{
        font-size:22px!important;
    }
    .hpdms-consult-form-footer{
        align-items:stretch;
        flex-direction:column;
    }
    .hpdms-consult-form-footer .hpdms-frontend-primary-btn,
    .hpdms-consult-form-footer .hpdms-frontend-small-btn{
        width:100%;
        justify-content:center;
    }
}

/* Phase 45 - Prescription Centre */
.hpdms-prescription-centre-wrap {
    display: grid;
    gap: 18px;
}

.hpdms-prescription-centre-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.hpdms-prescription-centre-hero h2 {
    margin: 4px 0 8px;
}

.hpdms-prescription-centre-actions,
.hpdms-prescription-mini-actions,
.hpdms-prescription-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hpdms-prescription-card-actions form {
    margin: 0;
}

.hpdms-prescription-card-actions button.hpdms-frontend-small-btn {
    border: 0;
    cursor: pointer;
}

.hpdms-prescription-centre-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hpdms-prescription-centre-stats > div,
.hpdms-prescription-safety-card,
.hpdms-prescription-centre-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}

.hpdms-prescription-centre-stats > div {
    padding: 16px;
}

.hpdms-prescription-centre-stats span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hpdms-prescription-centre-stats strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
}

.hpdms-prescription-centre-stats p,
.hpdms-prescription-safety-card p,
.hpdms-prescription-card-head p {
    margin: 8px 0 0;
    color: #64748b;
    line-height: 1.5;
}

.hpdms-prescription-safety-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hpdms-prescription-safety-card {
    padding: 16px;
}

.hpdms-prescription-safety-card strong {
    color: #0f172a;
}

.hpdms-prescription-safety-alert {
    border-color: rgba(185, 28, 28, .24);
    background: #fff7f7;
}

.hpdms-prescription-mini-actions {
    margin-top: 10px;
}

.hpdms-prescription-mini-actions a {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 10px;
    background: #eef8f4;
    color: #0f6b4d;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.hpdms-prescription-centre-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.hpdms-prescription-centre-panel {
    min-width: 0;
}

.hpdms-prescription-centre-list {
    display: grid;
    gap: 14px;
}

.hpdms-prescription-centre-card {
    padding: 16px;
}

.hpdms-prescription-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.hpdms-prescription-card-head h3 {
    margin: 8px 0 0;
    font-size: 18px;
    color: #0f172a;
}

.hpdms-prescription-card-issued {
    border-color: rgba(9, 116, 77, .18);
}

.hpdms-prescription-card-draft {
    border-color: rgba(245, 158, 11, .22);
}

.hpdms-prescription-items-compact {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.hpdms-prescription-items-compact li {
    display: grid;
    gap: 2px;
}

.hpdms-prescription-items-compact span {
    color: #64748b;
    font-size: 13px;
}

.hpdms-prescription-items-table {
    display: grid;
    gap: 10px;
}

.hpdms-prescription-item-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.35fr) repeat(5, minmax(80px, .75fr));
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: 14px;
    background: #f8fafc;
}

.hpdms-prescription-item-row > div {
    display: grid;
    gap: 3px;
}

.hpdms-prescription-item-row strong {
    color: #0f172a;
    font-size: 12px;
}

.hpdms-prescription-item-row span,
.hpdms-prescription-item-row small {
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

.hpdms-prescription-item-main {
    display: flex !important;
    gap: 10px !important;
    align-items: flex-start;
}

.hpdms-prescription-item-main > span:first-child {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e6f5ef;
    color: #0f6b4d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.hpdms-prescription-item-main div {
    display: grid;
    gap: 3px;
}

.hpdms-prescription-item-instructions {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(15, 23, 42, .08);
    padding-top: 8px;
}

.hpdms-prescription-document-details {
    margin-top: 12px;
    border: 1px dashed rgba(15, 23, 42, .14);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.hpdms-prescription-document-details summary {
    cursor: pointer;
    color: #0f6b4d;
    font-weight: 900;
}

.hpdms-prescription-document-details div {
    margin-top: 10px;
    color: #334155;
    line-height: 1.5;
    white-space: normal;
}

@media (max-width: 1180px) {
    .hpdms-prescription-centre-columns,
    .hpdms-prescription-safety-grid,
    .hpdms-prescription-centre-stats {
        grid-template-columns: 1fr;
    }

    .hpdms-prescription-item-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hpdms-prescription-item-main,
    .hpdms-prescription-item-instructions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .hpdms-prescription-centre-hero,
    .hpdms-prescription-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .hpdms-prescription-card-actions,
    .hpdms-prescription-centre-actions {
        align-items: stretch;
    }

    .hpdms-prescription-card-actions a,
    .hpdms-prescription-card-actions button,
    .hpdms-prescription-centre-actions a {
        width: 100%;
        justify-content: center;
    }

    .hpdms-prescription-item-row {
        grid-template-columns: 1fr;
    }
}

/* Phase 46 - Global Search and Quick Actions */
.hpdms-global-topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 260px;
    flex: 1 1 360px;
    max-width: 520px;
}

.hpdms-global-topbar-search input[type="search"] {
    width: 100%;
    border: 1px solid rgba(15, 78, 85, 0.18);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    background: #ffffff;
    color: #173b3f;
}

.hpdms-global-topbar-search button,
.hpdms-dashboard-global-search button,
.hpdms-global-search-main-form button,
.hpdms-quick-patient-task-form button {
    border: 0;
    border-radius: 999px;
    background: #0f5963;
    color: #ffffff;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
}

.hpdms-global-topbar-search button:hover,
.hpdms-dashboard-global-search button:hover,
.hpdms-global-search-main-form button:hover,
.hpdms-quick-patient-task-form button:hover {
    background: #0a3f46;
}

.hpdms-dashboard-start-panel-search {
    align-items: stretch;
}

.hpdms-dashboard-global-search,
.hpdms-global-search-main-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
}

.hpdms-dashboard-global-search input[type="search"],
.hpdms-global-search-main-form input[type="search"] {
    flex: 1 1 320px;
    min-width: 240px;
    border: 1px solid rgba(15, 78, 85, 0.18);
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 15px;
    background: #ffffff;
    color: #173b3f;
}

.hpdms-global-search-main-form a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 16px;
    text-decoration: none;
    background: #e8f3f4;
    color: #0f5963;
    font-weight: 700;
}

.hpdms-global-search-panel,
.hpdms-quick-patient-task-card,
.hpdms-global-search-summary,
.hpdms-global-search-empty {
    background: #ffffff;
    border: 1px solid rgba(15, 78, 85, 0.10);
    border-radius: 24px;
    box-shadow: 0 14px 40px rgba(12, 54, 59, 0.07);
    margin-bottom: 18px;
    padding: 24px;
}

.hpdms-global-search-panel h2,
.hpdms-quick-patient-task-card h2,
.hpdms-quick-actions-section h2 {
    margin: 6px 0 8px;
    color: #123a40;
}

.hpdms-global-search-panel p,
.hpdms-quick-patient-task-card p,
.hpdms-quick-action-card p {
    color: #557174;
}

.hpdms-global-search-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.hpdms-global-search-summary strong {
    color: #123a40;
    font-size: 18px;
}

.hpdms-global-search-results {
    display: grid;
    gap: 18px;
}

.hpdms-global-search-group {
    background: #ffffff;
    border: 1px solid rgba(15, 78, 85, 0.10);
    border-radius: 24px;
    box-shadow: 0 14px 40px rgba(12, 54, 59, 0.06);
    overflow: hidden;
}

.hpdms-global-search-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(15, 89, 99, 0.10), rgba(245, 250, 250, 0.95));
    border-bottom: 1px solid rgba(15, 78, 85, 0.08);
}

.hpdms-global-search-group-head h2 {
    margin: 0;
    color: #123a40;
    font-size: 18px;
}

.hpdms-global-search-group-head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #0f5963;
    color: #ffffff;
    font-weight: 800;
}

.hpdms-global-search-card-list {
    display: grid;
    gap: 0;
}

.hpdms-global-search-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(15, 78, 85, 0.08);
}

.hpdms-global-search-card:last-child {
    border-bottom: 0;
}

.hpdms-global-search-card-main > span,
.hpdms-quick-action-card > span {
    display: inline-flex;
    width: max-content;
    border-radius: 999px;
    background: #e8f3f4;
    color: #0f5963;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    margin-bottom: 8px;
}

.hpdms-global-search-card h3 {
    margin: 0 0 5px;
    color: #123a40;
    font-size: 17px;
}

.hpdms-global-search-card p {
    margin: 4px 0 0;
    color: #557174;
}

.hpdms-global-search-meta {
    font-size: 13px;
    color: #6d8386 !important;
}

.hpdms-global-search-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}


/* Phase 47.1 - Global search result cards polish */
.hpdms-global-search-group {
    padding-bottom: 14px;
}

.hpdms-global-search-card-list {
    gap: 12px;
    padding: 14px;
}

.hpdms-global-search-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(15, 78, 85, 0.10);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(12, 54, 59, 0.05);
}

.hpdms-global-search-card + .hpdms-global-search-card {
    margin-top: 0;
}

.hpdms-global-search-card:last-child {
    border-bottom: 1px solid rgba(15, 78, 85, 0.10);
}

.hpdms-global-search-card-main {
    min-width: 0;
}

.hpdms-global-search-card-main > span {
    margin-bottom: 10px;
}

.hpdms-global-search-card h3 {
    line-height: 1.25;
}

.hpdms-global-search-actions {
    align-self: center;
    min-width: 220px;
}

.hpdms-quick-patient-task-card {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: 24px;
    align-items: center;
}

.hpdms-quick-patient-task-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) auto;
    gap: 12px;
    align-items: end;
}

.hpdms-quick-patient-task-form label {
    display: grid;
    gap: 6px;
    color: #456568;
    font-size: 13px;
    font-weight: 800;
}

.hpdms-quick-patient-task-form select {
    width: 100%;
    border: 1px solid rgba(15, 78, 85, 0.18);
    border-radius: 14px;
    padding: 12px 14px;
    background: #ffffff;
    color: #173b3f;
}

.hpdms-quick-actions-grid {
    display: grid;
    gap: 20px;
}

.hpdms-quick-actions-section {
    background: #ffffff;
    border: 1px solid rgba(15, 78, 85, 0.10);
    border-radius: 24px;
    box-shadow: 0 14px 40px rgba(12, 54, 59, 0.06);
    padding: 22px;
}

.hpdms-quick-actions-section h2 {
    margin-top: 0;
}

.hpdms-quick-action-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hpdms-quick-action-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 168px;
    border: 1px solid rgba(15, 78, 85, 0.10);
    border-radius: 20px;
    padding: 18px;
    text-decoration: none;
    background: #f8fbfb;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.hpdms-quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(12, 54, 59, 0.10);
    border-color: rgba(15, 89, 99, 0.25);
}

.hpdms-quick-action-card strong {
    color: #123a40;
    font-size: 17px;
}

.hpdms-quick-action-card p {
    flex: 1;
    margin: 3px 0 12px;
    line-height: 1.45;
}

.hpdms-quick-action-card em {
    color: #0f5963;
    font-style: normal;
    font-weight: 800;
}

.hpdms-quick-actions-note {
    margin: 12px 0 0;
    color: #8a5a11;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .hpdms-global-topbar-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .hpdms-quick-patient-task-card,
    .hpdms-quick-patient-task-form {
        grid-template-columns: 1fr;
    }

    .hpdms-quick-action-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .hpdms-global-search-card {
        grid-template-columns: 1fr;
    }

    .hpdms-global-search-actions {
        justify-content: flex-start;
    }

    .hpdms-quick-action-card-grid {
        grid-template-columns: 1fr;
    }
}
