/* Patient area — Pharmelia */
.ph-ep-dashboard {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin: 0 0 32px;
}

.ph-ep-dashboard__card {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-areas:
		"icon count"
		"icon label"
		"link link";
	gap: 2px 14px;
	align-items: center;
	padding: 22px 24px;
	background: #fff;
	border: 1px solid rgba(5, 72, 47, 0.12);
	border-radius: 18px;
	text-decoration: none;
	box-shadow: 0 10px 30px rgba(12, 36, 24, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ph-ep-dashboard__card:hover,
.ph-ep-dashboard__card:focus {
	transform: translateY(-2px);
	border-color: var(--ph-accent, #b08828);
	box-shadow: 0 16px 36px rgba(12, 36, 24, 0.1);
}

.ph-ep-dashboard__card > svg {
	grid-area: icon;
	width: 44px;
	height: 44px;
	padding: 11px;
	color: var(--ph-primary, #05482f);
	background: var(--ph-soft, #f3f5ee);
	border-radius: 14px;
}

.ph-ep-dashboard__count {
	grid-area: count;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
	color: var(--ph-ink, #0c2418);
}

.ph-ep-dashboard__label {
	grid-area: label;
	font-size: 14px;
	color: var(--ph-body, #50635a);
}

.ph-ep-dashboard__link {
	grid-area: link;
	margin-top: 12px;
	font-size: 13px;
	font-weight: 700;
	color: var(--ph-primary, #05482f);
}

.ph-ep-card {
	margin: 0 0 26px;
	padding: 26px 28px;
	background: #fff;
	border: 1px solid rgba(5, 72, 47, 0.1);
	border-radius: 20px;
	box-shadow: 0 8px 26px rgba(12, 36, 24, 0.05);
}

.ph-ep-card__title {
	margin: 0 0 8px;
	font-size: 22px;
	line-height: 1.25;
	color: var(--ph-ink, #0c2418);
}

.ph-ep-card__intro {
	margin: 0 0 20px;
	color: var(--ph-body, #50635a);
}

.ph-ep-notice {
	margin: 0 0 22px;
	padding: 14px 18px;
	border-radius: 14px;
	border-left: 4px solid var(--ph-primary, #05482f);
	background: var(--ph-soft, #f3f5ee);
	color: var(--ph-ink, #0c2418);
	font-size: 14px;
}

.ph-ep-notice--error {
	border-left-color: #b3261e;
	background: #fdf1f0;
}

.ph-ep-form {
	display: grid;
	gap: 16px;
}

.ph-ep-form--inline {
	grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
	align-items: end;
}

.ph-ep-field {
	display: grid;
	gap: 7px;
}

.ph-ep-field label {
	font-size: 13px;
	font-weight: 700;
	color: var(--ph-ink, #0c2418);
}

.ph-ep-field input,
.ph-ep-field select,
.ph-ep-field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid rgba(12, 36, 24, 0.16);
	border-radius: 12px;
	background: #fff;
	color: var(--ph-ink, #0c2418);
	font: inherit;
	font-size: 15px;
	line-height: 1.5;
}

.ph-ep-field textarea {
	resize: vertical;
	min-height: 110px;
}

.ph-ep-field input:focus,
.ph-ep-field select:focus,
.ph-ep-field textarea:focus {
	outline: 2px solid var(--ph-accent, #b08828);
	outline-offset: 1px;
	border-color: var(--ph-accent, #b08828);
}

.ph-ep-optional {
	font-weight: 400;
	color: var(--ph-body, #50635a);
}

.ph-ep-hint {
	margin: 0;
	font-size: 13px;
	color: var(--ph-body, #50635a);
}

.ph-ep-btn,
.ph-ep-card .ph-ep-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	padding: 12px 22px;
	border: 1px solid var(--ph-primary, #05482f);
	border-radius: 999px;
	background: var(--ph-primary, #05482f);
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ph-ep-btn:hover,
.ph-ep-btn:focus {
	background: var(--ph-primary-dark, #033a26);
	border-color: var(--ph-primary-dark, #033a26);
	color: #fff !important;
}

.ph-ep-btn--ghost {
	background: transparent;
	color: var(--ph-primary, #05482f) !important;
}

.ph-ep-btn--ghost:hover,
.ph-ep-btn--ghost:focus {
	background: var(--ph-soft, #f3f5ee);
	color: var(--ph-primary, #05482f) !important;
}

.ph-ep-btn--small {
	padding: 8px 16px;
	font-size: 13px;
}

.ph-ep-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.ph-ep-empty {
	margin: 0 0 18px;
	padding: 18px 20px;
	border-radius: 14px;
	background: var(--ph-soft, #f3f5ee);
	color: var(--ph-body, #50635a);
}

.ph-ep-threads {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ph-ep-thread__link {
	display: grid;
	gap: 8px;
	padding: 16px 18px;
	border: 1px solid rgba(12, 36, 24, 0.1);
	border-radius: 14px;
	text-decoration: none;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.ph-ep-thread__link:hover,
.ph-ep-thread__link:focus {
	border-color: var(--ph-accent, #b08828);
	background: var(--ph-bg, #f6f7f1);
}

.ph-ep-thread--answered .ph-ep-thread__link {
	border-left: 4px solid var(--ph-accent, #b08828);
}

.ph-ep-thread__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.ph-ep-thread__subject {
	font-size: 16px;
	font-weight: 700;
	color: var(--ph-ink, #0c2418);
}

.ph-ep-thread__date {
	font-size: 12px;
	color: var(--ph-body, #50635a);
}

.ph-ep-thread__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--ph-body, #50635a);
}

.ph-ep-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--ph-soft, #f3f5ee);
	color: var(--ph-body, #50635a);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
}

.ph-ep-badge--new {
	background: #fbf3df;
	color: #7a5a12;
}

.ph-ep-back {
	margin: 0 0 14px;
	font-size: 14px;
}

.ph-ep-back a {
	color: var(--ph-primary, #05482f);
	font-weight: 700;
	text-decoration: none;
}

.ph-ep-conversation__head {
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(12, 36, 24, 0.1);
}

.ph-ep-conversation__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 13px;
	color: var(--ph-body, #50635a);
}

.ph-ep-messages {
	display: grid;
	gap: 16px;
	margin: 22px 0;
	padding: 0;
	list-style: none;
}

.ph-ep-message {
	max-width: 88%;
	padding: 14px 18px;
	border-radius: 16px;
	background: var(--ph-soft, #f3f5ee);
}

.ph-ep-message--patient {
	justify-self: end;
	background: var(--ph-primary, #05482f);
	color: #fff;
}

.ph-ep-message--pharmacy {
	justify-self: start;
	background: #fff;
	border: 1px solid rgba(5, 72, 47, 0.14);
}

.ph-ep-message__author {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	opacity: 0.85;
}

.ph-ep-message__author span {
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	opacity: 0.8;
}

.ph-ep-message__body {
	font-size: 15px;
	line-height: 1.6;
}

.ph-ep-message__body p {
	margin: 0 0 0.7em;
}

.ph-ep-message__body p:last-child {
	margin-bottom: 0;
}

.ph-ep-reply {
	padding-top: 20px;
	border-top: 1px solid rgba(12, 36, 24, 0.1);
}

.ph-ep-closed {
	margin: 0;
	padding: 16px 18px;
	border-radius: 14px;
	background: var(--ph-soft, #f3f5ee);
	color: var(--ph-body, #50635a);
}

.ph-ep-closed a {
	color: var(--ph-primary, #05482f);
	font-weight: 700;
}

.ph-ep-requests {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ph-ep-request {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: 16px;
	padding: 16px 18px;
	border: 1px solid rgba(12, 36, 24, 0.1);
	border-radius: 14px;
}

.ph-ep-request__main {
	display: grid;
	gap: 4px;
}

.ph-ep-request__ref {
	font-size: 15px;
	font-weight: 700;
	color: var(--ph-ink, #0c2418);
}

.ph-ep-request__date {
	font-size: 13px;
	color: var(--ph-body, #50635a);
}

.ph-ep-status {
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	background: #fbf3df;
	color: #7a5a12;
}

.ph-ep-status--traite {
	background: #e8f4ec;
	color: #146b3a;
}

.ph-ep-status--annule {
	background: #fdf1f0;
	color: #9b1c13;
}

.ph-ep-link {
	background: var(--ph-bg, #f6f7f1);
}

@media (max-width: 860px) {
	.ph-ep-dashboard {
		grid-template-columns: 1fr;
	}

	.ph-ep-form--inline {
		grid-template-columns: 1fr;
	}

	.ph-ep-request {
		grid-template-columns: 1fr auto;
	}

	.ph-ep-request .ph-ep-btn {
		grid-column: 1 / -1;
		justify-self: start;
	}

	.ph-ep-message {
		max-width: 100%;
	}
}

@media (max-width: 600px) {
	.ph-ep-card {
		padding: 20px 18px;
	}

	.ph-ep-dashboard__card {
		padding: 18px;
	}
}
