/* ============ BASE / TIPOGRAFÍA ============ */
.mid-dashboard, .mid-panel, .mid-login-wrap, .mid-confirmar-wrap, .mid-checkin-resultado, .mid-qr-wrap, .mid-saludo-invitado {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-sizing: border-box;
}
.mid-dashboard *, .mid-dashboard *:before, .mid-dashboard *:after { box-sizing: border-box; }

/* ============ LOGIN ============ */
.mid-login-wrap {
	max-width: 380px;
	margin: 40px auto;
	padding: 30px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.08);
	text-align: center;
}

/* ============ TARJETA GENÉRICA (usada por check-in y avisos) ============ */
.mid-panel {
	max-width: 720px;
	margin: 20px auto;
	padding: 24px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 2px 16px rgba(0,0,0,0.08);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mid-selector-evento { margin-bottom: 16px; }
.mid-cerrar-sesion { font-size: 13px; color: #999; text-decoration: none; }

/* ============ BUSCADOR GENÉRICO ============ */
.mid-buscador input, #mid-buscar-checkin {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e2e2ea;
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
}

/* ============ TABLA DE INVITADOS (usada en el panel y en check-in) ============ */
.mid-tabla-invitados {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}
.mid-tabla-invitados th {
	text-align: left;
	color: #9497a8;
	font-weight: 600;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: 10px 8px;
	border-bottom: 1px solid #eee;
}
.mid-tabla-invitados td {
	padding: 12px 8px;
	border-bottom: 1px solid #f2f2f5;
	color: #33354a;
}

.mid-boton-whatsapp {
	background: #25D366;
	color: #fff;
	padding: 6px 12px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 12px;
	white-space: nowrap;
}

.mid-boton {
	display: inline-block;
	background: #222;
	color: #fff;
	padding: 12px 20px;
	border-radius: 10px;
	text-decoration: none;
	font-size: 14px;
	border: none;
	cursor: pointer;
}

.mid-actualizado { margin-top: 14px; font-size: 12px; color: #aaa; text-align: center; }

/* ============ FORMULARIO PÚBLICO DE CONFIRMACIÓN ============ */
.mid-confirmar-wrap {
	max-width: 420px; margin: 30px auto; padding: 28px;
	background: #fff; border-radius: 14px; box-shadow: 0 2px 16px rgba(0,0,0,0.08);
	text-align: center;
}
.mid-form-confirmar { display: flex; gap: 10px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.mid-boton-si { background: #22c55e; }
.mid-boton-no { background: #ef4444; }
.mid-mensaje-confirmacion { background: #e9f9ee; color: #1a7d3a; padding: 12px; border-radius: 8px; margin: 16px 0; }
.mid-estado-actual { font-size: 13px; color: #777; }

/* ============ CHECK-IN ============ */
.mid-checkin-resultado { max-width: 420px; margin: 30px auto; padding: 30px; border-radius: 14px; text-align: center; }
.mid-checkin-ok { background: #e9f9ee; border: 2px solid #22c55e; }
.mid-checkin-repetido { background: #fff8e6; border: 2px solid #f59e0b; }
.mid-checkin-error { background: #fdeaea; border: 2px solid #ef4444; }
.mid-checkin-nombre { font-size: 22px; font-weight: 700; margin: 10px 0; }

/* ============ QR / SALUDO ============ */
.mid-qr-wrap { max-width: 320px; margin: 30px auto; padding: 24px; background: #fff; border-radius: 14px; box-shadow: 0 2px 16px rgba(0,0,0,0.08); text-align: center; }
.mid-qr-caja { display: flex; justify-content: center; margin-top: 16px; }
.mid-saludo-invitado { max-width: 420px; margin: 0 auto 16px; padding: 14px 18px; background: #f3ebfd; border-radius: 10px; text-align: center; }

/* =====================================================================
   PANEL DE CLIENTE — NUEVO DISEÑO
   ===================================================================== */

.mid-dashboard {
	display: flex;
	align-items: flex-start;
	gap: 0;
	max-width: 1400px;
	margin: 20px auto;
	background: #f6f5fb;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 4px 30px rgba(30,20,60,0.08);
}

/* ---------- SIDEBAR ---------- */
.mid-sidebar {
	width: 230px;
	flex-shrink: 0;
	background: linear-gradient(180deg, #2c1c4d 0%, #1b1030 100%);
	color: #fff;
	padding: 28px 18px;
	position: sticky;
	top: 20px;
	align-self: stretch;
	min-height: 100%;
}
.mid-logo {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 26px;
	line-height: 1.1;
	margin-bottom: 30px;
	color: #fff;
}
.mid-logo span { font-size: 11px; letter-spacing: .2em; color: #c9b7f0; font-family: -apple-system, sans-serif; }

.mid-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 30px; }
.mid-nav-item {
	display: block;
	padding: 10px 14px;
	border-radius: 10px;
	color: #d7cdf0;
	text-decoration: none;
	font-size: 14px;
	transition: background .15s ease;
}
.mid-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.mid-nav-item.mid-activo { background: #7c3aed; color: #fff; font-weight: 600; }

.mid-ayuda-card {
	background: rgba(255,255,255,0.08);
	border-radius: 14px;
	padding: 16px;
	font-size: 13px;
	color: #d7cdf0;
}
.mid-ayuda-card strong { display: block; color: #fff; margin-bottom: 6px; font-size: 14px; }
.mid-ayuda-card p { margin: 0 0 12px; }
.mid-boton-ayuda {
	display: block;
	text-align: center;
	background: #7c3aed;
	color: #fff;
	padding: 9px;
	border-radius: 8px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}

/* ---------- MAIN ---------- */
.mid-main { flex: 1; padding: 28px 32px; min-width: 0; }

.mid-banner-demo {
	background: #fff4d6;
	border: 1px solid #f3d98b;
	color: #7a5c00;
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 13px;
	margin-bottom: 18px;
}

.mid-topbar {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 24px;
}
.mid-saludo h1 { margin: 0 0 4px; font-size: 26px; color: #201a33; }
.mid-subtitulo { margin: 0; font-size: 14.5px; color: #4a4460; font-weight: 600; }
.mid-descripcion { margin: 2px 0 0; font-size: 13.5px; color: #8a86a0; }

.mid-topbar-derecha { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.mid-selector-evento {
	background: #fff;
	border-radius: 12px;
	padding: 10px 16px;
	box-shadow: 0 2px 10px rgba(30,20,60,0.06);
}
.mid-selector-evento label { display: block; font-size: 11px; color: #9497a8; margin-bottom: 2px; }
.mid-selector-evento select { border: none; font-size: 14px; font-weight: 600; color: #201a33; background: transparent; padding: 2px 0; }
.mid-evento-nombre { font-size: 14px; font-weight: 600; color: #201a33; }
.mid-fecha-chip { display: block; margin-top: 4px; font-size: 12px; color: #7c3aed; }

.mid-usuario-chip {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border-radius: 12px;
	padding: 8px 14px 8px 8px;
	box-shadow: 0 2px 10px rgba(30,20,60,0.06);
}
.mid-usuario-chip img { border-radius: 50%; width: 40px; height: 40px; }
.mid-usuario-chip strong { display: block; font-size: 13.5px; color: #201a33; }
.mid-usuario-chip span { font-size: 11.5px; color: #9497a8; }
.mid-usuario-chip .mid-cerrar-sesion { margin-left: 10px; }

/* ---------- TARJETAS DE ESTADÍSTICAS ---------- */
.mid-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
	margin-bottom: 22px;
}
.mid-stat-card {
	background: #fff;
	border-radius: 16px;
	padding: 18px 20px;
	display: flex;
	align-items: center;
	gap: 14px;
	box-shadow: 0 2px 12px rgba(30,20,60,0.05);
}
.mid-stat-icono {
	width: 46px; height: 46px; border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
	font-size: 20px; flex-shrink: 0;
}
.mid-icono-morado { background: #efe6fd; }
.mid-icono-verde  { background: #e2f8ea; }
.mid-icono-naranja{ background: #fdf0dc; }
.mid-icono-azul   { background: #e2eefd; }

.mid-stat-label { display: block; font-size: 12.5px; color: #8a86a0; }
.mid-stat-num   { display: block; font-size: 24px; font-weight: 700; color: #201a33; line-height: 1.3; }
.mid-stat-sub   { display: block; font-size: 11.5px; color: #a5a2b5; }

/* ---------- GRÁFICAS + ACCIONES RÁPIDAS ---------- */
.mid-graficas-row {
	display: grid;
	grid-template-columns: 1.1fr 1.3fr 1fr;
	gap: 16px;
	margin-bottom: 22px;
}
.mid-card {
	background: #fff;
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 2px 12px rgba(30,20,60,0.05);
}
.mid-card h3 { margin: 0 0 14px; font-size: 15px; color: #201a33; }

.mid-dona-wrap { display: flex; align-items: center; gap: 16px; }
.mid-dona-wrap canvas { max-width: 130px; max-height: 130px; }
.mid-dona-leyenda { font-size: 13px; color: #55506c; display: flex; flex-direction: column; gap: 10px; }
.mid-dona-leyenda div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mid-dona-leyenda strong { color: #201a33; margin-left: auto; }
.mid-dona-leyenda small { color: #a5a2b5; width: 100%; margin-left: 20px; }

.mid-punto { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.mid-punto-verde   { background: #22c55e; }
.mid-punto-naranja { background: #f59e0b; }
.mid-punto-rojo    { background: #ef4444; }
.mid-punto-azul    { background: #3b82f6; }

.mid-card-acciones { display: flex; flex-direction: column; }
.mid-accion-rapida {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 6px; border-radius: 10px;
	text-decoration: none; color: inherit;
	background: none; border: none; cursor: pointer; text-align: left; width: 100%;
	font-family: inherit;
}
.mid-accion-rapida:hover { background: #f6f5fb; }
.mid-accion-icono {
	width: 36px; height: 36px; border-radius: 10px;
	display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.mid-accion-rapida strong { display: block; font-size: 13.5px; color: #201a33; }
.mid-accion-rapida small { display: block; font-size: 11.5px; color: #a5a2b5; }

/* ---------- FILA INFERIOR: TABLA + LEYENDA/AYUDA ---------- */
.mid-inferior-row {
	display: grid;
	grid-template-columns: 2.4fr 1fr;
	gap: 16px;
	align-items: start;
}

.mid-tabla-header { margin-bottom: 14px; }
.mid-tabla-header h3 { margin: 0 0 12px; }
.mid-filtros-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mid-tab {
	border: 1px solid #e6e4ef; background: #fff; color: #6a6680;
	padding: 7px 14px; border-radius: 20px; font-size: 12.5px; cursor: pointer;
}
.mid-tab-activo { background: #7c3aed; border-color: #7c3aed; color: #fff; }

.mid-pill { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.mid-pill-verde   { background: #e2f8ea; color: #1a9c4c; }
.mid-pill-naranja { background: #fdf0dc; color: #c07d10; }
.mid-pill-roja    { background: #fdeaea; color: #d43333; }

.mid-celda-qr { text-align: center; }
.mid-qr-ok { color: #22c55e; }
.mid-qr-pendiente { color: #ef4444; }

.mid-celda-acciones { display: flex; gap: 6px; }
.mid-icono-accion {
	width: 30px; height: 30px; border-radius: 8px;
	display: inline-flex; align-items: center; justify-content: center;
	text-decoration: none; font-size: 14px;
}
.mid-icono-whatsapp { background: #e2f8ea; }
.mid-icono-llamada  { background: #e2eefd; }

.mid-columna-derecha { display: flex; flex-direction: column; gap: 16px; }
.mid-card-leyenda h3 { margin-bottom: 10px; }
.mid-leyenda-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #55506c; padding: 5px 0; }

.mid-card-dudas { background: linear-gradient(145deg, #efe6fd, #e2eefd); }
.mid-card-dudas strong { display: block; margin-bottom: 6px; color: #201a33; font-size: 14px; }
.mid-card-dudas p { margin: 0 0 10px; font-size: 12.5px; color: #6a6680; }
.mid-card-dudas a { color: #7c3aed; font-weight: 600; font-size: 13px; text-decoration: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
	.mid-graficas-row { grid-template-columns: 1fr 1fr; }
	.mid-card-acciones { grid-column: span 2; }
	.mid-inferior-row { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
	.mid-dashboard { flex-direction: column; }
	.mid-sidebar { width: 100%; position: static; }
	.mid-graficas-row { grid-template-columns: 1fr; }
	.mid-stats-grid { grid-template-columns: repeat(2, 1fr); }
	.mid-topbar-derecha { width: 100%; }
}
