/* Contenedor principal */
.cea-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1e293b;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 24px;
	box-sizing: border-box;
	max-width: 1200px;
	margin: 0 auto;
}

.cea-wrapper *,
.cea-wrapper *::before,
.cea-wrapper *::after {
	box-sizing: border-box;
}

/* Barra de navegación mensual */
.cea-nav-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
}

.cea-nav-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Botones Anterior / Siguiente */
.cea-wrapper .cea-nav-btn {
	appearance: none;
	background-color: #1b4332 !important;
	color: #ffffff !important;
	border: none !important;
	padding: 9px 18px !important;
	margin: 0 !important;
	border-radius: 9999px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.cea-wrapper .cea-nav-btn:hover {
	background-color: #2d6a4f !important;
}

.cea-wrapper .cea-nav-btn:active {
	transform: scale(0.97);
}

/* Selector desplegable de mes/año */
.cea-month-picker-wrap {
	position: relative;
}

.cea-wrapper .cea-month-title {
	appearance: none;
	background-color: #1b4332 !important;
	color: #ffffff !important;
	border: none !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	cursor: pointer;
	padding: 9px 18px !important;
	border-radius: 9999px !important;
	line-height: 1.2 !important;
	transition: background-color 0.2s ease;
}

.cea-wrapper .cea-month-title svg {
	width: 16px !important;
	height: 16px !important;
	stroke: #ffffff !important;
	fill: none !important;
	flex-shrink: 0;
}

.cea-wrapper .cea-month-title:hover {
	background-color: #2d6a4f !important;
}

.cea-month-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 50;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
	padding: 14px;
	width: 260px;
}

.cea-dropdown-year-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	font-weight: 700;
	font-size: 15px;
	color: #0f172a;
}

.cea-wrapper .cea-dropdown-year-nav button {
	background: #f1f5f9 !important;
	color: #0f172a !important;
	border: none !important;
	border-radius: 4px !important;
	padding: 4px 10px !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	cursor: pointer;
}

.cea-dropdown-months-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}

.cea-wrapper .cea-dropdown-month-item {
	background: transparent !important;
	border: 1px solid transparent !important;
	border-radius: 4px !important;
	padding: 6px 4px !important;
	font-size: 13px !important;
	cursor: pointer;
	text-align: center;
	color: #334155 !important;
}

.cea-wrapper .cea-dropdown-month-item:hover {
	background: #f1f5f9 !important;
}

.cea-wrapper .cea-dropdown-month-item.is-active {
	background: #1b4332 !important;
	color: #ffffff !important;
	font-weight: 600 !important;
}

/* Contenedor principal de vista */
.cea-grid-container {
	position: relative;
	min-height: 360px;
}

.cea-loading-overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 25;
}

.cea-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #e2e8f0;
	border-top-color: #1b4332;
	border-radius: 50%;
	animation: ceaSpin 0.7s linear infinite;
}

@keyframes ceaSpin {
	to { transform: rotate(360deg); }
}

/* Aviso centrado vertical y horizontalmente cuando no hay eventos */
.cea-empty-notice {
	min-height: 360px;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 20px;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
}

.cea-empty-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 16px;
}

.cea-empty-text {
	margin: 0 !important;
	font-size: 1.5rem !important;
	font-weight: 700 !important;
	color: #1e293b !important;
	line-height: 1.3 !important;
}

.cea-wrapper .cea-jump-btn {
	background-color: #1b4332 !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 9999px !important;
	padding: 11px 24px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.cea-wrapper .cea-jump-btn:hover {
	background-color: #2d6a4f !important;
}

/* Cabecera días de la semana */
.cea-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	border-bottom: 1px solid #e2e8f0;
	padding-bottom: 10px;
}

.cea-weekdays > div {
	font-size: 11px;
	font-weight: 600;
	color: #64748b;
	letter-spacing: 0.05em;
	padding-left: 10px;
}

/* Cuadrícula del calendario */
.cea-calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	border-left: 1px solid #e2e8f0;
}

.cea-day-cell {
	min-height: 135px;
	border-right: 1px solid #e2e8f0;
	border-bottom: 1px solid #e2e8f0;
	padding: 10px;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cea-day-cell.is-other-month {
	background: #fafafa;
}

.cea-day-number {
	font-size: 18px;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.2;
	margin-bottom: 2px;
}

.cea-day-cell.is-past .cea-day-number,
.cea-day-cell.is-other-month .cea-day-number {
	color: #94a3b8;
	font-weight: 600;
}

.cea-day-cell.is-today .cea-day-number {
	color: #1b4332;
}

/* Lista de eventos dentro de cada celda */
.cea-day-events {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cea-event-item {
	display: block;
	text-decoration: none !important;
	line-height: 1.35;
	transition: opacity 0.15s;
}

.cea-event-time {
	display: block;
	font-size: 11.5px;
	color: #64748b;
	margin-bottom: 1px;
}

.cea-event-title {
	display: block;
	font-size: 12.5px;
	font-weight: 500;
	color: #1e293b;
	word-break: break-word;
}

.cea-day-cell.is-past .cea-event-time {
	color: #94a3b8;
}

.cea-day-cell.is-past .cea-event-title {
	color: #64748b;
}

.cea-event-item:hover .cea-event-title {
	color: #1b4332;
	text-decoration: underline !important;
}

.cea-wrapper .cea-more-btn {
	background: none !important;
	border: none !important;
	padding: 2px 0 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	color: #475569 !important;
	text-align: left;
	cursor: pointer;
}

.cea-wrapper .cea-more-btn:hover {
	color: #1b4332 !important;
}

/* Tarjeta flotante (Popover al hacer hover) */
.cea-popover {
	position: fixed;
	z-index: 99999;
	width: 280px;
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.08);
	border: 1px solid #e2e8f0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(4px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.cea-popover.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.cea-popover-card {
	display: block;
	text-decoration: none !important;
	color: inherit !important;
}

.cea-popover-img-wrap {
	width: 100%;
	height: 145px;
	overflow: hidden;
	background: #f1f5f9;
}

.cea-popover-img-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cea-popover-body {
	padding: 14px 16px 16px;
}

.cea-popover-datetime {
	font-size: 11.5px;
	color: #64748b;
	margin-bottom: 6px;
	font-weight: 500;
}

.cea-popover-title {
	margin: 0 0 8px 0 !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	line-height: 1.35 !important;
}

.cea-popover-desc {
	margin: 0 !important;
	font-size: 12.5px !important;
	color: #475569 !important;
	line-height: 1.45 !important;
}

/* Responsivo */
@media (max-width: 768px) {
	.cea-wrapper {
		padding: 14px;
	}
	.cea-weekdays > div {
		font-size: 10px;
		padding-left: 4px;
		text-align: center;
	}
	.cea-day-cell {
		min-height: 95px;
		padding: 6px;
	}
	.cea-day-number {
		font-size: 14px;
	}
	.cea-event-time {
		font-size: 10px;
	}
	.cea-event-title {
		font-size: 11px;
	}
}