/* 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;
    }
}
