/* ============================================================
   Shared modal + message styles - loaded on client pages
   (src/views/layouts/header.php) and mgmt pages (v2.header.php,
   view-details.php). Plain hex values: client pages don't load
   mgmt/css/v2.css or its --v2-* tokens.
   ============================================================ */

/* ---- Modal standard (matches the client income-limit modal) ----
   Brand-blue header with a white title, roomier padding, larger text.
   Add .v2-modal to a .modal-content to use it. */
.v2-modal {
	border: 0;
	border-radius: 0.75rem;
	overflow: hidden;
	box-shadow: 0 1rem 3rem rgba(33, 41, 107, 0.25);
	font-size: 1.05rem;
	color: #2f3747;
}

.v2-modal .modal-header {
	align-items: flex-start;
	padding: 1.25rem 1.75rem;
	background-color: #0044b5;
	border-bottom: none;
	color: #ffffff;
}

.v2-modal .modal-title {
	color: #ffffff;
	font-weight: 700;
	font-size: 1.35rem;
}

.v2-modal .modal-header .btn-close {
	margin-top: 0.15rem;
	filter: invert(1) grayscale(100%) brightness(200%);
	opacity: 0.9;
}

.v2-modal .modal-body {
	padding: 1.5rem 1.75rem;
}

.v2-modal .modal-footer {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.75rem 1.25rem;
	border-top: 1px solid #e9ecef;
}

.v2-modal .btn {
	font-size: 1rem;
	font-weight: 600;
	padding: 0.6rem 1.35rem;
	border-radius: 0.5rem;
}

.v2-modal .btn-link {
	padding-left: 0.5rem;
	padding-right: 0.5rem;
	color: #0044b5;
	font-weight: 500;
}

.v2-modal .form-control,
.v2-modal .form-select {
	font-size: 1rem;
	padding: 0.7rem 0.9rem;
	border-radius: 0.5rem;
	border: 1.5px solid #cdd5e3;
}

.v2-modal .form-select {
	padding-right: 2.5rem;
}

.v2-modal .form-control:focus,
.v2-modal .form-select:focus {
	border-color: #0044b5;
	box-shadow: 0 0 0 0.25rem rgba(0, 68, 181, 0.2);
}

.v2-modal .form-control::placeholder {
	color: #6c757d;
}

.v2-modal__label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 700;
}

.v2-modal__hint {
	font-size: 0.85rem;
	color: #646567;
}

.v2-modal__footer-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

@media (max-width: 575.98px) {
	.v2-modal .modal-footer,
	.v2-modal__footer-actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.v2-modal .modal-footer .btn {
		width: 100%;
	}
}

.v2-modal__subtitle {
	margin: 0.25rem 0 0;
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.85);
}

.v2-modal__subtitle .v2-badge {
	vertical-align: middle;
}

/* ---- Message Center (client + mgmt) ---- */
.v2-modal__intro {
	margin-bottom: 1.25rem;
}

.v2-modal__intro p:last-child {
	margin-bottom: 0;
}

.v2-modal__panel {
	padding: 1.25rem;
	margin-bottom: 1.75rem;
	border: 1.5px solid #d7deff;
	border-radius: 0.6rem;
	background: #f8faff;
}

.v2-modal__panel-foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 0.85rem;
}

.v2-modal__section-title {
	color: #0044b5;
	font-weight: 700;
	font-size: 1.1rem;
	margin-bottom: 0.75rem;
}

.v2-modal textarea.form-control:disabled {
	background-color: #f5f6f8;
	cursor: not-allowed;
}

/* mgmt Message Center: intake picker row */
.v2-modal__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem 1.25rem;
	margin-bottom: 1.5rem;
}

.v2-modal__toolbar-field {
	flex: 1 1 320px;
}

.v2-modal__toolbar .form-check {
	margin-bottom: 0.65rem;
	font-size: 0.95rem;
}

.v2-modal__link {
	font-weight: 600;
	color: #0044b5;
	text-decoration: none;
}

.v2-modal__link:hover {
	text-decoration: underline;
}

/* Message thread cards (newest first) */
.v2-thread__msg {
	padding: 0.9rem 1.1rem;
	margin-bottom: 0.75rem;
	border-left: 4px solid #cccccc;
	border-radius: 0.5rem;
	background: #f8f9fa;
	text-align: left;
}

.v2-thread__msg--mgmt {
	border-left-color: #0044b5;
	background: #eef4ff;
}

.v2-thread__msg--unread {
	border-left-color: #fd372c;
	background: #fff1ee;
}

.v2-thread__head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.95rem;
	margin-bottom: 0.35rem;
}

.v2-thread__time {
	margin-left: auto;
	color: #646567;
	font-size: 0.85rem;
	white-space: nowrap;
}

.v2-thread__body {
	font-size: 1rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.v2-thread__empty {
	color: #646567;
	margin: 0;
}

/* ---- "Message sent" confirmation popup (client + mgmt Message Center) ---- */
/* Confirmation Modal Overlay */
.g3Confirmation__Overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1999;
	opacity: 0;
	visibility: hidden;
	backdrop-filter: blur(2px);
}

/* Modern Confirmation Modal */
.g3Confirmation__LB {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: fixed;
	width: 90%;
	max-width: 480px;
	height: auto;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	margin: 0;
	padding: 2.5rem 2rem 2rem;
	background-color: #ffffff;
	border: none;
	border-radius: 16px;
	box-shadow:
		0 20px 60px rgba(0, 0, 0, 0.15),
		0 8px 20px rgba(0, 0, 0, 0.1);
	z-index: 2000;
	opacity: 0;
	visibility: hidden;
}

.g3Confirmation__LB::before {
	content: '';
	display: block;
	width: 64px;
	height: 64px;
	margin-bottom: 1.25rem;
	background-color: #d4edda;
	border-radius: 50%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23198754' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
	background-size: 32px 32px;
	background-position: center;
	background-repeat: no-repeat;
}

.g3Confirmation__LB p {
	font-size: 1rem;
	line-height: 1.6;
	color: #495057;
	margin: 0 0 1.5rem 0;
	max-width: 380px;
}

.g3Confirmation__LB .btn {
	min-width: 140px;
	padding: 0.75rem 2rem;
	font-weight: 600;
	border-radius: 8px;
	transition: all 0.2s ease;
}

.g3Confirmation__LB .btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 68, 181, 0.3);
}
